Dependency Scanning skill for Codex
Triage CVEs to fixes, not alert counts. This skill scans third-party dependencies for known vulnerabilities across npm, Python, Go, Rust and Java, then does the part scanners skip: separating reachable, fixable issues from transitive noise, picking the smallest safe bump, and wiring Dependabot or Renovate so fixes keep landing. It ends in actions and a CI gate that stays actionable.
curl -fsSL codexskills.dev/install.sh \ | sh -s -- dependency-scanning Installs to ~/.agents/skills/dependency-scanning/ for every project on this machine.
curl -fsSL codexskills.dev/cli.mjs -o codex-skills.mjsnode codex-skills.mjs install dependency-scanning The CLI also searches, updates and removes skills. Run it with no arguments to pick from a list. Needs Node 20.12+.
curl -fsSL codexskills.dev/install.sh \ | sh -s -- --project dependency-scanning Installs to .agents/skills/dependency-scanning/ in the current repository. Commit it and everyone who runs Codex there gets it.
curl -fsSLO codexskills.dev/downloads/dependency-scanning.zipunzip -o dependency-scanning.zip -d ~/.agents/skills/ The archive holds the skill folder with its generated agents/openai.yaml. Unzip into .agents/skills/ to scope it to a repo.
& ([scriptblock]::Create((irm codexskills.dev/install.ps1))) dependency-scanning PowerShell 5.1 or 7. Installs to %USERPROFILE%\.agents\skills\. Add -Project for the current repo.
104-line POSIX script. No sudo, no telemetry. Read install.sh
Use it in Codex
Start a prompt with $dependency-scanning, or pick it from /skills.
You can also just describe the task: Codex reads the description below and loads the playbook when your request matches.
What Codex reads before loading it
Finds and triages known vulnerabilities in third-party dependencies (SCA) across npm, Python, Go, Rust, Java and more using npm audit, pip-audit, osv-scanner, govulncheck and GitHub Dependabot, then separates reachable, fixable issues from noise and wires automated updates. Use when asked to check dependencies for CVEs, a scanner is failing CI, or you are setting up Dependabot/Renovate. Not for scanning your own source code (SAST).
Use it when
- Checking dependencies for known vulnerabilities
- A dependency scanner is failing or flooding CI
- Setting up automated updates with Dependabot or Renovate
Use something else when
- You want to scan your own source for bugs, not dependencies: use semgrep-sast
- The concern is leaked secrets in the repo: use secret-scanning
- You are scanning a container image's OS packages: use container-scanning
How to check the result
Re-run the scanner after fixes so the finding is gone with no new ones, the lockfile diff is minimal, and the test suite passes.
The mistake it prevents
Running audit fix --force or jumping a major version blindly, breaking production worse than the CVE, or scanning against unpinned ranges with no committed lockfile.
A dependency scan is useful when it ends in action: upgrade, pin, replace, or document a justified ignore. The goal is not zero alerts — it is no exploitable, fixable vulnerability left unpatched, and a flow that keeps it that way. Reachability and a real fix matter more than the raw count.
Inspect first
- Read
AGENTS.mdand detect the ecosystem(s) from lockfiles:package-lock.json/pnpm-lock.yaml/yarn.lock,poetry.lock/requirements.txt/uv.lock,go.sum,Cargo.lock,pom.xml/gradle.lockfile,Gemfile.lock. - Scanning reads the lockfile, so a lockfile must exist and be committed. If it is missing, generate and commit it first — results are only meaningful against pinned versions.
- Some scanners fetch advisory data over the network; Codex’s sandbox may block that. Note when a step needs network, and prefer tools with an offline/local DB where possible.
Tool per ecosystem
| Ecosystem | Primary | Notes |
|---|---|---|
| npm/pnpm/yarn | npm audit / pnpm audit / yarn npm audit | Fast; --omit=dev to focus prod; noisy transitive deps |
| Python | pip-audit | Uses PyPI + OSV; pip-audit -r requirements.txt or against the env |
| Go | govulncheck ./... | Best-in-class: reports only vulns your code actually calls |
| Rust | cargo audit | RustSec advisory DB |
| Java/Kotlin | OWASP Dependency-Check or gradle dependencyCheckAnalyze | Slower; needs NVD data |
| Any / polyglot | osv-scanner -r . | One tool across ecosystems; reads many lockfiles; OSV DB |
osv-scanner is the pragmatic default for a mixed repo:
osv-scanner --lockfile=package-lock.json --lockfile=go.sum --format table .
# or recursively discover lockfiles
osv-scanner -r .
Triage: separate signal from noise
A scanner lists everything with a known CVE; most reports are over-counted. Triage each:
- Is it reachable? A vuln in a dev-only tool, a code path you never call, or a feature
you do not use is lower priority.
govulnchecktells you call-reachability for Go; elsewhere reason about it (is the package a runtime or build dependency? is the vulnerable function imported?). - Is there a fix? Check the advisory’s “patched versions”. If yes → upgrade. If no → pin, replace the package, or apply a documented workaround.
- Severity and context. Use CVSS plus your exposure: a High CVSS in an internet-facing path outranks a Critical in an offline dev script.
- Direct vs transitive. Direct deps you bump yourself; transitive ones you fix by
bumping the parent or using an override (
overridesin npm,resolutionsin yarn/pnpm, Goreplace, Cargo[patch]).
Decide one outcome per finding: upgrade, override/pin, replace, or ignore with justification (record the advisory ID, why it is not reachable/exploitable, and a review date).
Fixing
npm audit fix # safe, semver-compatible bumps
npm audit fix --force # only after reading the breaking changes; retest
npm update <pkg> # targeted bump
- Prefer the smallest bump that clears the advisory; read the changelog for the jump.
- For transitive-only fixes, add an override pinning the fixed version rather than forcing a major upgrade of the whole tree.
- After any bump, run the test suite and the scanner again; a “fix” that breaks the build or reintroduces another vuln is not done.
Automate so it stays fixed
Wire one of these (hand off CI specifics to github-actions-workflows / secrets-in-ci):
- Dependabot (
.github/dependabot.yml):package-ecosystem,directory,schedule. Group minor/patch updates to cut PR noise; enable security updates. - Renovate: more configurable grouping, automerge rules, dependency dashboard.
- Run the scanner in CI and fail only on fixable vulns at/above a chosen severity, so the gate stays actionable instead of perpetually red.
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule: { interval: "weekly" }
groups:
minor-patch:
update-types: ["minor", "patch"]
Verification
- Re-run the scanner after fixes: the finding is gone and no new ones appeared.
- Lockfile diff is minimal and intentional; the app’s tests pass.
- CI gate fails on a newly introduced fixable High, and passes when clean.
Output contract
## Dependency scan — <repo> (<date>)
Ecosystems: <list>. Tools: <list>.
### Findings (actionable)
| Advisory | Package (dep type) | Installed → Fixed | Severity | Reachable? | Action |
|----------|--------------------|-------------------|----------|-----------|--------|
| GHSA-xxxx | lodash (transitive) | 4.17.19 → 4.17.21 | High | yes | override to 4.17.21 |
### Ignored (justified)
- <advisory> — dev-only, not shipped — review <date>
### Automation: <Dependabot/Renovate config added>. CI gate: <severity threshold>.
Hard rules
- Scan a committed lockfile; results against unpinned ranges are not trustworthy.
- Never
audit fix --forceor jump a major version without reading the changelog and retesting — a blind bump can break prod worse than the CVE. - Do not mark a finding resolved without re-scanning; do not blanket-ignore to make CI green.
- A committed secret found incidentally is out of scope here — hand off to secret-scanning.
What the zip contains
SKILL.md plus the interface file below. Nothing runs on install.
agents/openai.yaml
Gives the Codex app a display name, a one-line description and a starter prompt for this skill.
interface:
display_name: "Dependency Scanning"
short_description: "Triage CVEs to fixes, not alert counts"
default_prompt: "$dependency-scanning Scan this repo's dependencies for known CVEs and tell me what to fix first" About this skill
Written and maintained by the Codex Skills editors to the same editorial standard as every skill here: a selective description, a real workflow, known pitfalls and a way to verify the work. First published , last updated . MIT licensed. Something wrong or out of date? Tell us.