depsec

Supply Chain
Security Scanner

Single binary. Zero config. Detects vulnerabilities, malicious code, hardcoded secrets, workflow misconfigurations, and unexpected network connections.

$ curl -fsSL https://depsec.dev/install | sh
50+
detection rules
317
tests
10.5k
malware detected
14
dependencies

What it catches

PATTERNS 15 rules

Malicious Code Detection

AST-aware analysis via tree-sitter. Catches eval/exec injection, credential harvesting, encoded payloads, install hooks, and obfuscation — while ignoring safe regex.exec() calls.

tree-sitter ASTJS/TS/PythonReachability
SECRETS 23 rules

Secret Detection

20 format-specific regex patterns plus 3 AST-based rules combining variable name analysis with Shannon entropy. Catches AWS keys, GitHub tokens, Stripe keys, PEM files, and more.

Regex + ASTEntropyPre-commit hook
DEPS 8 ecosystems

Dependency Vulnerabilities

Queries the OSV API for all ecosystems in one pass. Parses Cargo.lock, package-lock.json, yarn.lock, pnpm-lock.yaml, Gemfile.lock, go.sum, poetry.lock, and requirements.txt.

OSV APIBatch queriesAll ecosystems
WORKFLOWS 5 rules

Workflow Security

Hardens GitHub Actions. Detects unpinned actions, expression injection via user-controlled inputs, pull_request_target attacks, and overly permissive workflow permissions.

Auto-fixSHA pinningInjection detection
NETWORK Runtime

Network Monitor

Runtime surveillance catches attacks invisible to static analysis: IMDS credential theft, C2 check-ins, DNS exfiltration, reverse shells, and install-time phone-home behavior.

Baseline diffInstall guardShell hook
HYGIENE 4 rules

Repository Hygiene

Checks that SECURITY.md exists, .gitignore covers sensitive patterns (.env, *.pem, *.key), lockfiles are committed, and branch protection is enabled on main.

SECURITY.md.gitignoreBranch protection

Invisible shield for installs

One command wraps any package install with preflight checks, OS-level sandboxing, network monitoring, and file watchdog — all running concurrently.

# Full protection pipeline
$ depsec protect npm install sketchy-pkg
1. Preflight

Typosquatting detection via Levenshtein distance against 237 popular packages. Install hook detection. Lockfile integrity. deps.dev metadata freshness.

2. Sandbox

OS-level isolation. Masks ~/.ssh, ~/.aws, ~/.gnupg, ~/.npmrc via tmpfs overlays. Bubblewrap on Linux, sandbox-exec on macOS, Docker anywhere.

3. Monitor

Network polling every 100ms via ss/lsof. Classifies connections as expected, unexpected, or critical. IMDS credential theft is an instant flag.

4. Attest

HMAC-SHA256 signed JSON recording every connection, file access, and write violation. Tamper-evident proof for your audit trail.

Shell Hook
$ eval "$(depsec setup --shell)"

Auto-routes all package managers (npm, pip, cargo, go, gem, bundle) through the protection pipeline.

Canary Tokens

Plants fake but realistic credentials inside the sandbox — SSH keys, AWS creds, .env files.

If a malicious script reads them, the watchdog catches it immediately.

File Watchdog

Monitors every open file descriptor in the entire process tree at 100ms intervals.

Detects sensitive file reads and write boundary violations outside the project.

Measured, not marketed

100%

Detection rate against 10,582 real malware packages from the Datadog malicious-software-packages-dataset.

Not a synthetic benchmark. Real supply chain attacks extracted from npm and PyPI registries.

npm malware 8,806 / 8,806
PyPI malware 1,776 / 1,776
Design Principles
Own the parsers
AST over regex
No plugins
No secrets required
14 dependencies
Query OSV directly

All-in-one, not one-of-many

Other tools specialize. depsec covers the full surface — dependencies, code patterns, secrets, workflows, and network — in a single binary.

Feature depsecgitleakstrufflehogguarddogzizmorsnyk
Language Rust Go Go Python Rust SaaS
Single binary
Secrets (regex) 20 800+ 800+
Secrets (AST + entropy)
Malware detection 15 rules
AST-aware analysis tree-sitter semgrep
Vulnerability scan OSV (all)
Workflow security 5 rules 34 rules
Network monitoring
LLM triage
Reachability
Auto-fix
Zero config

Scan, score, ship

One command gives you a security grade with actionable findings. Build-only tools are separated from runtime threats.

Scan Output
$ depsec scan .
depsec v0.10.0 — Supply Chain Security Scanner
Project: my-app
[Patterns]
── ACTION REQUIRED (2 runtime packages) ──
evil-pkg (2 findings)
✗ P001: Shell Execution
node_modules/evil-pkg/index.js:42
✗ P004: Credential Harvesting
node_modules/evil-pkg/lib/steal.js:8
── BUILD TOOLS (safe, 12 findings collapsed) ──
[Dependencies] 0 vulnerabilities (142 checked)
[Secrets] No hardcoded secrets (234 files)
[Workflows] Actions pinned, permissions minimal
[Hygiene] SECURITY.md, .gitignore, lockfile
Scorecard
DEPSEC SCORECARD
7.8/10 B
Patterns
80% 2
Deps
100%
Secrets
100%
Workflows
100%
Hygiene
100%
A 90-100 B 75-89 C 60-74 D 40-59 F 0-39
Human-readable
JSON (--json)
SARIF (--format sarif)
SVG Scorecard

Built for AI agents

depsec ships with agent instructions out of the box. Add it to your AI coding tool and it will scan, fix, and protect your project automatically.

Claude Code
CLAUDE.md / Skills
Add to your CLAUDE.md:
## Security
Run `depsec scan .` before committing.
Run `depsec fix .` to auto-pin Actions.
Run `depsec protect npm install <pkg>`
for unfamiliar packages.

Or use the SKILL.md in the repo root — follows the AgentSkills spec.

Codex / Cursor / Windsurf
AGENTS.md
# Already included in the repo
$ cat AGENTS.md

Codex CLI, Cursor, and Windsurf automatically read AGENTS.md from the repo root. No extra setup needed.

OpenClaw / Gemini / Amp
AgentSkills spec
# SKILL.md in repo root
name: depsec-scan
description: Supply chain scanner
compatibility: depsec on PATH

One SKILL.md works across 10+ AI coding tools via the open AgentSkills standard.

What your agent learns
Scan before every commit
Auto-fix Actions pinning
Protect unfamiliar installs
Install pre-commit hooks
Interpret severity grades
Triage with LLM context
Read SARIF for CI
Audit suspicious packages

Get started in seconds

Shell Script
Recommended
$ curl -fsSL \
  https://depsec.dev/install | sh

Auto-detects OS & arch. Verifies SHA-256 checksum. Installs to ~/.local/bin.

Cargo
Build from source
$ cargo install depsec

Requires Rust toolchain. Builds with LTO and strip for minimal binary size.

GitHub Action
CI/CD integration
- uses: chocksy/depsec@v1

SARIF output integrates with GitHub Code Scanning. Exit code 1 on findings.

Targets: x86_64-linux-musl aarch64-linux-musl x86_64-apple-darwin aarch64-apple-darwin
Quick Start
# Scan current project
$ depsec scan .
# Auto-fix GitHub Actions pinning
$ depsec fix .
# Protected package install
$ depsec protect npm install sketchy-pkg
# Install pre-commit secret detection
$ depsec setup --hook
# Deep audit a specific package
$ depsec audit suspicious-package