npm/pip audit workflows, SBOM basics, and fixing vulnerable dependencies for agent-run codebases. Triggers on: audit dependencies, check for vulnerable packages, fix CVE, generate SBOM, review a requirements file or package.json.
./install.sh dependency-auditsname: "dependency_audits" description: "npm/pip audit workflows, SBOM basics, and fixing vulnerable dependencies for agent-run codebases. Triggers on: audit dependencies, check for vulnerable packages, fix CVE, generate SBOM, review a requirements file or package.json." metadata: { "includeInPrompt": true }
Run dependency vulnerability audits for agent-managed codebases (npm and pip ecosystems), triage findings by severity and fixability, apply safe fixes, and produce SBOMs when handing code to others. Covers the audit -> triage -> fix -> retest -> re-audit loop plus SBOM generation. Scoped to npm and pip only — it does not cover container image scanning, secrets, or license compliance.
npm audit prints the advisories table. npm audit --json gives machine-readable output; top-level keys (verified against npm 10 source) are auditReportVersion, vulnerabilities (per-package findings), and metadata (severity counts under metadata.vulnerabilities, dep-type counts under metadata.dependencies).npm audit --audit-level=moderate so low/info advisories don't drown the signal. Values allowed: info|low|moderate|high|critical|none (verified from npm audit --help).npm ls <pkg> shows the dependency chain — this is how you identify the parent package pulling in a vulnerable transitive dep. npm outdated shows Current/Wanted/Latest drift for every package.npm audit fix — it upgrades only within semver ranges, so it rarely breaks things. npm audit fix --force can jump major versions and break APIs; use it only when no safe fix exists, and re-run the full build + test suite afterward.pip-audit audits the active environment; pip-audit -r requirements.txt audits a requirements file (repeat -r for multiple files). -f json emits dependencies and fixes as the top-level keys. Add --aliases to include alias IDs for each vulnerability (note: -v is just verbose logging, not aliases).pip-audit --fix -r requirements.txt upgrades vulnerable packages and rewrites the requirements file in place with patched pins (verified: it rewrites package==x.y.z pins, annotating subdependencies it pinned explicitly). For manual bumps, pip install -U <pkg> then re-pin.npm ls (npm) or the requirements resolver output (pip) to find the parent, and upgrade it instead of the transitive package directly.package-lock.json / the pinned requirements reflect the fix) -> retest (build + tests) -> re-audit to confirm zero remaining findings at your audit level.npm sbom --sbom-format=cyclonedx (emits CycloneDX 1.5 JSON) and npm sbom --sbom-format=spdx (SPDX 2.3). pip-audit -f cyclonedx-json (or cyclonedx-xml) emits an SBOM for the pip side. Prefer CycloneDX when the recipient doesn't specify — it's the more common default for tooling.Every audit engagement ends with:
--force or major bump / no fix — monitor).package.json, package-lock.json, requirements.txt) and what changed.package-lock.json (and pinned requirements.txt) alongside any fix — an audit that isn't reproducible from the lockfile is unverifiable.npm audit --audit-level=high (or equivalent severity gate) in CI; npm's documented semantics are: exit code 1 when findings at or above the specified level are present, 0 when clean — wire that exit code to the build result.npm audit fix, pinned pip-audit --fix) in automated pipelines. Escalate anything needing --force or a major version bump to a human review — prefer not to auto-merge across majors because breakage is likely.moderate is a reasonable default gate for active projects; use high for noisy legacy codebases you can't fully remediate yet, and document deferred items in the output contract rather than ignoring them.publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e
No ratings yet — be the first to rate it.