r/PiCodingAgent • u/intpl • 8h ago
Resource One-time podman containers for Pi
Hey guys becaues Pi documentation advises to use containers for Pi usage I created a simple bash script as a center command for my workflow and figured out I'd share here - https://github.com/intpl/sandpi It basically mounts current directory in a disposable container (will destroy after exiting the Pi process), also binds the Pi config directory as read-write, also binds user ~/.agents directory read-only. I use Linux on desktop and servers so this workflow is great for me - I just run around my filesystem running `sandpi` everywhere. Maybe somebody wants to reuse or share a better solution. I created a simple blogpost and recorded a video of me talking as an explanation of why and how - https://gladecki.pl/technical/sandpi/
It happened to me many times before than the agent was doing weird stuff with my system (with OpenCode and omp too) and that's why i created this.
A friend of mine suggested I should have used Nvidia OpenShell but that's an absolute overkill imo.
Btw are there any humans on Reddit anymore?
2
u/suprjami 6h ago edited 5h ago
I do something extremely similar.
I map the non-root user in the container to my current UID so permissions on new workspace files are sensible:
I set
.gitread only if it exists:I agree OpenShell and many others are too complex for their own good. The only thing I want is a permission prompt on all network access, so I can verify every web fetch or package install or exfiltration from programming language compiler/interpreter, and otherwise the agent can run in permission-free yolo mode because there's nothing it can actually ruin.
Basically I want OpenSnitch as a Pi prompt. I don't know how to achieve this.
Edit: Hmm, maybe I could run opensnitchd inside the container, and have Pi write a TypeScript plugin which registers to that daemon and acts as the OpenSnitch user prompt with the usual Pi permission UI...
3
u/architized89 8h ago
I tried docker sbx but that needs a docker login from time to time. Because I’m running almost local only that annoyed me. I settled on microsandbox. That has worked well for me so far.
2
u/fell_ware_1990 7h ago
May i suggest:
Seccomp
--cap-drop=all
no-new-privileges
Landlock
You can add them all easily to the container if you like.
RO on .git and .jj hooks can be done.
What i did for this, only a RW on the jj workspace. Which my system handles and before merge we lint it :)
1
u/SlanderMans 7h ago
Am human, can I recommend that you try out smolvm?
I am the maintainer and is designed for lightweight sandboxing: https://github.com/smol-machines/smolvm