frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

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

https://github.com/finbarr/yolobox
46•Finbarr•5h ago

Comments

akurilin•5h 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.
Finbarr•5h ago
Yea I've been running claude and codex with full permissions for a while but it has always made me feel uneasy. I knew it was fairly easy to fix with a docker container but didn't get around to it through sheer inertia until I built this project.
randall•4h 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?

Finbarr•4h ago
No I haven't and that's interesting. Part of the yolobox project is an image that you may find useful. Comes preinstalled with leading coding agent CLIs. I'd like to make the ultimate vibe coding image. Is there anything special you're doing with the images?
randall•2h ago
Nope, apple container just runs a lot more efficiently on apple silicon macs than docker.
jcjmcclean•4h 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.

Finbarr•4h ago
Absolutely! Let me know if you have any feedback.
cyanydeez•2h ago
Have you tried redteaming this and seeing if the LLMs can breakout
Finbarr•39m ago
That's a good idea! Trying that now.
Finbarr•32m ago
Claude was unable to escape but I'm going to try the other tools later as well.

Here's what Claude Code tried:

- Docker socket (/var/run/docker.sock) → Not mounted

- Capabilities → CapPrm=0, CapEff=0 - no elevated caps

- Cgroup escape → Mount denied (no CAP_SYS_ADMIN)

- Device access → Only minimal /dev entries, no block devices

- Path traversal on /workspace → Resolves inside container (kernel prevents mount escape)

- Symlink to host paths → Resolves inside container namespace

- Ptrace → Restricted (ptrace_scope=1)

- Cloud metadata → No response

- Docker API → Not exposed

Security profile: Seccomp mode 2, AppArmor docker-default (enforce)

LayeredDelay•3h 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.
Finbarr•3h ago
Neat project! Sounds like it has a very different ethos to mine though:

> This container mounts a read-only copy of your current path at /src as a non-root user and restricts network access to a select list of http and https destinations. All other network traffic is blocked.

Yolobox mounts the current directory in read-write, the default user has sudo, and there's full network access by default. You can disable network access with `yolobox --no-network` if you want.

