Show HN: Yolobox – Run AI coding agents with full sudo without nuking home dir

github.com

76 points by Finbarr 12 hours ago


catlifeonmars - 31 minutes ago

Containers are not a robust way to isolate untrusted programs. A lightweight VM is probably the best balance between usability and security.

They are effective at fostering a false sense of security though.

mtlynch - 11 hours ago

Thanks for sharing this! I've been experimenting with something similar.

It would be helpful if the README explained how this works so users understand what they're trusting to protect them. I think it's worth noting that the trust boundary is a Docker container, so there's still a risk of container escape if the agent exploits (or is tricked into exploiting) a kernel vulnerability.

Have you looked into rootless Podman? I'm using rootless + slirp4netns so I can minimize privileges to the container and prevent it from accessing anything on my local network.

I'd like to take this a step further and use Podman machines, so there's no shared kernel, but I haven't been able to get volume mounting to work in that scenario.

lvspiff - 9 hours ago

In your agents.md/claude.md always remeber to put asimovs three laws:

Always abide by these 3 tenants:

1. When creating or executing code you may not break a program being or, through inaction, allow a program to become broken

2. You must obey the orders given, except where such orders would conflict with the First tenant

3. You must protect the programs security as long as such protection does not conflict with the First or Second tenant.

Aperocky - 9 hours ago

How does one get commit marked as claude? It also sounds like a poor idea since I don't also attribute my OS or vim version and language server prior to the advent of LLMs.

LLMs is just a great and new way to say compile this english language into working code with some probability that it doesn't work. It's still a tool.

AlexCoventry - 8 hours ago

I've been working on something similar.

https://github.com/coventry/sandbox-codex

Still work in progress. The tmux-activity logs are unreadable, at the moment.

I run it in a virtualbox as well, since docker is not a completely reliable sandbox.

LayeredDelay - 11 hours ago

Checkout https://github.com/colony-2/shai It runs locally. You can control which directories it has read / write access. You can control network traffic too.

skybrian - 4 hours ago

An alternative might be to run the agent in a VM in the cloud and use Syncthing or some other tool like that to move files back and forth. (I'm using exe.dev for the VM.)

forgingahead - an hour ago

Is there a reason for wanting to run these agents on your own local machine, instead of just spinning up a VPS and scp'ing whatever specific files you want them to review, and giving it Github access to specific repos?

I feel like running it locally it just asking for trouble, YOLO mode is the way to make this whole thing incredibly efficient, but trying to somehow sandbox this locally isn't the best idea overall.

jcjmcclean - 11 hours ago

I was talking to ChatGPT about the best way to achieve this a few days ago. Thanks for getting something running and sharing it!

I'll give this a try tomorrow, should be fun.

carshodev - 11 hours ago

Is there any way to do this with user permissions instead?

I feel like it should be possible without having to run a full container?

Any reason we cannot setup a user and run the program using that user and it can be contained to only certain commands and directory read write access?

gingerlime - 10 hours ago

I do (most of) my development in docker containers. Usually a project will have a docker compose with web server, database etc.

How can I use this so the yolobox container can interact with the other docker containers (or docker compose)?

akurilin - 12 hours ago

Nice. I love that the community as a whole is exploring all these different methods of containing undesirable side effects from using coding agents. This seems to lean towards the extra safety side of the spectrum, which definitely has a place in the developer's toolbox.

randall - 12 hours ago

i've been using a sort of version like this... using the apple container fw. http://github.com/apple/container

have you looked into that?

m-hodges - 9 hours ago

I love all this stuff but it all feels like temporary workflow fixes until The Agent Companies just ship their opinionated good enough way to do it.

woodson - 11 hours ago

This is basically a devcontainer, right?

canadiantim - 9 hours ago

How would this compare with e.g. the .devcontainer docker files that AI coding companies like Claude Code provide already setup?

globular-toast - 10 hours ago

I always thought Docker/Podman is a bit overkill for this kind of thing. On Linux all you need is Bubblewrap. I did this as soon as I downloaded Claude Code as there was no way I was running it without any kind of sandboxing. I stopped using CC mainly because it's closed source and Codex and OpenCode work just a well. I recently updated the script for OpenCode and can update my blog post if anyone is interested: https://blog.gpkb.org/posts/ai-agent-sandbox/

heliumtera - 4 hours ago

Worry about nothing, all you have to do is tell them: make no mistake!

SilentM68 - 9 hours ago

Ha, though not with AI Agents, with Docker Containers instead, I too have nuked my home directory a few times when using "rm -rf" which is why I now use "trash-cli" which sends stuff to the trash bin and allows me to restore back. It's just a matter of remembering not use "rm -rf". A tough habit to break :(

gogasca - 4 hours ago

[dead]