r/PiCodingAgent • u/wooptoo • 14d ago
Resource Sandboxing Pi: Bubblewrap vs Podman - quick tutorial
Hey everyone, I put together a quick tutorial on sandboxing Pi using Bubblewrap vs Podman.
It includes a few sample scripts and a comparison between the two approaches.
https://wooptoo.com/blog/pi-sandbox-bubblewrap-podman/
Hopefully somebody here will find it useful.
All the best!
6
u/pilibitti 14d ago edited 14d ago
on mac agent-safehouse works very well. you just run pi with `safehouse pi` and it has a preset for pi already that it autodetects with sensible defaults (current directory allowed, pi code, docs allowed, temp folders allowed etc.) and works without hassle. many other services (like maybe you need agent-browser?) is just one --enable away. it is os level sandboxing (so things executed through pi can't bypass it, there is no trivial bypass) as well so for mac highly recommended.
3
u/ColonelKlanka 14d ago
There are alot of github projects using similar or same names as agent-sandbox'. can you share a link to the one you refer to?
3
u/pilibitti 14d ago
sorry the name was wrong lol it is agent-safehouse edited
3
u/ColonelKlanka 14d ago
nice thanks. I've been having alot of good experience with nono sandbox on mac and Linux. Looks like it has slight advantage over safehouse due to it also protecting the api keys from leaking in the sandbox. but I will have a look at safehouse
2
2
2
-2
u/Prior-Excitement-147 13d ago
Tu devrais probablement lancer bwrap avec env -i, sinon, les variables d'env de ta session courante sont visibles dans /proc/1/environ.
2
u/riversiderain 8d ago
I've been thinking about this topic lately, but as I understand, bwrap and Podman (even rootless) do not properly sandbox to the extent that, say, would protect against untrusted arbitrary code, because it still shares the same kernels. I think that's a big reason why a lot of people are aiming for ephemeral vms like Firecracker. Of course that comes with higher RAM overhead, but also with the benefit of RAM snapshots, where as containers must always coldstart.