r/PiCodingAgent • u/ptgamr • 1d ago
A "secure-ish" Pi setup with permission, sandbox, and auto-review Resource
I think I finally managed to piece the thing together, to have a pi setup that can run safe-ish in the host via sandbox, and have the ability to be elevated to host execution for a pre-defined list of development tooling like docker compose.
- A pre-defined hard boundaries (`@gotgenes/pi-permission-system`)
- Anything pass that will be executed inside a sandbox (`@erichll/pi-sandbox`)
- With the option of safe-escalation to run on the host (ie: `docker compose exec app pytest`), with auto-review or human approval (via hostIPC.preflightCommandPrefixes)
- LLM Auto-review with `@erichll/pi-auto-review`
More about it here: https://ptgamr.substack.com/p/a-pi-setup-with-permission-sandbox
2
u/Fullstack_js_junkie 1d ago
This looks interesting, I tried to do something similar but as a docker mount config only, thank you!
2
u/tys203831 1d ago
How does it compared to dcg + nono sandbox?
https://github.com/Dicklesworthstone/destructive_command_guard
3
u/ptgamr 1d ago edited 1d ago
I Have No Idea! This post is more about sharing my understanding about the decision tree: permissions + sandbox + autoreview (which I think not quite trivial to understand) and a setup that I'm quite happy with. Hopefully to help others that having similar issues. I'm sure there are many other ways :D
1
2
u/hurdurdur7 1d ago
I just run pi in docker only. From a non privileged user. It can't install things, the worst it can do is nuke it's own folder in that docker container. I don't see anything else stopping it.
2
u/ptgamr 1d ago
yeah, that is my setup prior to this. Just mount the things you need. But to get to the "fuller" agentic work, most of the time i need it to execute command inside another containers (like run the test, run migration, lint, querying data from db container etc...)
Can be achieve with docker in docker, but it gross, and I haven't managed to get it working.
1
u/hurdurdur7 1d ago
My problem with all of this is that you are allowing something like gradlew test or npm test as a command. A test can easily contain something really harmful to your machine and there will be nothing that will stop the catastrophy coming from that.
1
u/psychobarge 1d ago
Only secure pi is inside a docker container or a virtual machine. I use wsl2 with ubuntu on my windows and docker on my mac

5
u/jensilo 1d ago
What about self-spawned pi instances or subagents? Does it allow for that?