Skip to main content

Scan Python packages for supply chain attacks before installing them

Project description

pipguard logo

pipguard

PyPI - Version codecov Documentation Python Version

Python supply chain security tool. Scan packages before installing them.

pip install pipguard
pipguard install litellm==1.82.8   # Blocks the March 2026 attack. Exits 1.

Zero configuration. Zero external dependencies. Pure stdlib.

pipguard demo


The Problem

The March 2026 litellm attack (97M downloads/month) embedded Python code in a .pth file — executed automatically at interpreter startup, exfiltrating SSH keys, AWS credentials, and Kubernetes configs from a single pip install.

Classical tools (pip-audit, GuardDog) are blind to zero-day attacks. They check known signatures. pipguard asks a different question:

Should any pip install be allowed to read ~/.ssh/id_rsa?

The answer is no. And that question doesn't require a database.

Installation

Install pipguard outside your project's virtualenv — this prevents untrusted package code from tampering with the scanner itself.

# Recommended: isolated, persistent install
pipx install pipguard

# CI / one-off use (no pre-install needed)
uvx pipguard install -r requirements.txt

# Standard
pip install pipguard

Usage

# Install a single package
pipguard install requests

# Install from requirements.txt
pipguard install -r requirements.txt

# CI mode: never prompts, exits 1 on CRITICAL/HIGH
pipguard install --yes -r requirements.txt

# Allow a known-legitimate package that accesses credentials
pipguard install --allow paramiko -r requirements.txt

# Override for known false-positives (use with care)
pipguard install --force my-trusted-internal-pkg

For the full reference — risk levels, exit codes, allowlist, and CI integration — see the documentation.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipguard-0.3.1.tar.gz (354.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipguard-0.3.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file pipguard-0.3.1.tar.gz.

File metadata

  • Download URL: pipguard-0.3.1.tar.gz
  • Upload date:
  • Size: 354.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pipguard-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b15983f384ef5cbb497441057b3c18eb06efd839e80a8ebdbff1330c09a412e7
MD5 da7653980c13cf06bda1c4ca9832cc73
BLAKE2b-256 aa0166adc94d1891521bc2262694900916a5a3d325e26a305006fea78a37af98

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipguard-0.3.1.tar.gz:

Publisher: publish.yml on shenxianpeng/pipguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipguard-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pipguard-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pipguard-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef6c4630ed39413a68fd8a934fdd8d9c8993cbaf5a998f97399fa656de2a2b96
MD5 86984ebd0f98cb8ec5c9eaee7e3e1697
BLAKE2b-256 1098739cbb06b34a7cf1bc248ce18e90327c98240daba13d9ada53a6246c0f69

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipguard-0.3.1-py3-none-any.whl:

Publisher: publish.yml on shenxianpeng/pipguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page