Top
Best
New

Posted by etoxin 7 hours ago

Docker Sandboxes – Disposable, isolated sandboxes for AI agents(www.docker.com)
325 points | 188 commentspage 5
fergie 5 hours ago|
I use it (sbx), but I don't 100% trust that it actually works, and I would prefer something open source where the limits of the sandboxing could be tested and explored.

Maybe we should just ssh into separate development machines to ensure real and verifiable sandboxing? (as was totally standard before Docker became a thing)

LeBit 3 hours ago|
You should research bubblewrap and nono.
cv_h 5 hours ago||
I wrote a CLI tool that uses QEMU's microvm machine type under the hood. It can take any docker image and build a microvm.

I use it regularly to run Claude/Codex with permission checks disabled.

https://github.com/cvhariharan/mvm

alentred 7 hours ago||
I am not sure I understand, how is this different from a devcontainer or other similar techniques?

On another topic, can't help but notice that "leading coding agents" somehow does not include Pi.

alexfortin 5 hours ago||
About the missing native support for Pi, I opened this issue long ago in case you want to add some pressure: https://github.com/docker/sbx-releases/issues/34

To work around that limitation I came up with this https://github.com/shaftoe/sbx-template-pi

So essentially you can get latest Pi/Node pulling from that image:

`sbx run -t ghcr.io/shaftoe/sbx-template-pi:latest shell`

Like others here I'm also saddened by the login requirement but at the moment this is the best UX I could find for running sandboxed agents, the "kit/mixin" concepts are neat and I make use of them too: https://github.com/shaftoe/sbx-template-pi#stacking-the-extr...

zmmmmm 7 hours ago||
it's running a full VM so the agent can eg: run docker commands safely etc
pjmlp 5 hours ago||
I hardly see how this matters, when Apple and Microsoft already have their own in box solutions for the same problem.

Better sandboxing for AI agents is exactly the main reason for containers improvements on macOS and Windows, with a few talks at WWDC, and BUILD.

Not sure how much they would get from Linux users then.

outof 7 hours ago||
Like many people, I suspect, I used Claude to write my own agent sandbox that suits my needs very well. Investing my time in a propietary product has become a hard sell.
matheusmoreira 6 hours ago||
I did the same thing. It was my first "vibecoded" project. I've been using it every day and it's great. I'm writing a custom Rust network stack for it right now. Gonna replace the current nftables firewall with it.

As for Docker Sandboxes, I'll just ask Sol literally right now to see what it does better than my virtdev, and then I'll improve virtdev instead of using Docker.

zingar 7 hours ago|||
Were you following any patterns/standards/advice on what you needed to protect against? Anything you can point the rest of us to?
matheusmoreira 6 hours ago|||
> Were you following any patterns/standards/advice on what you needed to protect against?

Just the general knowledge that sharing a kernel with untrusted software is too dangerous, that hardware virtualization is an infinitely smaller attack surface and that the entire industry will be in deep shit if people or AI breaks hypervisors.

Initial threat model was supply chain attacks but eventually grew to include AI harnesses as well. Not very worried about them hacking me, more about accident prevention.

So that means each VM must be running a completely independent kernel that's fully isolated from the host's file system. They must also have fail closed network filtering built in.

> Anything you can point the rest of us to?

I have published my virtdev's design document.

https://github.com/matheusmoreira/virtdev/blob/master/DESIGN...

Yes, it is AI generated.

In summary, it's a QEMU VM orchestrator with a base OS image and project specific delta images. VM lifecycle is managed by systemd. System level isolation is already pretty good and it already solves the "AI wiped out my $HOME" problem. I'm currently working on a custom network stack to replace the nftables based firewall.

embedding-shape 7 hours ago||||
You want to prevent the agent/others from reaching your home directory and other things. As long as you don't mount/sync directories/files from/to the container, so no mounting like "-v $(pwd):/app", but instead copy in, then when done, copy out.

And of course, instead of doing the "copy in > copy out" process manually, get your local agent to write a bash script that does that for you, given what directory you're in, and you're basically G2G.

tjoff 6 hours ago||
What is the advantage of copying rather than a bind-mount?
furst-blumier 1 hour ago||
"Oops I deleted everything under $FOLDER – that mistake is on me" doesn't kill it on your host system
hvb2 6 hours ago|||
What specifically are you looking for? If you start from the premise that it runs as you right now, then that's something you can easily improve upon.

Start by mounting just your repo and passing in the keys for the agent. Take it from there, it's like software engineering, you iterate.

When you run into issues you expand the tools in the container available to it.

rvz 5 hours ago|||
Why developers will never pay for their tools.
KolibriFly 6 hours ago||
[dead]
dSebastien 7 hours ago||
The one thing I wonder about is how you enforce the usage of Docker Sandboxes vs running the agent on the host directly, apart from scanning machines for binaries
nopurpose 6 hours ago||
Most interesting part to me is credentials injection at the sandbox boundary level: https://docs.docker.com/ai/sandboxes/security/credentials
quotemstr 6 hours ago|
Doesn't everyone do this now? It's hardly a new idea. Yet every time someone proposes the idea, people fawn over it and proclaim it the best thing ever.

Yes, you can inject tokens via a proxy. What else is new?

nopurpose 5 hours ago||
Who is doing it as first class feature with at least adequate UX?

I have skimmed alternatives offered in comments to this post (vibepod-cli, code-on-incus, opencode-docker, sandboxy, smolvm, amazing-sandbox) and none of them seem to do credentials injection at the proxy level.

LeBit 3 hours ago||
nono.

Also fnox now does credentials proxying.

elAhmo 5 hours ago||
I wish they solved the issue happening for years on MacOS where Docker keeps up eating all available free space and ends up requiring restart of the whole machine, instead of Gordon and other useless shit.
3371 5 hours ago||
I used this for a while then decided to build my own suites that pack individual harness and respective host state (config, plugins, skills, etc.) into an image. Works better and much flexible in my opinion.
TekMol 6 hours ago|
So this is a VM by Docker?

For those who do not trust

    docker run --rm -it -v "$(pwd)":/work -w /work myaiimage /bin/bash
AND do not want to use some other, free VM for some reason?
woadwarrior01 6 hours ago||
Better yet, use Apple's container CLI if you're on a Mac, instead of the docker bloatware.

container run --rm -it -v "$(pwd)":/work -w /work myaiimage /bin/bash

pulse7 6 hours ago||
Hasn't Docker always been just a thin layer of duct tape over existing solutions?
More comments...