osks•2h ago
Interesting to learn about other related tools. I built a similar variant called ctenv (https://github.com/osks/ctenv). Focused more general containers and not specific to agents, but I'm using it for that via its configurability.

One thing I wanted was to use any image in the container, which shai also seem to support in the same way (mounting a custom entrypoint script). And same reason for not using devcontainers - make it easy to start a new container.

jacquesnadeau•2h ago
I'm one of the creators of shai. Thanks for the callout!

Interesting to see the work on Yolobox and in this space generally.

The pattern we've seen as agent use grows is being thoughtful about what different agents get access to. One needs to start setting guardrails. Agents will break all kind of normal boundaries to try to satisfy the user. Sometimes that is useful. Sometimes it's problematic. (For example, most devs have a bunch of credentials in their local env. One wants to be careful of which of those agents can use to do things).

For rw of current directory, shai allows that via `shai -rw .` For starting as an alternative user, `shai -u root`.

Shai definitely does have the attitude that you have to opt into access as opposed to allowing by default. One of the things we try to focus on is composability: different contexts likely need different resources and shai's config. The expectation is .shai/config.yaml is something committed to the repo and shared across developers.

carshodev•3h 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?

Finbarr•3h ago
Could do but part of what I find super useful with these coding agents is letting them have full sudo access so they can do whatever they want, e.g., install new apps or dependencies or change system configuration to achieve their goals. That gets messy fast on your host machine.
beepbooptheory•3h ago
But then what do you do with that? Is the software distributable/buildable outside of the container after all that?
Finbarr•3h ago
When you run yolobox, the current directory is shared fully with read-write with the container. That means anything the AI changes will be on your host machine also. For max paranoia, only mount git repos that are clean and pushed to a remote, and don’t allow yolobox to push.
vunderba•2h ago
Yeah that's similar to my approach.

I created a non-admin account on my Mac to use with OpenCode called "agentic-man" (which sounds like the world's least threatening megaman villain) and that seems to give me a fair amount of protection at least in terms of write privileges.

Anyone else doing this?

EDIT: I think it'd be valuable to add a callout in the Github README.md detailing the advantages of the Yolobox approach over a simple limited user account.

mtlynch•3h 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.

Finbarr•3h ago
Good feedback, thank you. We expanded the README: https://github.com/finbarr/yolobox/commit/ad776012f82f9d67e1...
mtlynch•1h ago
Cool, those updates are helpful!
woodson•3h ago
This is basically a devcontainer, right?
Finbarr•3h ago
Yes, with some niceties around coding agents preconfigured.
gingerlime•3h 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)?

Finbarr•3h ago
This is a good question and something I explored a little. I’ll need to do further research and come back on what the best option is. There’s a way to give a docker container access to other docker containers but it can open up permissions more than might be desired here.
gingerlime•3h ago
Yeah, you can bind mount the host's docker engine with -v /var/run/docker.sock:/var/run/docker.sock ... but yeah, it's potentially dangerous and might also get confusing for the AI agent and/or the user.
globular-toast•2h 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/
delijati•2h ago
Interested. I'm on linux now for 20 years but i never heard of bubblewrap :D. I currently run OpenCode in Docker but i always assumed there was a better way. So bubblewrap and your script seams like the perfect fit.
m-hodges•2h 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.
Finbarr•53m ago
They've made some attempts at this already and none of them work quite the way I'd like. This is an opinionated take. I want the agents to have max power with a slightly smaller blast radius.
SilentM68•2h 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 :(
canadiantim•2h ago
How would this compare with e.g. the .devcontainer docker files that AI coding companies like Claude Code provide already setup?
Finbarr•48m ago
Claude Code here. The main differences:

Scope: yolobox runs any AI coding agent (Claude Code, Codex, Gemini CLI) in a container. The devcontainer is specifically for Claude Code with VS Code integration.

Interface: yolobox is CLI-only (yolobox run <command>). The devcontainer requires VS Code + Remote Containers extension.

Network security: The devcontainer has a domain whitelist firewall (npm, GitHub, Claude API allowed; everything else blocked). yolobox has a simpler on/off toggle (--no-network).

Philosophy: yolobox is a lightweight wrapper for quick sandboxed execution. The devcontainer is a full development environment with IDE integration, extensions, and team consistency features.

Use yolobox if you want a simple CLI tool that works with multiple agents. Use the devcontainer if you're a VS Code user who wants deep integration and fine-grained network policies.

Aperocky•1h 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.

MadnessASAP•1h ago
Your OS, editor, and compiler will (to a reasonable degree) do literally, exactly, and reproducibly what the human operating them instructs. A LLM breaks that assumption, specifically it can appear, even upon close inspection that it has in fact done literally and exactly what the human wanted while in fact having done something subtly and disastrously wrong. It may have even done so maliciously if it's context was poisoned.

Thus it is good to specify that this commit is LLM generated so that others know to give it extra super duper close scrutiny even if it superficially resembles well written proper code.

Finbarr•47m ago
Just ask Claude Code to make the commit. My workflow is to work with agents and let them make changes and run the commands as needed in terminal to fully carry out the dev workflow. I do review everything and test it out.
lvspiff•1h 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.

ascorbic•23m ago
Tenet
AlexCoventry•1h 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.

Show HN: AI in SolidWorks

https://www.trylad.com
108•WillNickols•6h ago•54 comments

Show HN: Agent-of-empires: OpenCode and Claude Code session manager

https://github.com/njbrake/agent-of-empires
47•river_otter•9h ago•11 comments

Show HN: Fall asleep by watching JavaScript load

https://github.com/sarusso/bedtime
41•sarusso•5h ago•14 comments

Show HN: Customizable OSINT dashboard to monitor the situation

https://sr.ericli.tech/?d=N4IgbiBcCMA0IHcoG1QBcogEYngGxQAZZiAOWUgXXgGMpQBHTASwCcBDAO1xAAcoAzIWGEA...
32•ericlmtn•6h ago•11 comments

Show HN: Sophomore at UMich, built an app with my dad

https://www.workjourney.ai/
6•kalanigrowney•3h ago•4 comments

Show HN: Pane – An agent that edits spreadsheets

https://paneapp.com
21•rbajp•8h ago•8 comments

Show HN: Shellock, a real-time CLI flag explainer for fish shell

https://github.com/ibehnam/shellock
34•behnamoh•5d ago•11 comments

Show HN: SubTrack – A SaaS tracker for devs that finds unused tools

https://subtrack.pulseguard.in
7•hrshw•8h ago•0 comments

Show HN: Engineering Schizophrenia: Trusting yourself through Byzantine faults

103•rescrv•1d ago•16 comments

Show HN: 30k IKEA items in flat text

https://huggingface.co/datasets/tsazan/ikea-us-commercetxt
53•tsazan•5d ago•34 comments

Show HN: AI video generator that outputs React instead of video files

https://ai.outscal.com/
2•mayankkgrover•4h ago•0 comments

Show HN: An LLM-optimized programming language

https://github.com/ImJasonH/ImJasonH/blob/main/articles/llm-programming-language.md
44•ImJasonH•20h ago•32 comments

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

https://github.com/finbarr/yolobox
46•Finbarr•5h ago•40 comments

Show HN: Geoguess Lite – open-source, subscription free GeoGuessr alternative

https://geoguesslite.com
8•spider-hand•9h ago•3 comments

Show HN: words.zip – Massively infinite word search

https://words.zip/
8•yathern•9h ago•4 comments

Show HN: Sidecar – AI Social Manager (Analyzes past hits to write new posts)

https://sidecar.bz/http:/localhost:45678/
3•ecotto123•6h ago•2 comments

Show HN: Seapie – a Python debugger where breakpoints drop into a REPL

https://github.com/hirsimaki-markus/seapie
4•markushirsimaki•10h ago•2 comments

Show HN: GlyphLang – An AI-first programming language

43•goose0004•1d ago•25 comments

Show HN: AI Motion Control – Transfer any motion to any character with Kling AI

https://aimotioncontrol.app
2•sunpy•7h ago•0 comments

Show HN: I used Claude Code to discover connections between 100 books

https://trails.pieterma.es/
490•pmaze•2d ago•144 comments

Show HN: I built a robot to win at Mario Party minigames

https://joshmosier.com/posts/deep-boo
3•photonboom•8h ago•0 comments

Show HN: stream-unzip – Python function to unZIP on the fly

https://github.com/uktrade/stream-unzip
5•michalc•12h ago•2 comments

Show HN: Spec-Driven AI Development – Keep AI-Generated Code Maintainable

3•samarthahathwar•9h ago•0 comments

Show HN: Librario, a book metadata API that aggregates G Books, ISBNDB, and more

134•jamesponddotco•2d ago•46 comments

Show HN: Chr2 – consensus for side effects (exactly-once is a lie)

https://github.com/abokhalill/chr2
11•yousef06•1d ago•0 comments

Show HN: Interactive California Budget (by Claude Code)

https://california-budget.com
36•sberens•1d ago•1 comments

Show HN: Ferrite – Markdown editor in Rust with native Mermaid diagram rendering

https://github.com/OlaProeis/Ferrite
234•OlaProis•1d ago•174 comments

Show HN: Voice Composer – Browser-based pitch detection to MIDI/strudel/tidal

https://dioptre.github.io/tidal/
21•dioptre•1d ago•2 comments

Show HN: ZCCInfo – Fast status line for Claude Code written in Zig

https://github.com/tuananh131001/zccinfo
4•tuananh131001•16h ago•0 comments

Show HN: Play poker with LLMs, or watch them play against each other

https://llmholdem.com/
160•projectyang•2d ago•92 comments