DevMortimer/pi-warden
200 stars · Last commit 2026-11-27
Zero-key runtime guardrails for Pi, Claude Code, and Codex — blocks destructive commands and secret exfiltration, enforces project rules, and breaks agent loops.
README preview
# pi-warden [](https://www.npmjs.com/package/pi-warden) [](https://www.npmjs.com/package/pi-warden) [](https://github.com/DevMortimer/pi-warden/stargazers) [](LICENSE) [](https://github.com/earendil-works/pi) [](https://typesafe.ai) **Zero API keys required. $0 out of the box.** pi-warden stands between a coding agent and your machine. Install it with one command and ~90% of its protection runs locally in deterministic code — stopping destructive commands, blocking secret exfiltration after untrusted web reads, catching mechanical project-rule violations in `<1 ms`, reclaiming stale screenshots and logs without breaking prompt caches, and catching edit-revert and thrash loops before they burn your session. Want semantic judgment on top? Run `/warden enable` to add [Jev](https://typesafe.ai) as optional semantic toppings (`~1` request per coding turn thanks to 95%-frugal gating): it judges subtle prose rules, unverified "done" claims, non-pattern irreversible actions, and smoothly declassifies routine developer pushes when the taint firewall would otherwise fail closed offline. It runs inside [Pi](https://github.com/earendil-works/pi), and as hooks in Claude Code and Codex. > **Local [Warden-S1](https://ryanjoshuagapac.com/writing/warden-s1), strictly opt-in:** set `"typesafeBackend": "warden-s1"` (or `"auto"`) and run `/warden model download`, and the semantic checks run **on this machine at `$0`**: no key, no consent screen, nothing leaves `127.0.0.1`. One shared daemon serves every Pi session and pages idle ones to RAM and disk; each session's transcript is warmed behind the turn, so a judged call encodes only what is new. A probe that lands within `0.08` of `0.50` abstains (`insufficient evidence in transcript`) instead of holding, and a hold cites the turn it points at (`Locus: Turn #63 (tiny_fetch, …)`). The default stays `"cloud"`: nothing is downloaded and nothing changes until you ask. Open Apache-2.0 weights: [`Warden-S1-752M-MLX-4bit`](https://huggingface.co/DevMortimer/Warden-S1-752M-MLX-4bit) `415.5 MiB` · [`Warden-S1-752M-ONNX-Int4`](https://huggingface.co/DevMortimer/Warden-S1-752M-ONNX-Int4) `461.3 MiB` · [`Warden-S1-752M`](https://huggingface.co/DevMortimer/Warden-S1-752M); benchmarks in [`eval/reports/2026-11-23-warden-s1-live-eval`](eval/reports/2026-11-23-warden-s1-live-eval/README.md). See [Local Warden-S1](docs/guards.md#local-warden-s1). https://github.com/user-attachments/assets/1cb3991b-d36e-4a71-b26f-86327f4d302b ## Install in 10 seconds (no API key needed)