Ask HN: How are you sandboxing your coding agents?

by kwar13on 1/21/2026, 3:01 AMwith 7 comments

I've seen a few articles here using bubblewrap, vagrant, VMs, even docker to sandbox coding agents to avoid the inevitable disaster. I've personally been using a headless VM but it's quite resource intensive and I'm wondering if there are better ways to do this.

by gnabgibon 1/21/2026, 3:07 AM

Recent related Ask HN: How are you sandboxing coding agents? (46 points, 25 days ago, 32 comments) https://news.ycombinator.com/item?id=46400129

by bitkin_devon 1/21/2026, 3:15 AM

Standard VMs are definitely overkill for per-agent instances due to the resource overhead.

If you need strict isolation for untrusted code but want container-like speed, look into Firecracker (MicroVMs) or gVisor (userspace kernel).

Firecracker is what AWS Lambda uses. It strips down the kernel to the bare minimum, so you get VM-level isolation with millisecond boot times and a tiny memory footprint. It’s essentially the sweet spot between "insecure" Docker and "heavy" full VMs.

by rubenflamshepon 1/21/2026, 4:04 AM

Currently I'm using docker-ized git worktrees so I can dangerously skip permissions. It's not great. Worktrees are not the way to go and Claude Code treats docker as a second-class citizen (e.g., going through the MacOS auth flow deletes the linux-based auth tokens you need to mount in the container)

by SafeDuskon 1/21/2026, 4:27 AM

Using https://github.com/aperoc/toolkami which just spins up a worktree with pre-configured Docker containers.

by burntoutgrayon 1/21/2026, 3:07 AM

I use a physically separate system.

i.e. DEV and PROD are completely airgapped.

by handfuloflighton 1/21/2026, 3:36 AM

Orbstack VM.