Skip to main content

Unified supply-chain security suite — scanner, sandbox, LLM defense, and orchestration

Project description

PicoSentry 🦞

PicoSentry Banner

Local supply-chain scanner with offline, deterministic detection across npm, PyPI, Go, Cargo, Maven, RubyGems, and NuGet. Kernel-sandbox enforcement is included as a beta capability for runtime containment.

PicoSentry scans a candidate package for malicious-behavior patterns — obfuscation, typosquatting, dependency confusion, post-install exfiltration, known IOCs, and CVEs — using a fully offline rule catalog. A kernel-sandbox (seccomp-bpf + landlock) is available to enforce syscalls at install time; full per-syscall tracing from the kernel is tracked as future work.

PyPI Python License: BUSL-1.1


Status

Source of truth: picosentry/experimental.py.

Component Status Notes
picosentry scan Stable Core scanner; 7 ecosystems; deterministic, offline
picosentry sandbox Beta seccomp-bpf enforces; gRPC transport experimental
picosentry watch Beta Prompt-injection detection works; HTTP server experimental
picosentry serve Experimental API server + dashboard in active development
Cross-layer correlation Experimental Links findings across layers
Plugin system Beta Loads and dispatches; signature verify works
Postgres backend Stub SQLite only; migration not started
Cluster mode Experimental Single-node verified; multi-node gossip untested
Detection benchmarks Beta 7 fixtures, 5 rules, 100% precision/recall (corpus expansion in 2.0.9); see docs/BENCHMARKS.md
Corpus marketplace Stub Export/import CLI commands not wired

The scanner is the stable product. The kernel sandbox is beta enforcement-only today; it kills disallowed syscalls but does not yet emit a per-syscall trace (see "What it does NOT do" below).


