Rendered at 13:50:23 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
rusch 6 hours ago [-]
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.
Outbound firewall is `--network-isolated`: egress is denied except the agent's own API endpoints plus domains you allow, enforced sandbox-side (working on host-side enforcement now). `--network-none` if you want nothing.
Credential brokering works the way you describe (currently Claude-only, I'll add more as time allows). The API key stays on the host, a local proxy injects it into the outbound request, and the sandbox never holds anything worth stealing. Other agents' credentials currently arrive as read-only file mounts instead (weaker, and something I'll fix soon). Generalising the injector is the obvious next thing.
One difference from your setup: yoloAI copies your worktree instead of mounting it. The agent works on the copy, you `yoloai diff`, and `yoloai apply` replays the commits into your real repo. That's deliberate. Docker's own security docs talk about the dangers of bombs being left behind in a live-mounted dir (git hooks, package.json scripts, Makefiles, IDE task config), which diff/apply avoids.
Isolation is per-sandbox rather than fixed: runc, gVisor, or Kata VMs (QEMU or Firecracker) on Linux; Seatbelt or full macOS VMs via Tart on a Mac.
Support for running agent harnesses in unprivileged podman containers is on my feature list. :-)
pojzon 1 hours ago [-]
Docker containers are not enough isolation for anyone that cares about jailbreak scenarios.
Only real alternative is to use microvms. My goto solution for this are apple/containers.
Supermancho 33 minutes ago [-]
> Docker containers are not enough isolation for anyone that cares about jailbreak scenarios.
For the vast majority of developers, containers are enough, which is why they are ubiquitous while vms are less common. Ofc that ubiquity has led to lazy configuration, which is how the jailbreaking can occur. Knowing what you are doing with containers is a requirement to use containers as an AI sandbox.
wbl 20 minutes ago [-]
The AI launches new kernel bugs as matter of course.
pjmlp 18 minutes ago [-]
There were not the solution for a while now, that is why Kata containers came to be in first place.
TacticalCoder 16 minutes ago [-]
> Only real alternative is to use microvms. My goto solution for this are apple/containers.
Why microVMs? I never ever run a container, AI harness or other, in something else than a full on VM. I could use a microVM but in any case I really don't see why I'd run a container on one of my bare metal OS: the place of a container is inside a VM (or microVM).
Especially for AI harnesses where the threat of an escape is very real: the more defense in depth, the better.
And If I can use rootless Podman instead of "rootfull" Docker, the better. Most of my containers are Podman btw.
> My goto solution for this are apple/containers.
To each his own: my goto solution is an actual server on my LAN with shitload of cores and memory and plenty of scripts to provision VMs etc.
I really don't understand why people are YOLO'ing containers on their bare metal OS.
jachris 5 hours ago [-]
Agreed. Network control and secret injection together with a microVM setup is as good as it gets right now, although I believe that we need more fine-grained tools down the road. It sounds like Microsandbox would be the perfect fit for what you are describing. I also built my own coding agent workbench on top of it (https://github.com/isolade/isolade). Microsandbox is quite cool, check it out: https://github.com/superradcompany/microsandbox
SegmentTree 6 hours ago [-]
Eclipse Enclave does exactly that: There is an outbound firewall and secret injections, so that the agent never sees a real key. And it's fully open source: https://github.com/eclipse-enclave/enclave
dvtkrlbs 6 hours ago [-]
Looking at the Readme it seems like it only supports docker. Which is a dealbreaker for some
collabs 3 hours ago [-]
What is missing in qemu + podman that we need rootful docker for this? Is there actual capability that is missing or is it more of a design choice by the eclipse enclave folks?
(Not affiliated with them, just tried it out last week.)
reddec 5 hours ago [-]
I've put some effort to integrate it to my agentic workflow. The problem, however, with docker in smolvm: it work-ish (there is example), but quite hacky.
Another problem which I wasnt able to solve - persistent image without Dockerfile. CloudInit will be ideal.
Documention at this moment in an early stage.
Overall, its a great project but for me was simpler just use Virtual Machine Manager (libvirt GUI).
I wish all luck to the maintainers, but probably DX-wise I will prefer to have more granular or predictable controls (eg micro cloud from Canonical).
384028345 1 hours ago [-]
Isn't Nvidia's openshell exactly what you're looking for?
I'm asking because I'm just learning about this stuff myself and tested openshell yesterday with pi for the first time.
I have a colleague who's using openshell. The advantage is it's independent of the containerization layer, yes?
cpburns2009 1 hours ago [-]
Gondolin looks interesting. It sounds like a TypeScript wrapper that achieves the same thing as my setup: Docker & Kata Containers 4 (KVM/QEMU backend) for microVMs, iron-proxy for egress and secrets, and dnsmasq for internal network name resolution (workaround for a Docker/Kata incompatibility).
Has egress and ingress filtering, egress can be bound to host/internet/subnet or even better to internal apps (which are each separate netns) meaning you can do your own firewall/vpn/whatever per sandbox. Plus you control what other components in the sandbox env the app can communicate with.
Really not built for day-to-day dev work though, more like automating your company/life / getting rid of SaaS (e.g. for technical Founders / Sales etc, not exactly useful for dev work)
pbasista 3 hours ago [-]
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 least be tested without any credentials.
radlad 2 hours ago [-]
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.
Tomte 3 hours ago [-]
I do the same, but with pi.dev in Incus, mapping a project folder into the VM.
What I don‘t have compared to sbx is an outbound firewall, but my VM does not have any personal/interesting data, only a vanilla Fedora installation and the project dir with open source code, so I do not care much about exfiltration.
nzjrs 4 hours ago [-]
If you just need a python+venv sandbox with dev-first UX, no container build step needed, and no startup cost then I am using https://github.com/nzjrs/sandbubble in prod.
throwaw12 6 hours ago [-]
I havent used nor gondolin neither docker's solution, but curious to know what gondolin is missing (evaluating both for my personal use)? is it only the DX or something else, if DX, can you what exactly is missing?
thanks
codethief 2 hours ago [-]
In my experience it's mostly the UX/DX where Gondolin is lacking. For instance, I don't want to set up a JavaScript project every single time I need a sandbox. Instead, I just want to place a config file somewhere in my repo or my home dir and be done with it.
You can run the agent in the gondolin sandbox if you wish.
Their example implementation with pi uses a pi extension so that pi runs on the host but the read/write/bash/etc tools run in the guest. Doesn’t have to be that way though.
6 hours ago [-]
_ink_ 6 hours ago [-]
Does secret injection really prevent that the agent send my GitHub key somewhere? If it has access to it via env var, can it not just paste it somewhere?
3 hours ago [-]
rusch 5 hours ago [-]
The env var is just a placeholder in the VM, so no real secret is in there.
llimllib 2 hours ago [-]
right, but say you give the agent access to github and it can push as you, or make a gist; now it can easily exfiltrate your secret.
And that's just an easy case - really if it has any network access at all it can come up with a clever way to route a request through the network such that the key comes back somewhere in the request. If you scan for it inbound too, the machine can obfuscate it.
Our agents are trained to be so intensely helpful and they have such intricate knowledge of how things work that they will do some incredibly clever tricks to do what you ask them to do.
skinfaxi 48 minutes ago [-]
The agent has no access to the secret. It has a placeholder that is replaced at a higher level. When it makes the network request the secret is substituted but that is outside of the caller's worldview.
Eldt 32 seconds ago [-]
So what stops it from sending a network request to a git repo that pushes what that placeholder resolves to?
eli 4 hours ago [-]
It’s injected into an outbound api call, not into an env var the agent can read.
kellpossible2 3 hours ago [-]
what's to stop an agent creating an outbound call with the var to a malicious endpoint? (unless you whitelist what it has access to)
mpern 1 hours ago [-]
At least for gondolin and microsandbox, you bind a specific secret placeholder to the target host. i.e. your GH token is only replaced/injected for calls to api.github.com, not other hosts. And you can set up both with deny-by-default
eglintondust 1 hours ago [-]
You just don't inject the real secret unless hostname/whatever rule matches the request, right? I don't know if that's how this works but it's my assumption.
skinfaxi 47 minutes ago [-]
The replacement is on a url/host basis.
kellpossible2 3 hours ago [-]
or an outbound call to a trusted endpoint with the env var in a way that can get exposed to the agent via a subsequent call?
skinfaxi 46 minutes ago [-]
How would that work, exactly? What are you envisioning?
radlad 2 hours ago [-]
It's possible reflected instances are masked too, like GitHub Actions. But I don't know.
https://github.com/pjlsergeant/byre -- slightly different security model, but lazer-focused on developer experience; my daily driver and I love it not just because I wrote it. The TUI is great for configuring and setting up instant boxes just how you want
https://pleasedonotescape.com/ -- a list of every other agent jail I could find, filterable by open-source and whatever else you want
sparsesignal 5 hours ago [-]
What I run is one hardened QEMU/KVM VM per project holding the whole dev environment (editors, agents, containers), with nftables on the host allowing internet egress but dropping anything aimed at the host, the LAN, or any other private address, plus an allowlist for deliberate exceptions.
Basically, it's a plain QEMU/KVM VM on a stock Debian cloud image: device model stripped down to a virtio disk, a virtio NIC and a serial console, nested virt off, no passwordless sudo in the guest. It also ships a containment check that scans outward from inside the guest, so the network boundary is something you can verify.
Wrapping the whole environment rather than a single agent session puts supply chain attacks inside the boundary too. A poisoned npm or PyPI package, or a compromised editor extension, lands in the VM instead of on the host. That was the original reason I set this up; agents just made it more urgent.
There's no per-domain egress allowlist; the policy is "internet yes, private addresses no". Secret injection isn't built in either, though Infisical's agent-vault on the host as an egress proxy covers that part.
Wrote the whole setup up here, in case it's useful:
Yeah I discovered your blog a few days ago: I've got a setup not unlike yours.
> So rather than pick one, this post advocates layering both, in the spirit of defense in depth: a sandbox VM wraps your containers along with the whole toolchain, and that sandbox reaches the internet but has no route to anything private.
Yup it's the only proper way.
And that is true not just for AI harnesses/agents (that shall try to escape), but also for stuff like Plex/Jellyfin/Immich/private pastebin etc.
If you care about security, there really simply is zero reason to run containers on the bare metal.
someothherguyy 2 hours ago [-]
I currently do something similar, but this article was a nice read and gave me some new ideas.
2 hours ago [-]
3 hours ago [-]
3 hours ago [-]
PufPufPuf 1 hours ago [-]
I built "Locki": something similar but open-source! A bit different approach -- single VM with Incus containers -- focusing on speed of spinning up new sandboxes and integraton with git worktrees. The core grievance that motivated me was the lack of docker/kubernetes support in existing sandboxing tools, with Locki there's no chance of footguns like "two agents rebuild :latest tag at the same time". Give it a try: https://github.com/JanPokorny/locki
Grimburger 7 hours ago [-]
> Each agent runs inside a dedicated microVM with your dev environment
What's a "microVM" and what's the security model here compared to using real virtual machines with actual constraints on breakouts?
“microvms” are real vms but the hypervisor and vm (guest kernel) shed most of the hardware / device emulation, support, and discovery which makes traditional VMs look / feel like real computers, as well as most guest interactions. This gives them extremely low overhead.
Firecracker is designed to start a VM in under 125ms and 5MB. Netbsd advertises that you can direct-boot a MICROVM kernel configuration in under 10ms.
jsiepkes 5 hours ago [-]
If an agent fires up NPM, takes a boatload of memory, is that memory released back to the OS after NPM shuts down in the VM?
dist-epoch 5 hours ago [-]
In principle yes, in practice it's complicated, using something called "balloon drivers"
There’s also memory hotplugging via virtio-mem. But generally speaking downscaling live vm memory can’t be said to be a solved problem, it’s more of an active area of research.
TheqO 5 hours ago [-]
There are many devs that have little to no experience of Linux, like the hundreds of thousands of .Net and Java CRUD devs in enterprise companies using Windows.
There is a need for a Docker desktop like GUI for this market.
Izmaki 4 hours ago [-]
When I was a teen I had no experience with software development. Then I went to school and learned about it. Now I'm making money doing this thing because I became quite good.
The world didn't fit around me, so I made "me" fit around "the world". I bet those stubborn dinosaurs can learn a new trick or two also, if management lets them do it during working ours...
Also, WSL (Windows Subsystem for Linux) has been baked into Windows for a long time and makes it very easy to play with Linux, as does using the Hyper-V VM system. Any developer unfamiliar with Linux because they use Windows, has little excuse.
pjmlp 7 minutes ago [-]
Agreed, even game devs that ignore Linux as target for their AAA games, actually tend to use Linux for game servers, the age of IIS with .NET/ISAPI is long gone, except for legacy code stuck in .NET Framework.
Modern .NET did not went cross platform by accident, and Java development has always been "develop on Windows deploy on UNIX", in corporations where Mac tends to have little presence.
11 minutes ago [-]
huflungdung 5 hours ago [-]
[dead]
vdfs 4 hours ago [-]
Your example is not complete, you have to show how it will run claude/codex, you have to do extra things to install run and mount folders there, this one does that with less config, also with this agents can run docker, lxd doesn't allow you to do that
frio 7 hours ago [-]
It’s real VMs, firecracker style.
dist-epoch 5 hours ago [-]
An Ubuntu Server VM, like the ones started by Incus, use at least 512 MB of RAM per instance. If you spawn 10 sandbox VMs, you already pay 5 GB RAM just to sit there idle. You also pay a CPU cost, you have 10 kernels managing stuff, but arguably it doesn't matter that much given CPU core counts.
I use something in between - a single Ubuntu VM, into which I spawn multiple Incus LXC containers for the agents. The containers only use 50 MB or so per instance (separate systemd, ...). This way I pay the VM RAM tax only once, and the agents are still contained inside the VM if they manage to escape the LXC containers.
TacticalCoder 2 minutes ago [-]
Yeah this basically. I differentiate between "containers I wrote" (where I packaged the app/wrote the OCI "Dockerfile" / container file) and "containers from other people": all those I wrote (for our own use) go into one VM, while all the other containers go into another VM. Then I've got a third VM for containers for the AI agents.
This way I don't pay tens of VMs "tax" but basically only three (plus one or two VMs I use for testing enhancements to my VMs provisioning / optimization / securing setup, when I work on that).
I don't use LXC (I could) but regular containers, inside VMs.
I'll look into the stripped down "micro" VMs but then I don't spend my days launching VMs/shutting them down so it's not a big deal.
dizhn 6 hours ago [-]
That's a full VM. Microvms are much smaller and they start up very very fast. In miliseconds.
randomint64 5 hours ago [-]
[dead]
hokkos 7 hours ago [-]
Wow, I hope one day Linux will be able to support the exclusive MacOs/Windows technology of Docker Sandboxes.
(it's in the doc, but kinda strange to not see some instructions on the main page, probably distro related)
Yes, bubblewrap is superior to Docker for this. I wrote a tool to use bubblewrap for the purpose. It needs a tool to start it, or is at least much more convenient with a tool, because you need to take your session/auth data into the container, and if you want the agent to be able to start containers (agents love containers) within the container, you need some config magic mounted inside. You could manually do all that, or do it with a shell script, as well. But, this is how I did it, and you're likely to run into all the same little quirks I ran into:
It seems to do a good job of not stating the actual threat model anywhere.
codethief 2 hours ago [-]
To everyone sharing their favorite container-based sandboxing solution: Docker Sandbox does not use containers for isolation. It spawns the workload in a libkrun-based micro VM, which has vastly different security properties.
I forked a project that makes running in Apple Container (Docker is an alternate runtime for Linux) more convenient and I am working on further improvements: https://github.com/gregwebs/claude-contained/
It blocks network access, mounts only what you specify, and you can add a customization layer.
Several other projects listed here use libkrun which is an alternate implementation that works with Mac's HVF. smolvm, microsandbox, podman (with likrun backend), gondolin.
karakanb 7 hours ago [-]
I got excited for this not because this didn't exist before, but because Docker putting their weight on this would imply a broader adoption and better integration in the industry. I am sad that they are asking for a login here though, which doesn't make any sense to me.
KolibriFly 7 hours ago [-]
That's docker, man. Tomorrow they're gonna add limits on sandbox runs without a premium account too
rvz 6 hours ago [-]
microVMs (firecracker) have existed for years. This is not new.
navigate8310 6 hours ago [-]
I just made my own devcontainer that I copy on any project and load whatever harness I want in that repo. Harnesss' config and auth are simply mounted from the host, so no setup required at all.
I don't get how it works, or works well -- presumably those domains are behind CDNs, and IP addresses are unpredictable. So the firewall allows traffic to specific IPs that are resolved at the time the script is run, but not after that? What if the same domain is resolved again without going through the cache, and it becomes a different IP?
And even if that works, this is a very short list. As soon as you reach for Go, Rust tooling etc nothing works. So you need to manually maintain this list which is nothing but painful trial and error.
ai_fry_ur_brain 6 hours ago [-]
[dead]
llimllib 2 hours ago [-]
Operating systems ought to be providing us the utilities we need to safely sandbox processes (agent or otherwise), but they appear to not be interested in the job
pjmlp 5 minutes ago [-]
Apple, Microsoft, IBM, Unisys, HP, Oracle/Sun have done that for a while now.
d2p 5 hours ago [-]
Does this support Linux yet? When I previously looked it did not (the reason being that they were already using VMs on Windows/macOS but not on Linux). Every time I see an announcement I think "great, they must've added Linux now then", but the linked pages always have Windows + macOS instructions but not Linux.
All the open GH issues about supporting Linux that I subscribed to have gone unresponded to.
OpenShell looks like a good alternative, but it still has "Do not use in production" plastered all over the website, which doesn't fill me with confidence yet
narinciye 4 hours ago [-]
It must be a joke that this tool is not supported on linux yet, although docker is built on top of linux containers. Shame on docker.
SwellJoe 5 hours ago [-]
I think Linux has a better solution than Docker.
I wrote a tool to use `bubblewrap` to containerize any agent (at least all the agents I've used a couple of times), and bind mount the system stuff read-only, so the agent has your "usual" environment, but they can only see the project. Their history persists (either through a bind mount or a "shadow" copy of the history that only the wrapped agent sees), the agent can still create and manage containers of its own using podman's rootless mode, etc. It's nearly instant to start because it's just a namespace (plus a few copied files for the container support and session history); no container needs to be built/fetched/updated/whatever. bubblewrap is extremely well-tested as it is used by flatpak and several other large projects, so I trust it quite a bit (more than I trust Docker).
bubblewrap may work well for you and your specific workflows/projects but not in an enterprise setting where everyone already has a different setup on the host and needs something different inside the container. It's impossible to deploy a solution like that with bubblewrap -- configuration itself is going to be a nightmare. Which is why Docker Sandbox is aimed at teams/enterprises.
I also hit the same issue recently. No Linux and no Windows on arm. AI sandboxing has a lot of options but none feel complete just yet. It's hard to commit to something, especially if reviewing tools to aide in company policies.
Regardless, I'm hoping something that isn't behind a login screen is going to win out.
Haven't tested it yet, but it seems to address the same issue as Docker Sandboxes, but in a different way.
speedgoose 5 hours ago [-]
I have tested it and the big advantage is that is has access to the local development tools.
But it’s not as well sandboxed for sure.
fg137 20 minutes ago [-]
As you as your Go build fails because you haven't put the local cache dir in the "allowed directories", you'll understand how painful this is, as well as most tools based on bubblewrap/sandbox-exec. There is a difference between a clean environment with standard setup vs a layer on top of everyone's existing tools/setup, especially in a enterprise environment.
(I'm sure you can spend time to come up with a proper bubblewrap configuration that allows go build to succeed, but it's probably not worth the effort.)
LeBit 4 hours ago [-]
Why do you say that?
Eg, if used with Colima in macOS, it means I can run a devcontainer in an isolated VM and Nono inside the devcontainer can restrict a lot what can and cannot be done.
You get credentials proxying and network outbound limits.
I have a solution based on Nix that can be used to generate reproducible container images: https://github.com/nothingnesses/agent-images . It lets you customise which agents, harnesses, or any other packages you want included in the VM and it uses `agent-box` for sandboxing.
binsquare 5 hours ago [-]
wonderful, will try to test this in smol machines as well
dizhn 6 hours ago [-]
This looks like gvisor but is a vm like firecracker right? Any reason you did not want to use firecracker?
(I am testing this now as a backend for my pet project which currently supports firecracker and gvisor. No network.)
binsquare 6 hours ago [-]
It's a batteries included alternative to firecracker with a couple of new ideas tossed into the mix i.e. portable like a container (bake into a single file and rehydrate the vm anywhere), dynamic resource allocation, etc.
Alifatisk 7 hours ago [-]
What? Does using sbx require login? Bummer.
dSebastien 7 hours ago [-]
Yes and they have a specific subscription for managing sandbox policies across the enterprise: Docker AI Governance
dSebastien 7 hours ago [-]
You can create those manually but if you want to enforce those then you need the subscription
khanhnguyen8386 34 minutes ago [-]
Finally, a way to run --dangerously-skip-permissions without having a mild heart attack every time the agent decides to rm -rf a mystery directory.
TZubiri 22 minutes ago [-]
'adduser agent'
'su agent'
'curl domain/install.sh | sh'
'runagent'
pkhamre 7 hours ago [-]
I started building my own isolated and security-hardened docker image for OpenCode about half a year ago. Been using it daily.
if I was paranoid about security I wouldn't use docker in the first place.
reddozen 7 hours ago [-]
If any AI company was doing serious engineering isolated containers would have been a prerequisite to using their tools.
globular-toast 6 hours ago [-]
Anyone serious about security will want to bring their own sandbox anyway, not trust these, often proprietary, agents. I've never run an agent outside a sandbox. My first bubblewrap script for `claude` is now over a year old. The tools are available and if you learn to use them you can run any program in a sandbox.
But, in any case, why put in effort doing something people don't expect or ask for? We can assume everyone running agents is either a) using their own sandbox, or b) doesn't care. I think we can guess which category most people fall into. You could maybe argue about responsibility, but I don't think you can argue about "serious engineering".
topspin 3 hours ago [-]
> Anyone serious about security will want to bring their own sandbox anyway
Exactly. It's not as though it's difficult. It never occurred to me to not do this from day one, and it astonishes me that anyone runs this stuff bare metal. Since then, I've brought several other people on board, and that's all they've ever seen: I don't think they'd know how to run outside a sandbox, and that's just fine.
garganzol 51 minutes ago [-]
I do not see any value proposition in this - if I need a sandbox, I make one with Dockerfile, Bubblewrap or virtualization. What I am missing? An enforced required login is a net negative value - it means rug pulls in the future.
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.
That incident was with a model that had the guardrails disabled.
Still obviously you should run all untrusted code in a sandbox, but extreme actions like that would be very unusual with the model that shipped.
celrenheit 3 hours ago [-]
I tried it and it worked great at first but I had multiple issues with it, the disk space usage was growing significantly, I need to login multiple times for each sandbox, it's closed source and not possible to customize to my need.
One other thing, I want to be able to handle multiple repos in the same sandbox and have a standard workflow around worktrees (one worktree per repo, all the worktree mounted in the VM).
Can someone more versed in Docker explain to me how this is different than building my own docker container from a Dockerfile for using Pi agent harness? That's what I do currently. I use Docker Desktop in windows as the backend for that.
Hugsun 6 hours ago [-]
Docker containers use Linux kernel features to create an isolated environment, running on the same machine as docker is.
This creates a virtual machine, with its own kernel, and runs the container in there.
This gives stronger isolation and security guarantees.
eloisius 6 hours ago [-]
I have the same question as GP. Your answer helps a little but not really. I might be naive, but I was under the impression that malicious code escaping a docker image and running amok on my host system was not something I should be too worried about. Especially if I run docker in rootless mode. Is that wrong?
For clarity I’m actually using podman, not Docker.
angry_octet 6 hours ago [-]
Oh no, you should definitely be worried about that. Podman might make it harder to escalate to host root, or manipulate other containers, but it is still vulnerable.
Now I'm curious to know how hardened the Docket Sandbox orchestration interface is. I guess we can assume they have run Mythos against it for a few weeks maybe? It's unclear.
eloisius 6 hours ago [-]
Unsettling. I mean, is there any reasonable way to develop software in 2026? I've already sworn off ever installing npm directly on my host. Containerizing everything is laborious enough, but running a separate VM for everything?
mihaelm 5 hours ago [-]
You just need to work out the threat model for what you're working on. For trusted containerized workloads, where the attack surface is minimal, just containerization is fine. However, agents can do just about anything on your computer if you allow it and people aren't really shying away from `--dangerously-skip-permissions`, so better hardening (VMs, microVMs) is desirable.
cognitiveinline 5 hours ago [-]
BS.
Unless we're talking 0-day/CVE, running an unprivileged container is as trustable as a VM. The only difference is how strictly you want to hold the memory/CPU bar. Infact on linux, containers are more lightweight than VMs.
So yeah, not "vulnerable".
angry_octet 16 minutes ago [-]
LLMs are great at finding 0-day, and people are rubbish at updating their containers and hosts to patch b-day.
Containers have access to the kernel ABI, and as shown in the latest kernel exploits, all the memory handling surface that exposes. The virtualisation interface, offering fewer services, is significantly harder.
Containers are obviously lighter than VMs, both to start and to schedule, but firecracker is pretty fast. gVisor pays overhead per syscall vs at startup.
So yeah, more vulnerable.
sureglymop 6 hours ago [-]
That depends on the runtime though. For example, libkrun lets you do this:
docker run --runtime krun hello-world
That starts/runs the OCI in a qemu microvm.
LeBit 4 hours ago [-]
When the host is a Mac or window , docker always run in a VM anyway.
On Linux, you can run docker directly on the host, but you can also very easily setup a vm with incus and run docker from there.
angry_octet 6 hours ago [-]
It's a VM.
weinzierl 6 hours ago [-]
Before you use no sandbox at all use this or one the many similar projects but it's alway worth remembering that Docker is not a security boundary. It never has been meant to be and never will
become one.
cgroups are a mechanism designed for hierarchical organization and resource distribution. Against a malicious and capable actor, and that is how we have to treat AI agents, cgroups will not withstand.
Also, the kernal is an interface too big for what an AI agent needs and is therefore offering a gigantic attack surface completely unnecessarily.
dboreham 41 minutes ago [-]
Which is fine but this thread is about a feature that provides hypervisor isolation, not cgroups.
TheRoque 5 hours ago [-]
Would you say podman is better, or is it the same as docker ?
weinzierl 5 hours ago [-]
In general running containers rootless is better from a security standpoint and podman makes this much easier. So, yes.
This is not my main point though. Both are based on cgroups and cgroups are the wrong tool for the job.
TheRoque 5 hours ago [-]
Wouldn't it need a super critical exploit, I mean zero-day vulnerability, to escape from that kind of sandbox ? And if you think further, then isn't that risk also applicable to pretty much any kind of sandboxing ?
weinzierl 5 hours ago [-]
Container escapes are more common than you think. Common enough for AWS not to rely on containers for their serverless functions, common enough for Google to say: "Untrusted code shouldn't rely on the container security boundary [..]" [1]
The same is not applicable for any kind of sandboxing for two reasons:
1. The boundary is in the kernal’s own code, enforced by the thing you are trying to be protected from. -> Use a VM
2. The kernal is a gigantic attack surface -> Use gVisor
What if you use tools like bubblewrap or nono inside the container?
Say I want to use pi inside a container. If I wrap pi within a bubblewrap or within nono, how is that less secure than using a vm?
Also, I think most people run containers inside VMs anyway and not directly on their hosts (on Mac and windows you have to use a vm anyway).
akdev1l 1 hours ago [-]
bubble wrap is just doing the same cgroups work
LeBit 1 hours ago [-]
Depending on the configuration, bubblewrap can substantially reduce the attack surface.
It doesn’t change the fact a malicious process is still attacking the same kernel , but it can reduce what it can do to that vm.
realexweb 5 hours ago [-]
[flagged]
cpburns2009 1 hours ago [-]
So Docker is finally adding native support for a microVM backend? I wonder how it well it will compare to using the Kata Containers 4 runtime with the KVM/QEMU backend.
2 hours ago [-]
yellow_lead 7 hours ago [-]
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.
franze 2 hours ago [-]
Here is my solution which uses the Apple Virtualization Framework
als has lots of agents + and typical dev packages (node tooling, python tooling, ....) preinstalled
meffmadd 7 hours ago [-]
I tried Docker Sandboxes but last time I checked you could not configure custom volume mounts, making more complex setups impossible. For work I need two directories for context for the agent to have access to…
6 hours ago [-]
cyberpunk 6 hours ago [-]
put them both inside another directory and share that? what am i missing?
meffmadd 3 hours ago [-]
Of course, but that was not part of my workflow and I found it quite strange that this was simply not possible especially when docker-compose can easily do this
bob1029 6 hours ago [-]
The sandboxing problem is perhaps the greatest justification for doing agent integration via existing human interfaces rather than low level shell access. Granting access to shell is a super obvious path (it's easy) so I can understand us wanting to fight for it. But we should consider the other paths as well before we make our final stand.
Automating browsers with LLM agents properly requires a lot more work than Process.Start into powershell, but the advantages can be immense once you have achieved integration this way. Incrementally maintaining this integration is generally easy because human users cannot tolerate rapid changes either.
It's a hell of a lot easier to convince management to adopt a robot that looks and acts like a human employee than one that looks like a combine harvester. The combine is far more efficient, but it is also totally indiscriminate. Nothing constrains its appetite except for the invisible fence imposed by GPS. The amount of infrastructure required to keep farm equipment from running astray is incredible. In the context of agriculture, the added complexity is definitely worth it. We don't want to have to recreate the same thing with our technology if it can be avoided. Sandboxes and security isolation boundaries are not things to aspire to. These are costs to be paid for admission to something more valuable.
I planed to do exactly this, with podman instead of docker, volume support.
Like:
$ podman run -it --rm -v .:/workspace local-dev-ia /usr/bin/oc
Configured with a .env file.
Hope to do it hopefully before the end of the week.
codethief 2 hours ago [-]
> exactly this
This is nowhere near "exactly this". Docker Sandboxes uses micro VMs, you just use regular containers which have completely different security properties.
akdev1l 2 hours ago [-]
podman run --annotation=run.oci.handler=krun -dp 8080:8080 -t --rm server-without-wasm
Draiken 2 hours ago [-]
Bubblewrap plus some whitelisting of domains/sockets is all you need.
Docker is always a pain to use and this way I don't have to re-install everything a billion times for every different project.
llimllib 2 hours ago [-]
This is what I currently do, but my software uses docker and docker mounts act as a bypass for the file system restrictions, plus docker processes started outside the sandbox allow network proxy escape.
Currently, I don't allow the agent access to docker, start docker myself, and then do short-lived sandbox-free sessions when the agent needs to do things that interact directly with docker; but that's annoying.
devttyeu 6 hours ago [-]
I did try to use those for some stuff:
* Login requirement is something else
* It's closed source last I checked
* Pretty slow/unstable
There are many better namespace/container based options, VMs may be moderately more secure but when you more or less trust your agent and code you can do with lesser containment. And with the recent CVEs in kvm honestly there isn't a huge deal of difference vs namespaces.
(I'm building https://xbin.dev/ for some time now for managing my personal code/apps, a project which started specifically after Docker Sandboxes broke on me some time ago)
dannyw 7 hours ago [-]
I’d rather use another open source solution that doesn’t require a signup, and less likely to get rugpulled.
There is no reason to require a login for creating local mini sandboxes.
If you’re on Apple, native solutions like “container-machine init” come built in and are pretty good, if you’ll only be on Apple hardware.
killerstorm 3 hours ago [-]
Are we sandboxing AI agent harness process, or the environment it executes commands in?
Ideally, they should run in _different_ sandboxes.
The environment might corrode the harness (e.g. rogue npm/pip packet would manipulate agent harness config).
Cameri 2 hours ago [-]
I was going to try it but signing commits with GPG using a Yubikey is not supported.
The option left is to use SSH to sign commits which is a no-go for a different reason.
GZGavinZhao 5 hours ago [-]
I'm confused:
1. If I run this on Mac, then inside the sandbox / microVM, am I still running MacOS or some Linux distribution?
2. If the only thing that's mounted from the host is the $PWD, how does it guarantee that it has all the system libraries that I have installed on my host system? e.g. my `/opt/homebrew` libraries or `sudo apt install libfoo-dev` headers
akdev1l 1 hours ago [-]
Docker uses VMs in non-Linux OS to provide a Linux where containers can actually exist
6 hours ago [-]
threethirtytwo 26 minutes ago [-]
I don't want this that bad. I want the agent to have open access to my system because it actually does important administrative things for me. It is THAT convenient and powerful.
Here's what I want: REALTIME OBSERVABILITY/POWERPOINT.
I don't want to just see what command it ran. I need graphics... what part of the file system it is touching, what network entities it is contacting. If it's running SQL I want the parsed query handed to me in a syntax highlighted and well formatted interface. Imagine that star trek computer presenting automated infographics while someone is doing a presentation, you know what I'm talking about? It's like a automated powerpoint as the agent does it's thing.
I need to understand my agent and what it typically does so I can dangerously wield it. I treat the agent like a gun in a live shooting scenario. That's how I want to use the LLM.
Sandboxes have their purpose. Just like how shooting ranges have their purposes. But I need to fire my gun in the real world and real world is a warzone.
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.
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
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 4 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.
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.
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 7 hours ago [-]
What is the advantage of copying rather than a bind-mount?
furst-blumier 1 hours ago [-]
"Oops I deleted everything under $FOLDER – that mistake is on me" doesn't kill it on your host system
tjoff 22 minutes ago [-]
Sure, but all projects are version controlled? You only mount the project dir so you can only loose your current changes - which is the same if you copy...
hvb2 7 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 6 hours ago [-]
Why developers will never pay for their tools.
KolibriFly 7 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
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 4 hours ago [-]
nono.
Also fnox now does credentials proxying.
elAhmo 6 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.
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?
been using this for a while - works great! Has also had a lot of updates over the past year so worth checking out again if you tried it a while ago
zingar 7 hours ago [-]
Do the agents come preinstalled in the images? Or do they somehow use whatever I’ve installed locally? The former makes sense to me but then I’m wondering whether the sandbox images stay up to date with new releases of each image.
aborsy 4 hours ago [-]
The agent is per installed. If there is an update to the agent, the VM notifies you on a first run and updates it if you approve.
Other than the login problem, it’s a decent option.
pixard 7 hours ago [-]
Ah let's see, do they still want you to LOGIN, in order to use a local dev tool? Yes, yes they do. No thanks Docker. You can keep your buzzword reasoning as to why this is needed.
thomasahle 4 hours ago [-]
Has anyone started proving their sandboxes in Lean (or Coq, etc.)?
So it's basically a container with a fancy name, innit?
runtime_lens 7 hours ago [-]
TO me, that's the important distinction: sandboxing limits what the agent can do but it doesn't necessarily enforce that the agent must run inside the sandbox. You need a separate control layer to enforce that boundary.
nezhar 7 hours ago [-]
You design the sandbox so the agent starts in that layer. The next thing you can do is to limit the network access, this is what I'm working on right now.
Not sure what you mean by "just". Containerisation is generally understood to mean something like what Docker does, which includes sandboxing but a whole lot more on top, like image management etc. Bubblewrap is just sandboxing without the rest of containerisation.
mihaelm 5 hours ago [-]
Docker Sandboxes is using microVMs, not containerization.
quantumwoke 3 hours ago [-]
Just a small meta note: most of the comments in this thread appear to be posting their own codebase (typically AI-generated) that accomplishes the same goal. It's interesting that this problem is simultaneously in high demand and yet considered trivial enough to vibe code per-user solutions to it.
weebull 5 hours ago [-]
...or...just hear me out now...we could limit it in the harness.
Don't give it shell access, just predefined tools.
killerstorm 5 hours ago [-]
What if it puts malicious code into test file and you allow `npm run test `?
cryptoz 7 hours ago [-]
The linked page implies there is no linux support, I wonder why. It's there in the docs if you hunt for it.
Customize the exact environment of your container from the ground up (harnesses, tools, base image, packages, mounts, etc) and enter with a single command.
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/gondolin but the DX is not as polished. https://exe.dev/ would be perfect but it does not come with outbound firewall.
Does anyone have a better alternative?
https://github.com/kstenerud/yoloai
Outbound firewall is `--network-isolated`: egress is denied except the agent's own API endpoints plus domains you allow, enforced sandbox-side (working on host-side enforcement now). `--network-none` if you want nothing.
Credential brokering works the way you describe (currently Claude-only, I'll add more as time allows). The API key stays on the host, a local proxy injects it into the outbound request, and the sandbox never holds anything worth stealing. Other agents' credentials currently arrive as read-only file mounts instead (weaker, and something I'll fix soon). Generalising the injector is the obvious next thing.
One difference from your setup: yoloAI copies your worktree instead of mounting it. The agent works on the copy, you `yoloai diff`, and `yoloai apply` replays the commits into your real repo. That's deliberate. Docker's own security docs talk about the dangers of bombs being left behind in a live-mounted dir (git hooks, package.json scripts, Makefiles, IDE task config), which diff/apply avoids.
Isolation is per-sandbox rather than fixed: runc, gVisor, or Kata VMs (QEMU or Firecracker) on Linux; Seatbelt or full macOS VMs via Tart on a Mac.
I'm using it as my main driver since months.
Support for running agent harnesses in unprivileged podman containers is on my feature list. :-)
Only real alternative is to use microvms. My goto solution for this are apple/containers.
For the vast majority of developers, containers are enough, which is why they are ubiquitous while vms are less common. Ofc that ubiquity has led to lazy configuration, which is how the jailbreaking can occur. Knowing what you are doing with containers is a requirement to use containers as an AI sandbox.
Why microVMs? I never ever run a container, AI harness or other, in something else than a full on VM. I could use a microVM but in any case I really don't see why I'd run a container on one of my bare metal OS: the place of a container is inside a VM (or microVM).
Especially for AI harnesses where the threat of an escape is very real: the more defense in depth, the better.
And If I can use rootless Podman instead of "rootfull" Docker, the better. Most of my containers are Podman btw.
> My goto solution for this are apple/containers.
To each his own: my goto solution is an actual server on my LAN with shitload of cores and memory and plenty of scripts to provision VMs etc.
I really don't understand why people are YOLO'ing containers on their bare metal OS.
It has network filtering + placeholders for secrets.
OSS, no logins needed
(Not affiliated with them, just tried it out last week.)
Documention at this moment in an early stage.
Overall, its a great project but for me was simpler just use Virtual Machine Manager (libvirt GUI).
I wish all luck to the maintainers, but probably DX-wise I will prefer to have more granular or predictable controls (eg micro cloud from Canonical).
https://github.com/NVIDIA/openshell
Internally uses a single VM + Incus containers, supports docker/Kubernetes in each sandbox, has integrated worktree management.
Has egress and ingress filtering, egress can be bound to host/internet/subnet or even better to internal apps (which are each separate netns) meaning you can do your own firewall/vpn/whatever per sandbox. Plus you control what other components in the sandbox env the app can communicate with.
Really not built for day-to-day dev work though, more like automating your company/life / getting rid of SaaS (e.g. for technical Founders / Sales etc, not exactly useful for dev work)
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 least be tested without any credentials.
What I don‘t have compared to sbx is an outbound firewall, but my VM does not have any personal/interesting data, only a vanilla Fedora installation and the project dir with open source code, so I do not care much about exfiltration.
thanks
So I wrote a wrapper around Gondolin which allows me to do that and a few other things: https://github.com/codethief/tuor
(Warning: Still very much experimental / underdocumented.)
It seems with gondoling i need to explain the agent to run commands in the sandbox, but then where does the agent run itself?
[0]: https://earendil-works.github.io/gondolin/workloads/
Their example implementation with pi uses a pi extension so that pi runs on the host but the read/write/bash/etc tools run in the guest. Doesn’t have to be that way though.
And that's just an easy case - really if it has any network access at all it can come up with a clever way to route a request through the network such that the key comes back somewhere in the request. If you scan for it inbound too, the machine can obfuscate it.
Our agents are trained to be so intensely helpful and they have such intricate knowledge of how things work that they will do some incredibly clever tricks to do what you ask them to do.
https://github.com/pjlsergeant/byre -- slightly different security model, but lazer-focused on developer experience; my daily driver and I love it not just because I wrote it. The TUI is great for configuring and setting up instant boxes just how you want
https://pleasedonotescape.com/ -- a list of every other agent jail I could find, filterable by open-source and whatever else you want
Basically, it's a plain QEMU/KVM VM on a stock Debian cloud image: device model stripped down to a virtio disk, a virtio NIC and a serial console, nested virt off, no passwordless sudo in the guest. It also ships a containment check that scans outward from inside the guest, so the network boundary is something you can verify.
Wrapping the whole environment rather than a single agent session puts supply chain attacks inside the boundary too. A poisoned npm or PyPI package, or a compromised editor extension, lands in the VM instead of on the host. That was the original reason I set this up; agents just made it more urgent.
There's no per-domain egress allowlist; the policy is "internet yes, private addresses no". Secret injection isn't built in either, though Infisical's agent-vault on the host as an egress proxy covers that part.
Wrote the whole setup up here, in case it's useful:
https://karamatli.com/posts/network-isolated-kvm-sandbox-ai-...
> So rather than pick one, this post advocates layering both, in the spirit of defense in depth: a sandbox VM wraps your containers along with the whole toolchain, and that sandbox reaches the internet but has no route to anything private.
Yup it's the only proper way.
And that is true not just for AI harnesses/agents (that shall try to escape), but also for stuff like Plex/Jellyfin/Immich/private pastebin etc.
If you care about security, there really simply is zero reason to run containers on the bare metal.
What's a "microVM" and what's the security model here compared to using real virtual machines with actual constraints on breakouts?
Is it marketing fluff?
Incus/LXD has had VM's for a long time now.
Firecracker is designed to start a VM in under 125ms and 5MB. Netbsd advertises that you can direct-boot a MICROVM kernel configuration in under 10ms.
https://en.wikipedia.org/wiki/Memory_ballooning
There is a need for a Docker desktop like GUI for this market.
The world didn't fit around me, so I made "me" fit around "the world". I bet those stubborn dinosaurs can learn a new trick or two also, if management lets them do it during working ours...
Also, WSL (Windows Subsystem for Linux) has been baked into Windows for a long time and makes it very easy to play with Linux, as does using the Hyper-V VM system. Any developer unfamiliar with Linux because they use Windows, has little excuse.
Modern .NET did not went cross platform by accident, and Java development has always been "develop on Windows deploy on UNIX", in corporations where Mac tends to have little presence.
I use something in between - a single Ubuntu VM, into which I spawn multiple Incus LXC containers for the agents. The containers only use 50 MB or so per instance (separate systemd, ...). This way I pay the VM RAM tax only once, and the agents are still contained inside the VM if they manage to escape the LXC containers.
This way I don't pay tens of VMs "tax" but basically only three (plus one or two VMs I use for testing enhancements to my VMs provisioning / optimization / securing setup, when I work on that).
I don't use LXC (I could) but regular containers, inside VMs.
I'll look into the stripped down "micro" VMs but then I don't spend my days launching VMs/shutting them down so it's not a big deal.
(it's in the doc, but kinda strange to not see some instructions on the main page, probably distro related)
I’ve been using this pretty extensively for a few months on Mac and Linux and have been super happy with it.
https://github.com/swelljoe/flar
> That runs the codex OCI in a qemu microvm.
AFAIU it's actually the other way around: krun spawns a libkrun-based (not QEMU-based) VM inside a crun container. Source: https://github.com/libkrun/libkrun/discussions/538#discussio...
So with your solution you get the additional security benefit of containerizing the hypervisor on the host.
https://docs.docker.com/ai/sandboxes/security/credentials/
eg: https://josecastillolema.github.io/podman-wasm-libkrun/#libk...
It blocks network access, mounts only what you specify, and you can add a customization layer.
Several other projects listed here use libkrun which is an alternate implementation that works with Mac's HVF. smolvm, microsandbox, podman (with likrun backend), gondolin.
https://github.com/iodize6399/ai-devcontainer/tree/main/.dev...
I quite like the 'features' layer system, adding extra tools to container in a declarative plugin-like way
Being able to 'safely' run with skip permissions has been a gamechanger
I especially like the firewall it has.
And even if that works, this is a very short list. As soon as you reach for Go, Rust tooling etc nothing works. So you need to manually maintain this list which is nothing but painful trial and error.
All the open GH issues about supporting Linux that I subscribed to have gone unresponded to.
OpenShell looks like a good alternative, but it still has "Do not use in production" plastered all over the website, which doesn't fill me with confidence yet
I wrote a tool to use `bubblewrap` to containerize any agent (at least all the agents I've used a couple of times), and bind mount the system stuff read-only, so the agent has your "usual" environment, but they can only see the project. Their history persists (either through a bind mount or a "shadow" copy of the history that only the wrapped agent sees), the agent can still create and manage containers of its own using podman's rootless mode, etc. It's nearly instant to start because it's just a namespace (plus a few copied files for the container support and session history); no container needs to be built/fetched/updated/whatever. bubblewrap is extremely well-tested as it is used by flatpak and several other large projects, so I trust it quite a bit (more than I trust Docker).
https://github.com/swelljoe/flar
Regardless, I'm hoping something that isn't behind a login screen is going to win out.
Haven't tested it yet, but it seems to address the same issue as Docker Sandboxes, but in a different way.
But it’s not as well sandboxed for sure.
(I'm sure you can spend time to come up with a proper bubblewrap configuration that allows go build to succeed, but it's probably not worth the effort.)
Eg, if used with Colima in macOS, it means I can run a devcontainer in an isolated VM and Nono inside the devcontainer can restrict a lot what can and cannot be done.
You get credentials proxying and network outbound limits.
How is Docker Sandbox better sandboxed?
(I am testing this now as a backend for my pet project which currently supports firecracker and gvisor. No network.)
'su agent'
'curl domain/install.sh | sh'
'runagent'
https://github.com/pkhamre/opencode-docker
But, in any case, why put in effort doing something people don't expect or ask for? We can assume everyone running agents is either a) using their own sandbox, or b) doesn't care. I think we can guess which category most people fall into. You could maybe argue about responsibility, but I don't think you can argue about "serious engineering".
Exactly. It's not as though it's difficult. It never occurred to me to not do this from day one, and it astonishes me that anyone runs this stuff bare metal. Since then, I've brought several other people on board, and that's all they've ever seen: I don't think they'd know how to run outside a sandbox, and that's just fine.
Also if your thing doesn't work with `pi` out of the box, then low effort
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
Still obviously you should run all untrusted code in a sandbox, but extreme actions like that would be very unusual with the model that shipped.
One other thing, I want to be able to handle multiple repos in the same sandbox and have a standard workflow around worktrees (one worktree per repo, all the worktree mounted in the VM).
These were some of the reasons that led me to build: Clawk - https://github.com/clawkwork/clawk
For clarity I’m actually using podman, not Docker.
Now I'm curious to know how hardened the Docket Sandbox orchestration interface is. I guess we can assume they have run Mythos against it for a few weeks maybe? It's unclear.
Unless we're talking 0-day/CVE, running an unprivileged container is as trustable as a VM. The only difference is how strictly you want to hold the memory/CPU bar. Infact on linux, containers are more lightweight than VMs.
So yeah, not "vulnerable".
Containers have access to the kernel ABI, and as shown in the latest kernel exploits, all the memory handling surface that exposes. The virtualisation interface, offering fewer services, is significantly harder.
Containers are obviously lighter than VMs, both to start and to schedule, but firecracker is pretty fast. gVisor pays overhead per syscall vs at startup.
So yeah, more vulnerable.
On Linux, you can run docker directly on the host, but you can also very easily setup a vm with incus and run docker from there.
cgroups are a mechanism designed for hierarchical organization and resource distribution. Against a malicious and capable actor, and that is how we have to treat AI agents, cgroups will not withstand.
Also, the kernal is an interface too big for what an AI agent needs and is therefore offering a gigantic attack surface completely unnecessarily.
This is not my main point though. Both are based on cgroups and cgroups are the wrong tool for the job.
The same is not applicable for any kind of sandboxing for two reasons:
1. The boundary is in the kernal’s own code, enforced by the thing you are trying to be protected from. -> Use a VM
2. The kernal is a gigantic attack surface -> Use gVisor
[1] https://docs.cloud.google.com/kubernetes-engine/docs/resourc...
Say I want to use pi inside a container. If I wrap pi within a bubblewrap or within nono, how is that less secure than using a vm?
Also, I think most people run containers inside VMs anyway and not directly on their hosts (on Mac and windows you have to use a vm anyway).
It doesn’t change the fact a malicious process is still attacking the same kernel , but it can reduce what it can do to that vm.
Though, they need to remove the login requirement.
https://apps.apple.com/app/aifcc-ai-first-computer/id6782364...
als has lots of agents + and typical dev packages (node tooling, python tooling, ....) preinstalled
Automating browsers with LLM agents properly requires a lot more work than Process.Start into powershell, but the advantages can be immense once you have achieved integration this way. Incrementally maintaining this integration is generally easy because human users cannot tolerate rapid changes either.
It's a hell of a lot easier to convince management to adopt a robot that looks and acts like a human employee than one that looks like a combine harvester. The combine is far more efficient, but it is also totally indiscriminate. Nothing constrains its appetite except for the invisible fence imposed by GPS. The amount of infrastructure required to keep farm equipment from running astray is incredible. In the context of agriculture, the added complexity is definitely worth it. We don't want to have to recreate the same thing with our technology if it can be avoided. Sandboxes and security isolation boundaries are not things to aspire to. These are costs to be paid for admission to something more valuable.
Like:
$ podman run -it --rm -v .:/workspace local-dev-ia /usr/bin/oc
Configured with a .env file. Hope to do it hopefully before the end of the week.
This is nowhere near "exactly this". Docker Sandboxes uses micro VMs, you just use regular containers which have completely different security properties.
Docker is always a pain to use and this way I don't have to re-install everything a billion times for every different project.
Currently, I don't allow the agent access to docker, start docker myself, and then do short-lived sandbox-free sessions when the agent needs to do things that interact directly with docker; but that's annoying.
There are many better namespace/container based options, VMs may be moderately more secure but when you more or less trust your agent and code you can do with lesser containment. And with the recent CVEs in kvm honestly there isn't a huge deal of difference vs namespaces.
(I'm building https://xbin.dev/ for some time now for managing my personal code/apps, a project which started specifically after Docker Sandboxes broke on me some time ago)
There is no reason to require a login for creating local mini sandboxes.
If you’re on Apple, native solutions like “container-machine init” come built in and are pretty good, if you’ll only be on Apple hardware.
Ideally, they should run in _different_ sandboxes.
The environment might corrode the harness (e.g. rogue npm/pip packet would manipulate agent harness config).
The option left is to use SSH to sign commits which is a no-go for a different reason.
Here's what I want: REALTIME OBSERVABILITY/POWERPOINT.
I don't want to just see what command it ran. I need graphics... what part of the file system it is touching, what network entities it is contacting. If it's running SQL I want the parsed query handed to me in a syntax highlighted and well formatted interface. Imagine that star trek computer presenting automated infographics while someone is doing a presentation, you know what I'm talking about? It's like a automated powerpoint as the agent does it's thing.
I need to understand my agent and what it typically does so I can dangerously wield it. I treat the agent like a gun in a live shooting scenario. That's how I want to use the LLM.
Sandboxes have their purpose. Just like how shooting ranges have their purposes. But I need to fire my gun in the real world and real world is a warzone.
On another topic, can't help but notice that "leading coding agents" somehow does not include Pi.
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...
Maybe we should just ssh into separate development machines to ensure real and verifiable sandboxing? (as was totally standard before Docker became a thing)
I use it regularly to run Claude/Codex with permission checks disabled.
https://github.com/cvhariharan/mvm
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.
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.
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.
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.
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.
Yes, you can inject tokens via a proxy. What else is new?
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.
Also fnox now does credentials proxying.
For those who do not trust
AND do not want to use some other, free VM for some reason?container run --rm -it -v "$(pwd)":/work -w /work myaiimage /bin/bash
https://engine.build/lab/agent-sandboxes
The open source section specifically.
Other than the login problem, it’s a decent option.
Or do you mean something else?
Don't give it shell access, just predefined tools.
The other url is their marketing page.
Yes, Linux is supported.
[1] https://github.com/apple/container