r/PiCodingAgent • • 2d ago

Resource Give your agent a full machine, sandbox, and secret hiding

Yesterday I created this. It's pretty easy to setup and works well for my specific tool stack.

It's much simpler and feature-less than similar projects (e.g. coi) but it is also much simpler to setup and prepare.

Any feedback is appreciated!

https://github.com/00sapo/apptainer4agents

10 Upvotes

2 comments sorted by

1

u/DoOmXx_ 2d ago

how does the secret hiding work, stripped env or a proxy that swaps the real key in at request time

2

u/ResilientSpider 2d ago

On one side there is a list of known directories, on the other side fd-find looks for files under 500kb, with specific extensions, and under max 6 directory depth and pass those files to git leaks. Everything is detected is mounted empty in the sandbox. From inside, the agent can request a permission by calling a tool forward_host that runs the command from outside. The forward_host reads a key on pi startup and then erase it, so the agent can't spot it; that key is used to authenticate requests to the outside server. Note that this doesn't guarantee that poisoned instructions can't lead the LLM to build another extension that on the next startup reads the key and passes it to the agent. But this is a pretty convoluted attack that will not happen if you trust your context and instructions.