Skip to content

pip-audit

pip-audit is the official pypa tool for scanning Python environments for packages with known vulnerabilities. It uses the Python Packaging Advisory Database (https://github.com/pypa/advisory-database) via the PyPI JSON API as a source of vulnerability reports.

Installation

pip install pip-audit

Usage

pip-audit
On completion, pip-audit will exit with a code indicating its status.

The current codes are:

  • 0: No known vulnerabilities were detected.
  • 1: One or more known vulnerabilities were found.

pip-audit's exit code cannot be suppressed. See Suppressing exit codes from pip-audit for supported alternatives.

References