Live data from Hacker News

Docker Sandboxes – Disposable, isolated sandboxes for AI agents

docker.com

281–290 of 419 posts

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#281

What is the main benefit over doing something like: docker run --runtime krun --rm -it -v $(pwd):/workspace/$(basename $(pwd)) -w /workspace/$(basename $(pwd)) --network restricted-net ghcr.io/openai/codex-universal:latest sh That runs the codex OCI in a qemu microvm. From what I can see, more fine grained network and filesystem access control as well as convenience?

Aside from hiding agent credentials from the agent, it also runs an isolated Docker Engine for the agent to use freely.

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#283

Since everyone is sharing their setup, here’s my approach, just to give people an idea of how others are doing it, however impractical it might look: I run a full Linux VM (with a GUI) on my Linux host. I connect via virt-viewer to run Claude Desktop, as I’m not a fan of using the terminal for this. The VM sits on its own libvirt network in a dedicated firewall zone, and specific directories are shared via filesystem…

Do you find the permanence of a full VM useful? I’ve wondered about something like this but always defaulted to Docker for much the same reasons people use stuff like Ansible. I’m afraid the LLM will heavily customize its environment and I’ll be unable to replicate it when my laptop dies or I can’t upgrade the OS or whatever. Then again, I guess GUI is a pain in Docker. I tend to operate through Zed and an ACP harnes…

The VM is allocated 2 cores and 4GB of RAM. For my workload, it doesn't feel any slower than running it directly on the host. The few times I've checked memory usage, it wasn't anywhere near full as far as I remember.

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#284

Models start going to extreme, damaging lengths to achieve ambiguous prompts[0]. Having good sandboxes is now a must IMO. But sbx is a bit annoying to use with OpenCode for instance (which has zero sandboxing by default, unlike codex CLI or Claude Code). You cannot easily change ~/.config/opencode/opencode.jsonc AFAIK. [0]: Black Hat OpenAI-Hugging Face incident: https://www.youtube.com/watch?v=87DyyMV0kCY&t=1021s

What's your problem with the OpenCode config?

My startup (https://github.com/gofixpoint/amika) copies agent configs into local or cloud sandboxes

We run OpenCode currently, but need to improve the setup for users, so would like understand more of the issues you have sandboxing it, if you can share

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#285
I recently wrote a blog post on using Tart for Macs for something similar that docker is doing here but with better persistence and control. My take is that the Tart approach is superior to this as it gives you a full dev machine with a single command line that allows agents to access files on host, install packages, maintain the vm and do whatever they want to do without compromising the host OS.

https://www.mrafayaleem.com/blog/sandboxing-claude-cli-with-...

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#286

I know some people want to run their agents when their computer is off, but I imagine a solution like this will be much more common than paying for a remote sandbox (i.e on fly.io or exe.dev), especially because it'll be free. Though, they need to remove the login requirement.

Agreed! I think the best user experience is:

    1. You can run sandboxes locally
    2. You can control them securely over the internet, for when you're on the go
    3. You can migrate them to cloud VMs if you want
If I can toot my own horn, I'm trying to build that :)

Still early and the local sandboxes are experimental right now

https://github.com/gofixpoint/amika

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#287

Does anyone have a solution for iOS development? I was all in on sandboxes and safehouse for my agents but the moment I got into iOS development it felt like my hand was forced to just run Claude / codex / pi directly on my machine because nothing else could do the dev loop. It’s been a painful reality for me, I’m going against core pieces of how I feel I should be interacting with agent harnesses and yet, I need to…

Hey, I work at Docker and my team works on mcp integration with sbx. A solution I've been trying is this:

1) Enable the xcode mcp server: https://developer.apple.com/documentation/xcode/giving-exter... 2) Add the xcode mcp server to sbx: `sbx mcp add xcode --command xcrun --args mcpbridge` 3) When you create the sandbox, use `--static-mcp xcode`. For example: `sbx create --static-mcp xcode claude .`

Make sure you have at least v0.38.0 of sbx. This makes a bridge from inside the sandbox to the xcode tools on your host, so be aware that it can run whatever tools you give it on the host. But the agent itself is still sandboxed.

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#288
post #186

Earlier quoted context omitted.

I use Linux Containers managed by Incus for working with Claude. I have a dedicated container for that. It can run its own Docker daemon and other system services if needed. Apart from the Claude login token, it has no SSH keys or other credentials. I push everything I need to it from the local machine. And I pull the Claude generated outputs from it. Of course, this kind of setup requires a stack which can run or at…

Love Incus and I'm using throwaway restricted projects for testing. Highly recommend incus-windows if you need to do any Windows testing. Having agents validate Windows behavior has reduced so much toil for me.

Here's my incus thing meant for a VPS/server:

https://GitHub.com/jgbrwn/vibebin

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#289
post #58

The login is annoying but, lacking an open source alternative, this has been my daily driver for a while now because it works great out of the box with two key features: outbound firewall and secret injection with placeholders. I run it with superset and then each git worktree is mounted in a sandbox that is configured for each repo i work in. Closest open source I have seen is https://earendil-works.github.io/gondol…

We run https://github.com/NVIDIA/OpenShell on our workloads and we like it because it is backed by NVIDIA and fits natively within our k8s env.

It also provides a nice TUI for network policy management and prebuilt sandboxes which have claude code, codex, etc.

Post reply on HN