Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.
/ deptrust Public archive

Dependency Trust Scanner — catch slopsquatting and suspicious packages before you pip install. Zero dependencies.

License

Notifications You must be signed in to change notification settings

kriskimmerle/deptrust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deptrust 🔍

Dependency Trust Scanner — Catch slopsquatting and suspicious packages before you pip install.

AI code assistants hallucinate package names. Attackers register those names on PyPI. deptrust scores every dependency on trust signals so you can catch phantom packages, typosquats, and suspicious deps before they hit your environment.

The Problem

  • Slopsquatting: AI models suggest packages that don't exist. Attackers register those names with malicious payloads. (Trend Micro, Unit 42)
  • Typosquatting: reqeusts instead of requests. One character off, totally different package.
  • Supply chain risk: New packages with no history, no downloads, no repo. Should you trust them?

Existing tools check for known CVEs (pip-audit) or malware patterns (GuardDog). deptrust checks whether you should trust the package at all.

Install

pip install deptrust

Or just grab the single file — it has zero dependencies (stdlib only):

curl -O https://raw.githubusercontent.com/kriskimmerle/deptrust/main/deptrust.py
python3 deptrust.py requirements.txt

Usage

# Scan a requirements file
deptrust requirements.txt

# Scan pyproject.toml
deptrust pyproject.toml

# Check specific packages
deptrust -p requests flask some-ai-suggested-pkg

# Verbose mode — show all trust signals
deptrust requirements.txt -v

# JSON output for CI/CD
deptrust requirements.txt --json

# CI mode — fail if any package scores below 60
deptrust requirements.txt --min-score 60

Example Output

deptrust v0.1.0 — Dependency Trust Scanner
────────────────────────────────────────────────────────────
  ✅ 3 TRUSTED │ 🔶 1 WARNING │ ❌ 1 NOT_FOUND
────────────────────────────────────────────────────────────

  ❌ reqeusts  NOT_FOUND  (N/A)
     ↳ Package does NOT exist on PyPI!
     ↳ Similar to popular package: requests
     ↳ Did you mean 'requests'?

  🔶 sketchy-new-pkg  WARNING  (35/100)
     ↳ Similar to popular package: setuptools

  ✅ requests  TRUSTED  (95/100)

  ✅ flask  TRUSTED  (93/100)

  ✅ boto3  TRUSTED  (98/100)

⚠  2 package(s) need immediate attention!

Verbose Mode

  ✅ requests  TRUSTED  (95/100)
     age                  [██████████] 100  Package is 5463 days old (well-established)
     downloads            [██████████] 100  974,677,692 monthly downloads (very popular)
     releases             [██████████] 100  157 releases (mature)
     description          [██████░░░░]  60  Has a short description
     repository           [██████████] 100  Links to source repository
     name_similarity      [██████████] 100  This IS the well-known package 'requests'
     activity             [███████░░░]  70  Last release 163 days ago (maintained)

Trust Signals

Signal Weight What it checks
Downloads 25% Monthly download count from PyPI Stats
Age 20% Days since first release on PyPI
Repository 15% Links to GitHub/GitLab source code
Name similarity 15% Edit distance to popular packages (typosquat detection)
Releases 10% Number of releases (maturity)
Activity 10% Days since last release
Description 5% Does it have a meaningful description?

Risk Levels

Level Score Meaning
✅ TRUSTED 80–100 Well-established, safe to use
⚠️ CAUTION 60–79 Probably fine, but review
🔶 WARNING 40–59 Investigate before using
🚨 DANGER 0–39 Likely malicious or abandoned
❌ NOT_FOUND N/A Package doesn't exist on PyPI

CI/CD Integration

# GitHub Actions
- name: Check dependency trust
  run: |
    pip install deptrust
    deptrust requirements.txt --min-score 60

Exit codes:

  • 0 — All packages pass
  • 1 — Package not found on PyPI, or score below --min-score

How It Works

  1. Parses your dependency file (requirements.txt or pyproject.toml)
  2. For each package, queries the PyPI JSON API and PyPI Stats
  3. Scores each package on 7 trust signals with weighted scoring
  4. Checks name similarity against the top 100+ popular packages using Levenshtein distance
  5. Flags packages that don't exist (hallucinated/phantom packages)
  6. Produces a human-readable report or JSON for CI

Why Not Just Use...

Tool What it does Gap deptrust fills
pip-audit Checks known CVEs Doesn't check trust signals or existence
GuardDog Scans package source for malware Requires downloading the package first
safety CVE database check Same as pip-audit — known vulns only
socket.dev Full supply chain analysis Commercial SaaS, not a simple CLI
sloppylint AI code pattern detector Checks code, not dependencies

deptrust answers a different question: "Should I trust this package at all?"

Requirements

  • Python 3.10+ (uses match syntax — actually, uses dataclasses and type hints)
  • Actually: Python 3.9+ (dataclasses + list[] in annotations via __future__)
  • Zero dependencies — stdlib only

License

MIT

Contributing

Issues and PRs welcome. This is a v0.1 — there's plenty of room to improve:

  • npm/package.json support
  • Pipfile support
  • GitHub repo health checks (stars, issues, contributors)
  • Maintainer email verification
  • Historical trust score tracking
  • Pre-commit hook integration
  • Configurable trust weights
  • Allow-list for known internal packages

About

Dependency Trust Scanner — catch slopsquatting and suspicious packages before you pip install. Zero dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages