Dependency scanning

From seb1n/awesome-ai-agent-skills · View interactive version

Dependency scanning is an AI agent skill from the GitHub repository seb1n/awesome-ai-agent-skills. Scan project dependencies for known vulnerabilities, generate software bills of materials, and enforce license compliance across the software supply chain. Use when the user requests dependency scanning or provides relevant inputs for this workflow.

How to use this skill

Skill file

Dependency Scanning

This skill enables the agent to analyze a project's direct and transitive dependencies for known security vulnerabilities, outdated packages, and license compliance issues. The agent parses manifest and lock files, queries vulnerability databases (NVD, GitHub Advisory, OSV), produces structured reports with CVE identifiers and remediation guidance, and can generate a Software Bill of Materials (SBOM) in standard formats.

Workflow

  1. Detect Package Ecosystem and Manifest Files — Identify the project's language ecosystem by locating dependency manifests such as package.json and package-lock.json (Node.js), requirements.txt and Pipfile.lock (Python), pom.xml or build.gradle (Java), go.sum (Go), or Gemfile.lock (Ruby). Detect monorepo structures with multiple manifests.
  1. Resolve the Full Dependency Tree — Parse lock files to build the complete dependency graph including transitive dependencies. Identify dependency depth, shared sub-dependencies, and version constraints. Flag phantom dependencies that are used in code but missing from the manifest.
  1. Scan Against Vulnerability Databases — Query the National Vulnerability Database (NVD), GitHub Advisory Database, and OSV for each resolved package and version. Match results by CPE or PURL identifier. Record CVE IDs, CVSS scores, severity levels, affected version ranges, and fixed versions where available.
  1. Assess License Compliance — Extract the declared license for each dependency and compare it against the project's license policy. Flag copyleft licenses (GPL, AGPL) in proprietary projects, identify packages with no declared license, and detect license conflicts between direct and transitive dependencies.
  1. Generate SBOM and Vulnerability Report — Produce a Software Bill of Materials in CycloneDX or SPDX format. Generate a vulnerability report sorted by severity, including CVE identifiers, affected dependency paths, available fix versions, and whether the vulnerable code path is reachable.
  1. Recommend and Apply Fixes — Suggest the minimum version upgrades required to resolve vulnerabilities without breaking changes. Where possible, generate updated manifest and lock files automatically. Flag cases where no fix is available and suggest alternative packages or workarounds.

Supported Technologies

Usage

Provide the agent with the path to a project directory or a specific manifest file. Optionally specify a license policy or target compliance standard. The agent will perform a full scan and deliver a prioritized vulnerability report.

Prompt example:

Scan the Node.js project in /app for dependency vulnerabilities. Generate a CycloneDX SBOM and flag any GPL-licensed transitive dependencies.

Examples

Example 1: Scanning a Node.js Project

Command:

npm audit --json > audit-report.json

Vulnerability Report (excerpt):

| # | Severity | Package | Installed | Fixed In | CVE | Dependency Path |

|---|----------|---------|-----------|----------|-----|-----------------|

| 1 | Critical | jsonwebtoken | 8.5.1 | 9.0.0 | CVE-2022-23529 | direct |

| 2 | High | minimatch | 3.0.4 | 3.0.5 | CVE-2022-3517 | express > send > mime > minimatch |

| 3 | High | qs | 6.5.2 | 6.5.3 | CVE-2022-24999 | express > qs |

| 4 | Medium | semver | 5.7.1 | 5.7.2 | CVE-2022-25883 | nodemon > semver |

| 5 | Low | cookie | 0.4.1 | 0.4.2 | CVE-2024-47764 | express > cookie |

Auto-generated fix in package.json:

{
  "dependencies": {
    "jsonwebtoken": "^9.0.0",
    "express": "^4.19.2"
  },
  "overrides": {
    "minimatch": "3.0.5",
    "semver": "5.7.2"
  }
}

Example 2: Scanning a Python Project with pip-audit

Command:

pip-audit -r requirements.txt --format json --output audit.json --fix --dry-run

Vulnerability Report (excerpt):

| # | Severity | Package | Installed | Fixed In | CVE | Description |

|---|----------|---------|-----------|----------|-----|-------------|

| 1 | Critical | cryptography | 38.0.0 | 41.0.6 | CVE-2023-49083 | NULL pointer dereference when loading PKCS7 certificates |

| 2 | High | requests | 2.28.0 | 2.31.0 | CVE-2023-32681 | Leaking Proxy-Authorization header to redirected hosts |

| 3 | High | Jinja2 | 3.1.1 | 3.1.3 | CVE-2024-22195 | Cross-site scripting via xmlattr filter |

| 4 | Medium | setuptools | 65.0.0 | 70.0.0 | CVE-2024-6345 | Remote code execution via download functions |

Auto-generated requirements.txt (fixed):

cryptography==41.0.6    # was 38.0.0 — fixes CVE-2023-49083
requests==2.31.0        # was 2.28.0 — fixes CVE-2023-32681
Jinja2==3.1.3           # was 3.1.1 — fixes CVE-2024-22195
setuptools>=70.0.0      # was 65.0.0 — fixes CVE-2024-6345
Flask==3.0.0
gunicorn==21.2.0

Best Practices

Safety Boundaries

Edge Cases

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.