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

License

Business Source License 1.1 (BUSL-1.1) โ€” source-available; production use allowed except for competitive offerings. Commercial use that competes with KirkForge's paid products requires a separate commercial license. After 3 years, converts to Apache-2.0. See LICENSE, LICENSE-SUMMARY.md, and COMMERCIAL-LICENSE.md.

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.1.tar.gz (360.6 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.1-py3-none-any.whl (247.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: picosentry-1.0.1.tar.gz
  • Upload date:
  • Size: 360.6 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.1.tar.gz
Algorithm Hash digest
SHA256 e45af460c65fc6d95e5d90a67a5e5bd54a6fb9c77da853340ed009cd61c00f45
MD5 8c6bf32a940b37729561b482b6464a19
BLAKE2b-256 6a14806cb5c85486ebfc65d92ebf6fe8405a02ace56f23cc377a9aaf27215897

See more details on using hashes here.

File details

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

File metadata

  • Download URL: picosentry-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 247.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3145d9dbf374d5d8dc4a78020fce9859a0d2e4762e29ed52cea3316c865e4062
MD5 1d96f0748680f72a686ee915e9ada81d
BLAKE2b-256 7937cc9f8af84c09525f124e568500dc728ad76d12c8e1b23e0612961034767f

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