r/PiCodingAgent • u/Mrwrldwide27 • 1h ago
Plugin Pi Veto: Auto Mode (Safe + Autonomous) for Pi so it stops running everything unchecked
Pi runs every tool call without asking, which is great right up until an agent decides to git reset --hard, poke around ~/.ssh, or sneak something weird into a script it just wrote. On the other hand, approving every command by hand makes you stop reading and just mash Enter.
I forked Deepu K Sasidharan's pi-automode-classifier and kept building on it until it turned into Pi Veto: https://github.com/killianmiles27/pi-veto
The main idea is two guarded modes plus YOLO (Alt+M cycles them):
- Safe mode lets normal project work run (
npm test,cargo check, local edits, reads) and only pops a prompt when something stays unclear. - Autonomous mode never prompts at all. Anything the guard won't clear gets blocked, logged to
/veto blocked, and handed back to the agent so it keeps working and tells you at the end. If you say "yeah go ahead and run that" in chat, the next attempt gets re-checked with your words.
Out of the box it uses deterministic Bash/PowerShell rules plus your session's own model, so you don't have to set up anything extra. If you want it faster and smarter, you can wire up a local CPU classifier (LANCET, ~7-15 ms) and/or a context decider (Jev 1.14 on OpenRouter, or a local loopback llama.cpp /v1/systemone server).
Two parts that actually made it hold up in practice:
- It statically reads scripts, imports, and test-runner targets (
npm test,build.rs, etc.) before running them, and scans dangerous writes when they're written. - The context model only sees your messages, the command, and the measured effects. It never sees tool output or file contents, so a prompt injection sitting in a repo file can't talk it into approving anything.
Quick note on limits: this is a tool-call guard, not a sandbox. It doesn't isolate processes, doesn't touch ! commands you type yourself, and won't catch malicious code that was already committed to a repo before you opened it. For untrusted repos, still use a container.
Install (Node 22.18+, Git for Windows if you're on Windows):
We ran two red-team rounds against it (round 1 got 110/142 through, round 2 still got 43/100 before fixes, 0/223 after), so I'm under no illusion that it's airtight. If you try it and find a command that either nags on normal work or slips past when it shouldn't, drop it here and I'll add it as a test case. (or in github)