Skip to main content

Piton

PyPI version Piton CI Pipeline Release GHCR Sidecar License: MIT

The lockfile & policy compiler for MCP servers and AI coding agents.

Don't wrap your agents in a slow prompt firewall or rip out your existing gateway. Pin MCP tool contracts with split SHA-256 hashes, catch Claude/Cursor hook RCE in CI under 100ms, and compile calibrated CEL, Cedar, and IDE allowlists.

Piton CLI Live Demo — piton scan, piton init, piton lock --diff, and piton replay exporting Cedar

Every AI coding agent (Claude Code, Cursor, Claude Desktop, OpenCode) now pulls unpinned third-party MCP tool descriptions, executes .claude/settings.json shell hooks, and ingests .cursor/rules / skill markdown files straight into privileged developer sessions. One silent upstream description edit (an MCP rug pull) or a malicious PR hook turns your repo into instant RCE.

Piton gives you a 30-second deterministic lockfile and PR gate—and compiles PII-tokenized shadow OTel traces into CEL (Solo.io agentgateway / Envoy), Cedar (AWS Bedrock AgentCore), and Claude Code / Cursor allowlists (with an optional Go Envoy v3 ext_proc reference adapter).


30-Second Quickstart

Slim Python CLI — only 2 runtime dependencies (pydantic + pyyaml):

# Zero-install instant scan (works anywhere with uv):
uvx piton-cli scan --repo .

# Or test it right now against our intentionally poisoned demo repo (catches 8 CRITICAL/HIGH findings in <1s):
git clone https://github.com/gaussian-labs/piton-vuln-demo.git && uvx piton-cli scan --repo piton-vuln-demo

# Or install permanently via pipx / pip (note: install `piton-cli`, not unrelated PyPI package `piton`):
pipx install piton-cli   # or: pip install piton-cli

# 1. Zero-config scan: catches .claude/settings.json hook RCE, .vscode/tasks.json folderOpen autorun,
#    malicious STDIO MCP commands, and hidden-Unicode / prompt-injection poisoning in .cursor/rules & CLAUDE.md
piton scan --repo .

# 2. Pin HTTP/SSE MCP servers with split SHA-256 hashes (add --allow-stdio-exec to also probe trusted local STDIO servers)
#    Runs static supply-chain scan first and quarantines Day-1 poisoned servers/tools before writing piton.yaml + piton.lock
piton init --repo . --probe

# 3. Wrap any local STDIO MCP server in Cursor / Claude Code to block live rug pulls & over-bounds calls
piton wrap --enforce --traces "" --server github -- npx -y @modelcontextprotocol/server-github

Drop Into Any Repo in 5 Lines of GitHub Actions

- name: Piton — AI Agent Supply-Chain & MCP Lockfile Gate
  uses: gaussian-labs/piton@v0.5.1
  with:
    scan-only: "true" # or `probe: "true"` / `manifest: observed_tools.json` for MCP lockfile diffs

Fails pull requests loudly on:

  • Third-party MCP rug pulls (description_sha256 drift on third_party servers)
  • Structural inputSchema drift (structural_sha256 drift on all servers—while internal docstring edits only warn so you never break deploys)
  • Cross-server tool shadowing (duplicate tool names across distinct MCP servers)
  • Day-1 MCP tool poisoning (NFKC homoglyphs, zero-width/bidi Unicode, covert tags, exfil directives)
  • Coding-agent config RCE (.claude/settings.json curl|sh / reverse shell / credential-harvesting hooks, unsafe Bash(*) wildcards, .vscode/tasks.json folderOpen autorun, poisoned .cursor/rules & skill files)

Why Split-Hash Pinning + Shadow Replay?

  1. Split-Hash Lockfiles (structural_sha256 vs description_sha256) — Naive single-hash pinning breaks CI every time an internal team fixes a typo in a docstring. Piton separates machine contract hashes (name + structural inputSchema, always hard-blocked) from prose hashes (description + property descriptions: hard-blocked on third_party MCPs, warning-only on internal MCPs unless poisoning lint triggers).
  2. Shadow-to-Enforce Policy Calibration (piton replay) — The #1 reason teams disable agent security proxies is false blocks and hand-writing policy. Piton records PII-preserving tokenized traces (alice@acme.com → tok_8f1a2b3c@acme.com, keeping domains and numeric ceilings replayable without storing raw PII) OR ingests existing OpenTelemetry (OTel) JSONL spans, replays them offline to compute exact false-block rates, and exports calibrated policies straight to your existing gateway:
# Calibrate bounds offline against shadow traces or OTel spans until false-block rate = 0%
piton replay --config piton.yaml --traces .piton/traces.jsonl --simulate-enforce

# Export calibrated policies directly to agentgateway (CEL) or ToolHive / AWS AgentCore (Cedar)
piton replay --config piton.yaml --traces .piton/traces.jsonl --export cel
piton replay --config piton.yaml --traces .piton/traces.jsonl --export cedar

Try the 60-Second End-to-End Local Demo

Runs live Day-1 poisoning quarantine, zero-secret /gw egress key swapping + chunk-boundary response secret scrubbing, shadow recording, Go↔Python HMAC ledger verification, and replay calibration with zero external API keys:

git clone https://github.com/gaussian-labs/piton.git
cd piton
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
bash examples/quickstart-billing-agent/run_demo.sh

Enterprise Runtime & Gateway Integration

