Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

pip-audit

$ pip-audit Foundation Low Risk
PyPA · Security & Secrets · Apache-2.0 · macos / linux / windows

pip-audit is the Python Packaging Authority (PyPA) tool for auditing Python environments, requirements.txt, and pyproject.toml files against the PyPI and OSV vulnerability databases. It supports -f json and -f sarif outputs, --fix --dry-run upgrade previews, and offline vulnerability-service caching.

FCRS-1.0 Score
95 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install pip-audit
CLI vs MCP Decision CLI Only

pip-audit -f json inspects the active virtualenv or requirements lockfile locally in one command without needing an MCP server.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 24 / 25

First-class -f json|sarif, --fix --dry-run, -r file targeting, and zero interactive prompts.

  • Supports -f json, -f sarif, --fix --dry-run, and -r
Trust & Safety 24 / 25

Read-only vulnerability lookup by default; --fix explicitly supports --dry-run before mutating environments.

  • Read-only default plus --dry-run on upgrades
Setup & Portability 14 / 15

Trivial installation via brew install pip-audit, pip install pip-audit, or uvx pip-audit across macOS, Linux, and Windows.

  • Available on Homebrew, PyPI, and uvx
Utility & Efficiency 14 / 15

Authoritative PyPA vulnerability scanner backed by both PyPI and OSV advisory feeds.

  • Supports --vulnerability-service pypi|osv
Maintenance & Lineage 10 / 10

Official PyPA project originally developed by Trail of Bits with Google support.

  • Maintained under github.com/pypa/pip-audit
Docs & Verifiability 9 / 10

Clear README and CLI --help covering formats, hashes, and local cache behavior.

  • Official PyPA docs and PyPI page

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; queries public PyPI/OSV advisories and caches data locally.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free and open-source (Apache-2.0).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# pip-audit Agent Rules
- Always run read-only (`-f json`) or `--fix --dry-run` before applying `--fix`.
- Pass `-r <requirements.txt>` explicitly when auditing a project rather than unintentionally auditing the global Python environment.

Agent-Ready Command Recipes

Safe Read-Only Queries

Audit a requirements file and output JSON
pip-audit -r requirements.txt -f json

Resolves dependencies in requirements.txt and outputs known CVEs and fix versions in structured JSON.

Preview dependency vulnerability fixes with dry-run
pip-audit --fix --dry-run -f json

Computes which vulnerable packages --fix would upgrade in the active environment without modifying any installed packages.

Controlled Writes & Previews

Upgrade vulnerable packages in-place
pip-audit --fix -r requirements.txt

Upgrades vulnerable dependencies to patched versions after previewing changes with --dry-run.

Strengths for Agents

  • + Native -f json, -f sarif, and --fix --dry-run provide ideal agent safety and parsing.
  • + Official PyPA lineage with both PyPI and OSV advisory databases.

Caveats & Pitfalls

  • ! Auditing unpinned requirements.txt invokes dependency resolution which requires network access unless --no-deps or pre-resolved files are used.
  • ! Exits non-zero when vulnerabilities are found, which scripts should treat as an expected signal.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI