Skip to main content

Security auditor for LLM library supply chains - detects compromised PyPI packages

Project description

litellm-supply-chain-auditor

Scan Python projects for compromised LLM dependencies. Think npm audit for your AI stack.

What is this?

A CLI tool and GitHub Action that detects malicious or compromised versions of popular LLM libraries (LiteLLM, LangChain, LlamaIndex) in your Python projects. It verifies package integrity against known-good hashes, cross-references against CVE databases, and generates detailed security audit reports—all designed to address the real supply chain vulnerabilities affecting AI teams today.

Features

  • Dependency Scanning: Analyzes requirements.txt, pyproject.toml, and poetry.lock files
  • Hash Verification: Validates package integrity against PyPI records and historical snapshots
  • CVE Detection: Real-time integration with GitHub Advisory Database for known compromises
  • Blast Radius Analysis: Visualize dependency trees to understand the impact of compromised packages
  • GitHub Action: Drop-in CI/CD integration for continuous monitoring
  • Security Reports: Generate detailed audit reports with remediation guidance
  • Pre-commit Hook: Catch vulnerable dependencies before they're committed

Quick Start

Installation

pip install litellm-supply-chain-auditor

Basic Usage

# Scan your project
litellm-auditor scan

# Scan a specific directory
litellm-auditor scan --path /path/to/project

# Generate a full audit report
litellm-auditor audit --output report.pdf

# Verify specific package versions
litellm-auditor verify litellm==1.0.0

GitHub Action

Add to .github/workflows/security.yml:

name: LLM Supply Chain Audit
on: [push, pull_request]

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: your-org/litellm-supply-chain-auditor@v1
        with:
          fail-on-vulnerability: true

Pre-commit Hook

Add to .pre-commit-config.yaml:

- repo: https://github.com/your-org/litellm-supply-chain-auditor
  rev: v1.0.0
  hooks:
    - id: litellm-audit

Usage Examples

# Scan and display results in terminal
$ litellm-auditor scan
✓ Requirements parsed: 24 dependencies
⚠ Checking against CVE database...
✗ CRITICAL: litellm 0.1.911 is known compromised
   Upgrade to 0.1.912 or later
   See: https://github.com/advisories/...

# Export detailed JSON report
$ litellm-auditor scan --format json --output audit.json

# Strict mode: fail if any vulnerability found
$ litellm-auditor scan --strict

Tech Stack

  • Language: Python 3.8+
  • CLI Framework: Click
  • Data Format: Rich for terminal output
  • API Integration: Requests (GitHub Advisory Database)
  • Testing: pytest
  • Packaging: pyproject.toml (setuptools)
  • CI/CD: GitHub Actions

Monitored Packages

  • LiteLLM
  • LangChain
  • LlamaIndex

See MONITORED_PACKAGES.md for the complete list and update cadence.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

MIT License — see LICENSE for details.

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

litellm_supply_chain_auditor-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

litellm_supply_chain_auditor-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file litellm_supply_chain_auditor-0.1.0.tar.gz.

File metadata

File hashes

Hashes for litellm_supply_chain_auditor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3c55cdb3735085b9df112a045bd3fc6d4290a5e504fc8c711b208cf9f3f0f158
MD5 efc1cfa19ea641ce31a6e87a53c442bc
BLAKE2b-256 25abd8cb2f3cc442fb2fabd8a7b7c265c9d9b5d57b6bab054b2286502378b6fc

See more details on using hashes here.

File details

Details for the file litellm_supply_chain_auditor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for litellm_supply_chain_auditor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ea485f719f8c07e780417ce60922b8f718e2da0d37e4d3d1d32f4034569a580
MD5 4a30b639a60272056332ea2a9fb8d591
BLAKE2b-256 35ad8fbc4fc4d06ef6ba4644e94631bd498d8f720e2f2d6b16558d01b423f01a

See more details on using hashes here.

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