Skip to main content

PicoSentry โ€” deterministic supply-chain scanner for npm/pnpm, safe for ML pipelines

Project description

PicoSentry Banner

PicoSentry ๐Ÿฆž

Deterministic, offline supply-chain scanner for npm/pnpm.

CI PyPI Python Tests Rules Deterministic License: BUSL-1.1 Buy Me A Coffee

PicoSentry is the first product in the Pico security series โ€” a set of deterministic security tools for software supply chains. Companion tools: PicoDome (runtime sandbox), PicoWatch (LLM defense), PicoShogun (command centre).

Same inputs + same corpus version = same findings and scan fingerprint. Every time.

No HTTP at scan time. No probabilistic heuristics. No narrative in findings.

Deterministic output: Default JSON includes audit timestamps and timing data. For byte-identical CI artifacts, use --deterministic-output or --verify-determinism.

Quick Start

pip install picosentry

# Scan a project
picosentry scan ./my-project

# CI gate (exit 1 on HIGH+CRITICAL)
picosentry check ./my-project --fail-on high

# Deterministic JSON
picosentry scan ./my-project --format json --deterministic-output

# Verify byte-identical determinism
picosentry scan ./my-project --verify-determinism

# Monorepo scan
picosentry workspace .

# CycloneDX SBOM
picosentry scan ./my-project --format cyclonedx

What It Detects

21 deterministic rules across 6 attack categories:

Category Rules Severity
Post-install scripts L2-POST-001 HIGHโ€“CRITICAL
Obfuscation L2-OBFS-001..004 HIGH
Dependency confusion L2-DEPC-001 HIGH
Typosquatting L2-TYPO-001 MEDIUMโ€“HIGH
Manifest anomalies L2-MANI-001/002 MEDIUM
Fork drift L2-FORK-001 MEDIUM
Credential exposure L2-CRED-001 HIGHโ€“CRITICAL
Lockfile drift L2-LOCK-001 MEDIUM
Bundled shadow code L2-BUND-001 HIGH
Provenance L2-PROV-001 MEDIUM
Maintainer changes L2-MAINT-001 MEDIUM
pnpm config L2-PNPM-001 MEDIUM
License violations L2-LICENSE-001 MEDIUM
Engine constraints L2-ENGIN-001 LOW
Protocol sideloading L2-SIDELOAD-001 HIGH
Advisory lookup L2-ADV-001 MEDIUMโ€“CRITICAL

See SCAAT.md for the full attack-vector-to-rule mapping.

Deterministic Guard Stack

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Layer 4: CI Gate                       โ”‚
โ”‚  --verify-determinism (CLI)             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Layer 3: Diff                          โ”‚
โ”‚  picosentry diff a.json b.json          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Layer 2: Guard (runtime)               โ”‚
โ”‚  Validates invariants after each scan   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Layer 1: Models (structural)           โ”‚
โ”‚  Frozen dataclasses, sorted keys        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

CLI Reference

picosentry scan <target> [OPTIONS]     Scan a project directory
picosentry check <target> [OPTIONS]    CI health check (exit-code only)
picosentry workspace <root> [OPTIONS]  Scan monorepo
picosentry corpus export/import/list    Manage IoC corpus packs
picosentry ioc register/list/remove    Manage custom IoCs
picosentry rules [--json]              List detector rules
picosentry version                     Version, corpus, rule count
picosentry diff <a.json> <b.json>      Compare scans for determinism
picosentry init [target] [--force]     Generate .picosentry.yml
picosentry update [--top N]            Download latest npm corpus

Scan Options:
  --format, -f        json, sarif, table, ml-context, github, cyclonedx
  --output, -o        Write output to file
  --rules, -r         Run only specific rules
  --corpus, -c        Path to corpus directory
  --exit-code         Exit 1 if findings found
  --fail-on           Exit 1 only at or above severity
  --quiet, -q         Summary only
  --baseline, -b      Path to baseline JSON or ignore file
  --verbose, -v       Per-rule timing and scan details
  --timeout           Scan timeout in seconds (0 = no timeout)
  --deterministic-output  Omit timestamps for byte-identical output
  --verify-determinism   Run twice, verify SHA-256 match

Daemon Mode

PicoSentry can run as an HTTP daemon for CI integration and team use:

# Token auth
PICOSENTRY_AUTH_TOKEN=your-token picosentry daemon --port 9090

# OIDC/JWT auth
PICOSENTRY_AUTH_MODE=oidc picosentry daemon --port 9090

# Enterprise mode (fail-closed defaults)
PICOSENTRY_ENTERPRISE_MODE=1 picosentry daemon --port 9090

See docs/DAEMON.md for full daemon configuration, RBAC, and TLS.

Architecture

picosentry/
โ”œโ”€โ”€ cli.py               # CLI entry point
โ”œโ”€โ”€ engine.py            # ScanEngine orchestrator
โ”œโ”€โ”€ models.py            # Finding, ScanResult (frozen dataclasses)
โ”œโ”€โ”€ guards.py            # Deterministic guard stack
โ”œโ”€โ”€ config.py            # .picosentry.yml loader
โ”œโ”€โ”€ daemon.py            # HTTP daemon (health, scan, metrics)
โ”œโ”€โ”€ auth.py              # Token + OIDC/JWT auth, RBAC scopes
โ”œโ”€โ”€ enterprise.py        # Fail-closed enterprise mode enforcement
โ”œโ”€โ”€ rules/               # 21 detector rules (pure functions)
โ”œโ”€โ”€ formatters/          # 6 output formats
โ””โ”€โ”€ corpus/              # Built-in IoC database

Status

See STATE.md for honest project status โ€” what's production-ready, what's scaffolded, what's not built.

Documentation

Pico Security Series

Tool Purpose
PicoSentry ๐Ÿฆž Deterministic offline supply-chain scanner
PicoDome ๐Ÿ›ก๏ธ Runtime sandbox + behavioral analysis
PicoWatch ๐Ÿ‘๏ธ LLM prompt/output defense + telemetry
PicoShogun Command centre (enterprise) / panel (personal)

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-1.0.0.tar.gz (360.4 kB view details)

Uploaded Source

Built Distribution

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

picosentry-1.0.0-py3-none-any.whl (247.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for picosentry-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3d7fd22c4e70c67f54e372e3e2e463fca117e0d79fd88b021a91519bb35e5f8a
MD5 47f1993bd902b2e8cce64df9b3eb31e8
BLAKE2b-256 10ef2165c167faaed06c8af7a9dfbab418549ed8f755ea193571f9345e866d9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: picosentry-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 247.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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b846ac78370c29753588bdacc45e87855561f3df767aebb7a43949da5b0cb24e
MD5 9a1d8ca04d97776b9dca88ec3de2f4d0
BLAKE2b-256 8040d81d81e4b5896f7776dcc2d138ed1679c9a8a37f9983616699d9506a5f90

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