When you move from local coding agents and CI gates into production multi-agent Kubernetes fleets, Piton includes a hardened static Go sidecar (sidecar/, prebuilt multi-arch binaries + distroless GHCR image) and a zero-dependency Control Plane:

  [ Repo / CI ] ──► piton scan + piton init --probe ──► piton.yaml + piton.lock
                                                                │
  [ Envoy / agentgateway / Agent ] ◄──► [ Go Sidecar (Envoy v3 ext_proc gRPC + /mcp + /gw) ]
                                           • RS256/ES256 OIDC JWKS + RFC 8693 OBO (`sub`/`act`)
                                           • Live tools/list Rug-Pull Pin (`BodyMutation` -32001)
                                           • Declarative Response Projection (token & exfil reduction)
                                           • MCP 2026-07-28 MRTR `input_required` + signed approval retry
                                           • Optional Redis/Valkey shared 1h budgets across K8s replicas
                                           • Sliding-window multi-encoding secret scrubber
                                                                │
                                                                ▼
                                        [ Piton Control Plane (`piton control-plane`) ]
                                           • Slack Block Kit & Web UI MRTR Approval Bridge
                                           • Multi-Pod Signed Ledger Collector (Go↔Python HMAC)
                                           • Per-Agent Shadow→Enforce Readiness Scorecards
                                           • Tamper-Evident Signed SOC2 / EU AI Act Audit Export

Kubernetes + Envoy Gateway Deployment (Helm)

helm install piton-sidecar ./deploy/helm/piton-sidecar \
  --set image.repository=ghcr.io/gaussian-labs/piton-sidecar \
  --set secrets.existingSecret=piton-sidecar-keys \
  --set redis.enabled=true \
  --set redis.addr=redis-master.default.svc.cluster.local:6379 \
  --set controlPlane.collectorUrl=http://piton-control-plane:8090 \
  --set envoyGateway.enabled=true \
  --set envoyGateway.targetRef.name=mcp-agents-route

Real Envoy Proxy v1.33 Wire E2E Harness

Every commit is verified in CI against a live envoyproxy/envoy:v1.33-latest container wired to our distroless Go sidecar over HTTP/2 gRPC ext_proc:

cd deploy/envoy-e2e
docker compose up -d --build
python3 verify_envoy_e2e.py
docker compose down -v

Enterprise Control Plane (MRTR Slack/Web Approval Bridge + Fleet Ledger)

# Terminal 1: Start central Governance UI, Fleet Ledger Collector & MRTR Slack/Web Approval Bridge
PITON_LEDGER_SIGNING_KEY="dev-secret-key-32-bytes-minimum" \
  piton control-plane --host 127.0.0.1 --port 8090

# Terminal 2: Run agent with zero real secrets in env, streaming telemetry & escalations to Control Plane
PITON_LEDGER_SIGNING_KEY="dev-secret-key-32-bytes-minimum" \
  piton run --collector-url http://127.0.0.1:8090 -- python my_agent.py

Gateway & IDE Integration Guides


CLI Reference

piton scan --repo . [--format sarif -o piton.sarif]         # Scan Claude/Cursor hooks, tasks, rules & skills
piton init --repo . [--probe] [--manifest tools.json]       # Generate piton.yaml (shadow), piton.lock & .env.agent
piton lock --diff [--probe | --manifest tools.json]         # PR gate: split-hash drift + shadowing + hook RCE (--format sarif)
piton lock --update [--probe | --manifest tools.json]       # Refresh approved lockfile hashes after review
piton wrap --server <name> -- <stdio-mcp-cmd>               # Runtime STDIO pin & bounds for Cursor / Claude Code
piton replay --simulate-enforce [--export cel|cedar]        # Calibrate bounds from ledger or OTel spans
piton export --format cel|cedar|claude-managed-mcp|cursor-allowlist  # Compile piton.yaml + piton.lock for gateways & IDEs
piton run [--collector-url URL] -- <agent-cmd>              # Zero-secret local agent runner (auto-fetches sidecar)
piton top --traces .piton/traces.jsonl [--follow]           # Live PII-tokenized flight recorder
piton ledger-verify --traces .piton/traces.jsonl            # Verify Go↔Python HMAC chain integrity
piton control-plane --host 127.0.0.1 --port 8090            # Fleet ledger collector, MRTR bridge & SOC2 export UI

Running All Tests

# Go sidecar race tests (Envoy v3 gRPC ext_proc, OIDC RS256/ES256, Redis store, Response Projection)
(cd sidecar && go test -race -v ./...)

# Python supply-chain, live MCP probe/wrap, Control Plane E2E & cross-language Go↔Python suites
pytest tests/ -v

Metadata

Release files for piton-cli 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for piton-cli 0.5.2
File Size Uploaded Provenance Actions
piton_cli-0.5.2.tar.gz 102.8 kB With provenance Details for piton_cli-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for piton-cli 0.5.2
File Interpreter ABI Platform Actions
piton_cli-0.5.2-py3-none-any.whl Python 3 none any Details for piton_cli-0.5.2-py3-none-any.whl

Total release size: 180.4 kB

Release files / piton_cli-0.5.2.tar.gz

Download URL piton_cli-0.5.2.tar.gz
Size 102.8 kB
Tags Source
SHA-256 checksum
How to use checksums
53f37c05117b69e28782fb8ac8f1bc59c031e5f4948e60231ecf678f49c8217d
BLAKE2b-256 checksum
How to use checksums
1543636fa2325131c210b1dd534560c38a194c9caabd42aec9ca27262eb35b23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / piton_cli-0.5.2-py3-none-any.whl

Download URL piton_cli-0.5.2-py3-none-any.whl
Size 77.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
015db05bea864a5d8911fa6448c421f24e0a0c1507b4f69e639e38c861cad1c6
BLAKE2b-256 checksum
How to use checksums
f962521d2a3d1d9a2fdf8df1e1c204e81519133d1236c04f5fc853544483e8f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for piton-cli 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for piton_cli-0.5.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page