What it does NOT do (today)

  • Records per-syscall traces from the kernel sandbox (opt-in via --backend=seccomp-trace on picosentry sandbox; requires Linux + libseccomp + CONFIG_SECCOMP_LOG=y). Default --backend=auto continues to use the enforcement-only seccomp-bpf backend. Path/address arguments on events are not yet captured (v2.0.9 plan: PTRACE_SECCOMP or SECCOMP_RET_USER_NOTIF).
  • Does not scan LLM model weights. It guards prompts and outputs in deployed apps, not the model itself.
  • Does not run cluster mode in production. Single-node only; multi-node gossip is untested.
  • Does not have a real Postgres backend. SQLite only.
  • Has published detection-benchmark data in docs/BENCHMARKS.md. The 2.0.8 baseline is 7 fixtures / 5 rules / 100% precision / 100% recall; the corpus is small (see "Honest limitations" in that document for what the numbers do and don't prove).
  • Does not advertise a CVE database on its own. CVE matching uses the OSV corpus ([scan] extra); offline-only operation pulls from the local corpus snapshot.

If a feature is in experimental.py as Stub or Experimental, treat it as not shipped.


30-second demo (no clone)

pip install picosentry
picosentry scan ./your-project          # any project on disk
picosentry scan ./package.json          # or a single manifest

If you prefer a reproducible example, the repo ships a malicious PyPI fixture:

git clone https://github.com/KirkForge/PicoSentry.git
cd PicoSentry
picosentry scan examples/pypi-obfuscated-setup/

Real CLI output

$ picosentry scan examples/pypi-obfuscated-setup/
PICOSENTRY_CACHE_HMAC_KEY not set — cache entries will be invalidated on process restart. Set it for persistent cache integrity.
🦞 PicoSentry
Target: /home/kirk/Madlab/Clean-Live/PicoSeries/picosentry/examples/pypi-obfuscated-setup
Engine: v2.0.5 | Corpus: vef6b3b3115bb
Scan ID: 08057439b4ba08d8

Packages scanned: 0
Files scanned:     2
Duration:          20ms

The scan above fires 5+ findings across the obfuscation, post-install, and exfiltration rules. Re-run with the same inputs and the Scan ID and Corpus digest will match exactly — that's the determinism guarantee.

A complete sample output (with rule IDs and severities) for the same example is checked into the repo. The example is the reproducible fixture we use in CI.


What it detects (a subset)

Rule What it catches Example
L2-TYPO-001 Typosquatted package names reqursts instead of requests
L2-DEPC-001 Dependency confusion (private → public) internal-pkg not on registry
L2-PYPI-OBFS-001 Dynamic execution in setup.py exec() / eval() in install scripts
L2-PYPI-OBFS-002 Base64-decoded payloads in source base64.b64decode(...) + dynamic use
L2-PYPI-OBFS-007 Base64 decode + exec/eval combo Decode-then-execute obfuscation chain
L2-PYPI-POST-001 Post-install code execution setup.py runs code at install time
L2-NETEX-001 Network calls during install urllib.request, curl, wget at install
L2-IOC-001 Known IOC behavior patterns Hardcoded C2 host, exfil URL patterns
L2-CVE-001 Known CVEs in dependency tree OSV-matched vulnerabilities
L2-DEP-001 Deprecated / insecure dependency End-of-life library versions
L2-SBOM-001 SBOM generation CycloneDX-compatible output
L2-LICENSE-001 License compliance Copyleft, unknown, deprecated licenses

Full rule catalog: picosentry/scan/docs/rules/ (50 rules across the supported ecosystems).


Feature matrix

Feature PicoSentry pip-audit osv-scanner Trivy Socket
Offline operation yes partial partial partial no
Deterministic output (bit-identical runs) yes no no no no
Malicious-behavior detection (not just CVEs) yes no no partial partial
Multi-ecosystem (npm, PyPI, Go, Cargo, Maven, RubyGems, NuGet) yes partial yes yes partial
Runtime sandbox enforcement (kernel-level) beta no no no no
Runtime syscall observation from kernel no no no no no
FOSS source available yes (BUSL-1.1) yes (Apache-2.0) yes (Apache-2.0) yes (Apache-2.0) no

Where PicoSentry is weaker: pip-audit and osv-scanner have wider and more frequently refreshed CVE coverage via OSV. Trivy has broader container and IaC scanning. Socket has hosted workflow integrations PicoSentry doesn't ship. The differentiator is the combination of offline + deterministic + malicious-behavior rules in a single offline binary — not raw CVE breadth.


Install

# Core scanner — works offline, no HTTP deps (only `pyyaml` installed)
pip install picosentry

# Extras
pip install picosentry[scan]      # + online corpus management
pip install picosentry[serve]     # + API server + dashboard
pip install picosentry[all]       # Everything

The default pip install picosentry is deliberately lightweight — it pulls in only pyyaml, which is enough to run picosentry scan against any project. To use the API server, dashboard, or HTTP corpus refresh, install the matching extras (see install options below).

Install options

Command What you get
pip install picosentry Core: scanner, sandbox, watch (lightweight)
pip install picosentry[scan] + requests for online corpus management
pip install picosentry[serve] + FastAPI server, dashboard, auth, scheduler
pip install picosentry[watch-server] + FastAPI + uvicorn for watch HTTP daemon
pip install picosentry[otel] + OpenTelemetry tracing
pip install picosentry[sigstore] + Sigstore signing support
pip install picosentry[all] Everything

Usage

picosentry scan ./my-project
picosentry scan ./package.json                  # single file
picosentry scan --format json ./project         # JSON output
picosentry scan --format sarif ./project        # SARIF output
picosentry scan --format cyclonedx ./project    # CycloneDX SBOM
picosentry scan --verify-determinism ./project  # assert SHA-256 stability
picosentry scan --diff scan-a.json scan-b.json  # compare two scans
picosentry scan --fail-on high ./project        # exit non-zero on HIGH+
picosentry sandbox echo "hello"                 # beta — kernel-level enforcement
picosentry watch scan-prompt --text "..."       # beta — LLM prompt guard
picosentry serve --port 8765                    # experimental — API + dashboard
picosentry health

Design principles

  • Deterministic: same inputs + same policy = same SHA-256 output. No randomness, no probabilistic scoring, no network dependence. Asserted by --verify-determinism.
  • Offline by default: no phone-home, no remote API calls at scan time. Works in air-gapped environments. Online corpus refresh is opt-in via the [scan] extra.
  • Typed: full Python type annotations, py.typed shipped.
  • Lightweight core: the default install pulls only pyyaml. Heavy deps are gated behind extras.

Repository structure

picosentry/
    _core/          shared primitives
    scan/           supply-chain scanner (CLI: `picosentry scan`)
    sandbox/        runtime kernel-sandbox (CLI: `picosentry sandbox`, beta)
    watch/          LLM prompt/output guard (CLI: `picosentry watch`, beta)
    serve/          API server + dashboard (CLI: `picosentry serve`, experimental)
    experimental.py feature-maturity tracking
examples/
    pypi-obfuscated-setup/    reproducible malicious PyPI fixture
    npm-postinstall-exfil/    reproducible npm post-install fixture
    prompt-injection/         reproducible prompt-injection fixture
docs/
    rules/          per-rule documentation (see picosentry/scan/docs/rules/)
    strategic/      design docs and architecture
tests/             test suite

Where to get help


License

BUSL-1.1 — see LICENSE and COMMERCIAL-LICENSE.md.

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

picosentry-2.0.9.tar.gz (648.7 kB view details)

Uploaded Source

Built Distribution

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

picosentry-2.0.9-py3-none-any.whl (810.2 kB view details)

Uploaded Python 3

File details

Details for the file picosentry-2.0.9.tar.gz.

File metadata

  • Download URL: picosentry-2.0.9.tar.gz
  • Upload date:
  • Size: 648.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for picosentry-2.0.9.tar.gz
Algorithm Hash digest
SHA256 c8e0ddf99a200a428ec5e502b71f432bf8d4cb55c39b76b5b099af76c5838590
MD5 5be59401856f857a9e27fb0b9e7e85ae
BLAKE2b-256 4a76c303526ec30de619101155ae79d9be62d0980a229d153309915990978587

See more details on using hashes here.

File details

Details for the file picosentry-2.0.9-py3-none-any.whl.

File metadata

  • Download URL: picosentry-2.0.9-py3-none-any.whl
  • Upload date:
  • Size: 810.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for picosentry-2.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1de89cb45fb5a15ce402f526a6d4d10af8e5b7cd91f6fb9a0c3c21a12d97c68e
MD5 a10131836387566bb3380e0a592870b5
BLAKE2b-256 bfc647c849085e32e1cdef0e552c45b7dfa57e8b6c875f6ff8ae3f32ca7dc597

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