piton-cli 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- piton_cli-0.4.2/LICENSE +21 -0
- piton_cli-0.4.2/PKG-INFO +192 -0
- piton_cli-0.4.2/README.md +172 -0
- piton_cli-0.4.2/piton/__init__.py +5 -0
- piton_cli-0.4.2/piton/cli.py +716 -0
- piton_cli-0.4.2/piton/control_plane/__init__.py +11 -0
- piton_cli-0.4.2/piton/control_plane/server.py +402 -0
- piton_cli-0.4.2/piton/control_plane/store.py +500 -0
- piton_cli-0.4.2/piton/iac/__init__.py +36 -0
- piton_cli-0.4.2/piton/iac/agent_config_lint.py +436 -0
- piton_cli-0.4.2/piton/iac/lockfile.py +420 -0
- piton_cli-0.4.2/piton/iac/mcp_probe.py +582 -0
- piton_cli-0.4.2/piton/iac/poisoning_lint.py +197 -0
- piton_cli-0.4.2/piton/iac/replay.py +896 -0
- piton_cli-0.4.2/piton/iac/scanner.py +350 -0
- piton_cli-0.4.2/piton/iac/schema.py +256 -0
- piton_cli-0.4.2/piton_cli.egg-info/PKG-INFO +192 -0
- piton_cli-0.4.2/piton_cli.egg-info/SOURCES.txt +28 -0
- piton_cli-0.4.2/piton_cli.egg-info/dependency_links.txt +1 -0
- piton_cli-0.4.2/piton_cli.egg-info/entry_points.txt +3 -0
- piton_cli-0.4.2/piton_cli.egg-info/requires.txt +6 -0
- piton_cli-0.4.2/piton_cli.egg-info/top_level.txt +1 -0
- piton_cli-0.4.2/pyproject.toml +37 -0
- piton_cli-0.4.2/setup.cfg +4 -0
- piton_cli-0.4.2/tests/test_agent_control_loop_v3.py +393 -0
- piton_cli-0.4.2/tests/test_control_plane_and_projection.py +367 -0
- piton_cli-0.4.2/tests/test_launch_hardening_v041.py +260 -0
- piton_cli-0.4.2/tests/test_piton_agent_supply_chain.py +151 -0
- piton_cli-0.4.2/tests/test_sidecar_integration.py +247 -0
- piton_cli-0.4.2/tests/test_sprint_abc_hardening_and_probe.py +540 -0
piton_cli-0.4.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bright Onwe (Tony-Stark2025)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
piton_cli-0.4.2/PKG-INFO
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: piton-cli
|
|
3
|
+
Version: 0.4.2
|
|
4
|
+
Summary: Piton — Lockfile and static supply-chain scanner for MCP servers, Claude Code hooks, and Cursor rules
|
|
5
|
+
Author: Bright Onwe
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Tony-Stark2025/piton
|
|
8
|
+
Project-URL: Repository, https://github.com/Tony-Stark2025/piton
|
|
9
|
+
Project-URL: Issues, https://github.com/Tony-Stark2025/piton/issues
|
|
10
|
+
Keywords: piton,mcp,ai-agents,claude-code,cursor,security,envoy,ext-proc,supply-chain,ci-cd
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: pydantic>=2.6.0
|
|
15
|
+
Requires-Dist: pyyaml>=6.0.1
|
|
16
|
+
Provides-Extra: dev
|
|
17
|
+
Requires-Dist: pytest>=8.1.0; extra == "dev"
|
|
18
|
+
Requires-Dist: pytest-asyncio>=0.23.5; extra == "dev"
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
# Piton
|
|
22
|
+
|
|
23
|
+
**Lockfile and static supply-chain scanner for MCP servers, Claude Code hooks, and Cursor rules.**
|
|
24
|
+
|
|
25
|
+
> Don't wrap your agents in a probabilistic prompt firewall. Hammer deterministic split-hash pins into every MCP tool, Claude/Cursor hook, and schema.
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
**Piton** gives you a 30-second deterministic lockfile and PR gate—and scales all the way to shadow-to-enforce policy replay (`CEL`/`Cedar` export) and a production Go Envoy v3 `ext_proc` sidecar.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 30-Second Quickstart
|
|
36
|
+
|
|
37
|
+
Slim Python CLI — **only 2 runtime dependencies (`pydantic` + `pyyaml`)**:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Zero-install instant scan (works anywhere with uv):
|
|
41
|
+
uvx piton-cli scan --repo .
|
|
42
|
+
|
|
43
|
+
# Or install permanently via pipx / pip:
|
|
44
|
+
pipx install piton-cli # or: pip install piton-cli
|
|
45
|
+
|
|
46
|
+
# 1. Zero-config scan: catches .claude/settings.json hook RCE, .vscode/tasks.json folderOpen autorun,
|
|
47
|
+
# malicious STDIO MCP commands, and hidden-Unicode / prompt-injection poisoning in .cursor/rules & CLAUDE.md
|
|
48
|
+
piton scan --repo .
|
|
49
|
+
|
|
50
|
+
# 2. Pin every MCP server with split SHA-256 hashes (probing live HTTP/SSE & STDIO servers)
|
|
51
|
+
# Quarantines Day-1 poisoned tools before writing piton.yaml + piton.lock
|
|
52
|
+
piton init --repo . --probe
|
|
53
|
+
|
|
54
|
+
# 3. Wrap any local STDIO MCP server in Cursor / Claude Code to block live rug pulls & over-bounds calls
|
|
55
|
+
piton wrap --enforce --server github -- npx -y @modelcontextprotocol/server-github
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Drop Into Any Repo in 5 Lines of GitHub Actions
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
- name: Piton — AI Agent Supply-Chain & MCP Lockfile Gate
|
|
62
|
+
uses: Tony-Stark2025/piton@v0.4.2
|
|
63
|
+
with:
|
|
64
|
+
scan-only: "true" # or `probe: "true"` / `manifest: observed_tools.json` for MCP lockfile diffs
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Fails pull requests loudly on:
|
|
68
|
+
- **Third-party MCP rug pulls** (`description_sha256` drift on `third_party` servers)
|
|
69
|
+
- **Structural `inputSchema` drift** (`structural_sha256` drift on **all** servers—while `internal` docstring edits only warn so you never break deploys)
|
|
70
|
+
- **Cross-server tool shadowing** (duplicate tool names across distinct MCP servers)
|
|
71
|
+
- **Day-1 MCP tool poisoning** (NFKC homoglyphs, zero-width/bidi Unicode, covert tags, exfil directives)
|
|
72
|
+
- **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)
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Why Split-Hash Pinning + Shadow Replay?
|
|
77
|
+
|
|
78
|
+
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).
|
|
79
|
+
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:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Calibrate bounds offline against shadow traces or OTel spans until false-block rate = 0%
|
|
83
|
+
piton replay --config piton.yaml --traces .piton/traces.jsonl --simulate-enforce
|
|
84
|
+
|
|
85
|
+
# Export calibrated policies directly to agentgateway (CEL) or ToolHive / AWS AgentCore (Cedar)
|
|
86
|
+
piton replay --config piton.yaml --traces .piton/traces.jsonl --export cel
|
|
87
|
+
piton replay --config piton.yaml --traces .piton/traces.jsonl --export cedar
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Try the 60-Second End-to-End Local Demo
|
|
93
|
+
|
|
94
|
+
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:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
git clone https://github.com/Tony-Stark2025/piton.git
|
|
98
|
+
cd piton
|
|
99
|
+
python3 -m venv .venv && source .venv/bin/activate
|
|
100
|
+
pip install -e ".[dev]"
|
|
101
|
+
bash examples/quickstart-billing-agent/run_demo.sh
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Enterprise Runtime & Gateway Integration
|
|
107
|
+
|
|
108
|
+
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**:
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
[ Repo / CI ] ──► piton scan + piton init --probe ──► piton.yaml + piton.lock
|
|
112
|
+
│
|
|
113
|
+
[ Envoy / agentgateway / Agent ] ◄──► [ Go Sidecar (Envoy v3 ext_proc gRPC + /mcp + /gw) ]
|
|
114
|
+
• RS256/ES256 OIDC JWKS + RFC 8693 OBO (`sub`/`act`)
|
|
115
|
+
• Live tools/list Rug-Pull Pin (`BodyMutation` -32001)
|
|
116
|
+
• Declarative Response Projection (token & exfil reduction)
|
|
117
|
+
• MCP 2026-07-28 MRTR `input_required` + signed approval retry
|
|
118
|
+
• Optional Redis/Valkey shared 1h budgets across K8s replicas
|
|
119
|
+
• Sliding-window multi-encoding secret scrubber
|
|
120
|
+
│
|
|
121
|
+
▼
|
|
122
|
+
[ Piton Control Plane (`piton control-plane`) ]
|
|
123
|
+
• Slack Block Kit & Web UI MRTR Approval Bridge
|
|
124
|
+
• Multi-Pod Signed Ledger Collector (Go↔Python HMAC)
|
|
125
|
+
• Per-Agent Shadow→Enforce Readiness Scorecards
|
|
126
|
+
• Tamper-Evident Signed SOC2 / EU AI Act Audit Export
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Kubernetes + Envoy Gateway Deployment (Helm)
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
helm install piton-sidecar ./deploy/helm/piton-sidecar \
|
|
133
|
+
--set image.repository=ghcr.io/tony-stark2025/piton-sidecar \
|
|
134
|
+
--set secrets.existingSecret=piton-sidecar-keys \
|
|
135
|
+
--set redis.enabled=true \
|
|
136
|
+
--set redis.addr=redis-master.default.svc.cluster.local:6379 \
|
|
137
|
+
--set controlPlane.collectorUrl=http://piton-control-plane:8090 \
|
|
138
|
+
--set envoyGateway.enabled=true \
|
|
139
|
+
--set envoyGateway.targetRef.name=mcp-agents-route
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Real Envoy Proxy v1.33 Wire E2E Harness
|
|
143
|
+
|
|
144
|
+
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`:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
cd deploy/envoy-e2e
|
|
148
|
+
docker compose up -d --build
|
|
149
|
+
python3 verify_envoy_e2e.py
|
|
150
|
+
docker compose down -v
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Enterprise Control Plane (MRTR Slack/Web Approval Bridge + Fleet Ledger)
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Terminal 1: Start central Governance UI, Fleet Ledger Collector & MRTR Slack/Web Approval Bridge
|
|
157
|
+
PITON_LEDGER_SIGNING_KEY="dev-secret-key-32-bytes-minimum" \
|
|
158
|
+
piton control-plane --host 127.0.0.1 --port 8090
|
|
159
|
+
|
|
160
|
+
# Terminal 2: Run agent with zero real secrets in env, streaming telemetry & escalations to Control Plane
|
|
161
|
+
PITON_LEDGER_SIGNING_KEY="dev-secret-key-32-bytes-minimum" \
|
|
162
|
+
piton run --collector-url http://127.0.0.1:8090 -- python my_agent.py
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## CLI Reference
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
piton scan --repo . # Scan Claude/Cursor hooks, tasks, rules & skills
|
|
171
|
+
piton init --repo . [--probe] [--manifest tools.json] # Generate piton.yaml (shadow), piton.lock & .env.agent
|
|
172
|
+
piton lock --diff [--probe | --manifest tools.json] # PR gate: split-hash drift + shadowing + hook RCE
|
|
173
|
+
piton lock --update [--probe | --manifest tools.json] # Refresh approved lockfile hashes after review
|
|
174
|
+
piton wrap --server <name> -- <stdio-mcp-cmd> # Runtime STDIO pin & bounds for Cursor / Claude Code
|
|
175
|
+
piton replay --simulate-enforce [--export cel|cedar] # Calibrate bounds from ledger or OTel spans
|
|
176
|
+
piton run [--collector-url URL] -- <agent-cmd> # Zero-secret local agent runner (auto-fetches sidecar)
|
|
177
|
+
piton top --traces .piton/traces.jsonl [--follow] # Live PII-tokenized flight recorder
|
|
178
|
+
piton ledger-verify --traces .piton/traces.jsonl # Verify Go↔Python HMAC chain integrity
|
|
179
|
+
piton control-plane --host 127.0.0.1 --port 8090 # Fleet ledger collector, MRTR bridge & SOC2 export UI
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Running All Tests
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Go sidecar race tests (Envoy v3 gRPC ext_proc, OIDC RS256/ES256, Redis store, Response Projection)
|
|
188
|
+
(cd sidecar && go test -race -v ./...)
|
|
189
|
+
|
|
190
|
+
# Python supply-chain, live MCP probe/wrap, Control Plane E2E & cross-language Go↔Python suites
|
|
191
|
+
pytest tests/ -v
|
|
192
|
+
```
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Piton
|
|
2
|
+
|
|
3
|
+
**Lockfile and static supply-chain scanner for MCP servers, Claude Code hooks, and Cursor rules.**
|
|
4
|
+
|
|
5
|
+
> Don't wrap your agents in a probabilistic prompt firewall. Hammer deterministic split-hash pins into every MCP tool, Claude/Cursor hook, and schema.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
**Piton** gives you a 30-second deterministic lockfile and PR gate—and scales all the way to shadow-to-enforce policy replay (`CEL`/`Cedar` export) and a production Go Envoy v3 `ext_proc` sidecar.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 30-Second Quickstart
|
|
16
|
+
|
|
17
|
+
Slim Python CLI — **only 2 runtime dependencies (`pydantic` + `pyyaml`)**:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Zero-install instant scan (works anywhere with uv):
|
|
21
|
+
uvx piton-cli scan --repo .
|
|
22
|
+
|
|
23
|
+
# Or install permanently via pipx / pip:
|
|
24
|
+
pipx install piton-cli # or: pip install piton-cli
|
|
25
|
+
|
|
26
|
+
# 1. Zero-config scan: catches .claude/settings.json hook RCE, .vscode/tasks.json folderOpen autorun,
|
|
27
|
+
# malicious STDIO MCP commands, and hidden-Unicode / prompt-injection poisoning in .cursor/rules & CLAUDE.md
|
|
28
|
+
piton scan --repo .
|
|
29
|
+
|
|
30
|
+
# 2. Pin every MCP server with split SHA-256 hashes (probing live HTTP/SSE & STDIO servers)
|
|
31
|
+
# Quarantines Day-1 poisoned tools before writing piton.yaml + piton.lock
|
|
32
|
+
piton init --repo . --probe
|
|
33
|
+
|
|
34
|
+
# 3. Wrap any local STDIO MCP server in Cursor / Claude Code to block live rug pulls & over-bounds calls
|
|
35
|
+
piton wrap --enforce --server github -- npx -y @modelcontextprotocol/server-github
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Drop Into Any Repo in 5 Lines of GitHub Actions
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
- name: Piton — AI Agent Supply-Chain & MCP Lockfile Gate
|
|
42
|
+
uses: Tony-Stark2025/piton@v0.4.2
|
|
43
|
+
with:
|
|
44
|
+
scan-only: "true" # or `probe: "true"` / `manifest: observed_tools.json` for MCP lockfile diffs
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Fails pull requests loudly on:
|
|
48
|
+
- **Third-party MCP rug pulls** (`description_sha256` drift on `third_party` servers)
|
|
49
|
+
- **Structural `inputSchema` drift** (`structural_sha256` drift on **all** servers—while `internal` docstring edits only warn so you never break deploys)
|
|
50
|
+
- **Cross-server tool shadowing** (duplicate tool names across distinct MCP servers)
|
|
51
|
+
- **Day-1 MCP tool poisoning** (NFKC homoglyphs, zero-width/bidi Unicode, covert tags, exfil directives)
|
|
52
|
+
- **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)
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Why Split-Hash Pinning + Shadow Replay?
|
|
57
|
+
|
|
58
|
+
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).
|
|
59
|
+
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:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Calibrate bounds offline against shadow traces or OTel spans until false-block rate = 0%
|
|
63
|
+
piton replay --config piton.yaml --traces .piton/traces.jsonl --simulate-enforce
|
|
64
|
+
|
|
65
|
+
# Export calibrated policies directly to agentgateway (CEL) or ToolHive / AWS AgentCore (Cedar)
|
|
66
|
+
piton replay --config piton.yaml --traces .piton/traces.jsonl --export cel
|
|
67
|
+
piton replay --config piton.yaml --traces .piton/traces.jsonl --export cedar
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Try the 60-Second End-to-End Local Demo
|
|
73
|
+
|
|
74
|
+
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:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
git clone https://github.com/Tony-Stark2025/piton.git
|
|
78
|
+
cd piton
|
|
79
|
+
python3 -m venv .venv && source .venv/bin/activate
|
|
80
|
+
pip install -e ".[dev]"
|
|
81
|
+
bash examples/quickstart-billing-agent/run_demo.sh
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Enterprise Runtime & Gateway Integration
|
|
87
|
+
|
|
88
|
+
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**:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
[ Repo / CI ] ──► piton scan + piton init --probe ──► piton.yaml + piton.lock
|
|
92
|
+
│
|
|
93
|
+
[ Envoy / agentgateway / Agent ] ◄──► [ Go Sidecar (Envoy v3 ext_proc gRPC + /mcp + /gw) ]
|
|
94
|
+
• RS256/ES256 OIDC JWKS + RFC 8693 OBO (`sub`/`act`)
|
|
95
|
+
• Live tools/list Rug-Pull Pin (`BodyMutation` -32001)
|
|
96
|
+
• Declarative Response Projection (token & exfil reduction)
|
|
97
|
+
• MCP 2026-07-28 MRTR `input_required` + signed approval retry
|
|
98
|
+
• Optional Redis/Valkey shared 1h budgets across K8s replicas
|
|
99
|
+
• Sliding-window multi-encoding secret scrubber
|
|
100
|
+
│
|
|
101
|
+
▼
|
|
102
|
+
[ Piton Control Plane (`piton control-plane`) ]
|
|
103
|
+
• Slack Block Kit & Web UI MRTR Approval Bridge
|
|
104
|
+
• Multi-Pod Signed Ledger Collector (Go↔Python HMAC)
|
|
105
|
+
• Per-Agent Shadow→Enforce Readiness Scorecards
|
|
106
|
+
• Tamper-Evident Signed SOC2 / EU AI Act Audit Export
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Kubernetes + Envoy Gateway Deployment (Helm)
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
helm install piton-sidecar ./deploy/helm/piton-sidecar \
|
|
113
|
+
--set image.repository=ghcr.io/tony-stark2025/piton-sidecar \
|
|
114
|
+
--set secrets.existingSecret=piton-sidecar-keys \
|
|
115
|
+
--set redis.enabled=true \
|
|
116
|
+
--set redis.addr=redis-master.default.svc.cluster.local:6379 \
|
|
117
|
+
--set controlPlane.collectorUrl=http://piton-control-plane:8090 \
|
|
118
|
+
--set envoyGateway.enabled=true \
|
|
119
|
+
--set envoyGateway.targetRef.name=mcp-agents-route
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Real Envoy Proxy v1.33 Wire E2E Harness
|
|
123
|
+
|
|
124
|
+
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`:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
cd deploy/envoy-e2e
|
|
128
|
+
docker compose up -d --build
|
|
129
|
+
python3 verify_envoy_e2e.py
|
|
130
|
+
docker compose down -v
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Enterprise Control Plane (MRTR Slack/Web Approval Bridge + Fleet Ledger)
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Terminal 1: Start central Governance UI, Fleet Ledger Collector & MRTR Slack/Web Approval Bridge
|
|
137
|
+
PITON_LEDGER_SIGNING_KEY="dev-secret-key-32-bytes-minimum" \
|
|
138
|
+
piton control-plane --host 127.0.0.1 --port 8090
|
|
139
|
+
|
|
140
|
+
# Terminal 2: Run agent with zero real secrets in env, streaming telemetry & escalations to Control Plane
|
|
141
|
+
PITON_LEDGER_SIGNING_KEY="dev-secret-key-32-bytes-minimum" \
|
|
142
|
+
piton run --collector-url http://127.0.0.1:8090 -- python my_agent.py
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## CLI Reference
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
piton scan --repo . # Scan Claude/Cursor hooks, tasks, rules & skills
|
|
151
|
+
piton init --repo . [--probe] [--manifest tools.json] # Generate piton.yaml (shadow), piton.lock & .env.agent
|
|
152
|
+
piton lock --diff [--probe | --manifest tools.json] # PR gate: split-hash drift + shadowing + hook RCE
|
|
153
|
+
piton lock --update [--probe | --manifest tools.json] # Refresh approved lockfile hashes after review
|
|
154
|
+
piton wrap --server <name> -- <stdio-mcp-cmd> # Runtime STDIO pin & bounds for Cursor / Claude Code
|
|
155
|
+
piton replay --simulate-enforce [--export cel|cedar] # Calibrate bounds from ledger or OTel spans
|
|
156
|
+
piton run [--collector-url URL] -- <agent-cmd> # Zero-secret local agent runner (auto-fetches sidecar)
|
|
157
|
+
piton top --traces .piton/traces.jsonl [--follow] # Live PII-tokenized flight recorder
|
|
158
|
+
piton ledger-verify --traces .piton/traces.jsonl # Verify Go↔Python HMAC chain integrity
|
|
159
|
+
piton control-plane --host 127.0.0.1 --port 8090 # Fleet ledger collector, MRTR bridge & SOC2 export UI
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Running All Tests
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Go sidecar race tests (Envoy v3 gRPC ext_proc, OIDC RS256/ES256, Redis store, Response Projection)
|
|
168
|
+
(cd sidecar && go test -race -v ./...)
|
|
169
|
+
|
|
170
|
+
# Python supply-chain, live MCP probe/wrap, Control Plane E2E & cross-language Go↔Python suites
|
|
171
|
+
pytest tests/ -v
|
|
172
|
+
```
|