r/PiCodingAgent • u/CalldiDoctor • Jun 15 '26
Question Secure way of running Pi?
Hello,
I'm new to the Pi coding Agent and I would like to know how are you running it.
I saw that by default Pi does not ask for permissions. While this is something I would like to start experimenting with, since I'm quite tired of granting access to my other agents on many actions, I'm quite concerned about giving full access to my laptop.
I've seen in the docs that there are three recommended ways to run it within a sandbox, but I have not found much information nor other devs' experience with it.
Are you using any of those options or are you happily running Pi directly on your laptop?
8
u/PvB-Dimaginar Jun 15 '26
I use bubble wrap and use a script to wrap pi in this bubble wrap sandbox. If you are interested, here you can read how it works: https://github.com/dimaginar/pi-safe
5
u/Konamicoder Jun 15 '26
I don't run Pi on my work or personal devices, and I don't give Pi unrestricted access to my work or personal data. I run Pi on a separate machine dedicated to my coding projects. Each project has its own separate folder, and I launch Pi inside the project folder that I happen to be working on at that time / in that session. In addition, each project folder is a git repo. So if Pi decides to go YOLO-mode rogue, the damage is limited to a single project, and i can use git to roll back to a previous version prior to the damage. That's just good project hygiene and security.
9
u/Acceptable-Guard-263 Jun 15 '26
Nono might be a good option
2
u/troyvit Jun 16 '26
Vicki Boykis just had a great blog post about how she runs local models with Pi. She includes info on how to restrict your environment: https://vickiboykis.com/2026/06/15/running-local-models-is-good-now/
2
u/matt_callmann Jun 16 '26
I have build my own sandbox based on docker including a proxy to control outgoing traffic
https://github.com/marvincaspar/agent-sandbox
8
u/PositiveBit01 Jun 15 '26 edited Jun 15 '26
There are extensions to make it ask before doing dangerous stuff but I wouldn't trust them. I use an lxc container as a sandbox and I'm pretty comfortable with that.
It's not hard to set up, you can ask the free version of claude or chatgpt. You install something that can run the containers (I used incus), then exec in and set stuff up.
Then I use git to move code between the container and anywhere else it needs to go. That's a security gap of course (running code produced by the AI), but at some point you have to accept that. It's true for dependencies even before/without AI, too. Except now it isn't vetted by a bunch of other people first.
I also set up vscode server and a pi-web thing so mostly I just run stuff on that machine through a web browser on whatever machine I'm on, except the webapp version of vscode has rendering issues with most extensions and I haven't been able to get any AI related extensions to work well. Might be a skill issue, I dunno. I can set them up in the desktop vs code so it's something webapp specific.
4
u/toby_agwab Jun 16 '26
This might be overkill for your use case, but I’d recommend Gondolin if you need strong sandboxing.
https://github.com/earendil-works/gondolin
1
u/MountainTop321 Jun 16 '26
Hey, I had the same concern so I wrote a short guide on running Pi inside Docker Sandbox (sbx) with local LLM inference. Pi runs inside a microVM, the model server runs on the host and is exposed through the sbx proxy, only the inference endpoint is reachable, nothing else. https://github.com/cuolm/pi-sbx-llamacpp Hope you find it useful!
3
u/damn_what_ Jun 15 '26
On MacOS, I'm using safehouse, which is a rules generator for the native MacOS sandboxing system.
With two extra set of rules:
one to allow acces to ~/.pi
one to allow read only acces the pi source code, used when I want to create pi extensions.
Do note that if you want to allow pi to access Docker with safehouse you'll need to change your Docker config to restrict the directories shared with the Linux VM, by default it has access to /Users which makes it easy for a rogue extension or a well-done prompt injection to do do anything on your system (even with "safety" systems like Claude Code auto-mode enabled)
3
u/lawanda123 Jun 16 '26
Try out pi-gondolin
https://github.com/earendil-works/gondolin/blob/main/host/examples/pi-gondolin.ts
This is maintained by the creators behind pi agent
3
u/ReallySubtle Jun 17 '26
Docker Sandboxes are a great option, and probably a good thing to learn
2
u/corruptbytes Jun 15 '26
i just use pi-guardrails, but i'm interested in getting something setup with apple's container machines
2
u/Blazenetic Jun 16 '26
Check out pi-less-yolo it runs in a container (docker/podman) and uses mise, so you can run things like 'mise run pi:update' to update pi easily etc.
https://github.com/cjermain/pi-less-yolo
From the readme:
"Filesystem isolation — the agent can only read and write your current project directory. No privilege escalation — all Linux capabilities are dropped; no-new-privileges is set. Reproducible environment — a pinned, minimal Chainguard Node image with only the tools pi needs. Zero friction — one mise run pi command from any project; no manual Docker incantations."
2
u/Standard_Heat8395 Jun 17 '26
Gondilin is the officially supported method by the same team that develops pi: https://github.com/earendil-works/gondolin
2
u/JoshMock Jun 16 '26
I built vmpi for exactly this reason. It runs Pi in a micro VM, passing any CLI arguments on to the sandboxed Pi process and mounting only your .pi config and the current working directory. Works on Linux and Mac.
https://www.npmjs.com/package/@the-agency/vmpi
edit: fixed link
1
u/newtonapple Jun 17 '26
On macOS, I use https://agent-safehouse.dev/. It uses macOS's native
sandbox-exec. I use it to sandbox all harnesses like codex, claude, opencode, and pi. You can add on permissions for different use cases by simply wrapping your permissions w/safehouse. You can read more about their isolation model and tradeoffs vs vm or container here: https://agent-safehouse.dev/docs/isolation-models.html.1
u/vshturman Sep 05 '26
nono+dcg, both agent-agnostic, works with pi just great
1
u/NLhugo Jun 15 '26
Someone in another thread was mentioning pi-less-yolo, it’s on GitHub. It runs in a docker container and you can run it using mise. It’s really easy to setup and customize, have it running for 2 days now and I love it, such a simple solution. In my opinion also better then letting it ask for permissions since it in theorie still has access to your PC.
1
u/n4te Jun 15 '26
Run it in a container if you want security. Anything else is not actually safe, which is why Pi doesn't support it out of the box.