How to Audit PyPI Packages for Supply Chain Risk Before Installing Them

Known vulnerabilities, who can publish, and how it is published.

To audit a PyPI package before installing it, check three things: known vulnerabilities in the version you are about to install (pip-audit), who maintains and publishes the package and whether they are active (its PyPI page, or a scorer like Commit), and whether it is published from CI with PyPI Trusted Publishing rather than a long-lived token.

1. Known vulnerabilities

pip-audit from the Python Packaging Authority checks packages against known advisories:

pip install pip-audit
pip-audit -r requirements.txt

This catches published CVEs. It does not catch a new malicious release, because nobody has filed an advisory yet.

2. Who publishes it

A takeover usually comes through a maintainer account. Look at the maintainers on the package’s PyPI page, or score them with Commit (ours):

npx proof-of-commitment --pypi requests litellm langchain

It prints publisher count, weekly downloads, age and release history, the same fields it shows for npm.

3. How it is published

Trusted Publishing lets a project publish from CI with short-lived tokens instead of a stored API token. It removes one way to steal publish rights. It does not help if the CI pipeline itself is compromised.

Before an install, not after

Pin versions with hashes (pip install --require-hashes) so that a new release cannot slip in between your check and your install.

Commit is our tool, so weigh what this page says about it accordingly. The commands and behaviour here were run on November 4, 2026; registry data changes, so re-run them rather than trusting a number on this page.