Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Docker 7 min read Deep dive easyNovice

Comparing Different Approaches to Sandboxing

AI agents need strong isolation because hallucinations and prompt injection can lead to destructive commands, and the common sandboxing options trade isolation against cost. chroot isolates only the filesystem and can be escaped by root processes. systemd-nspawn adds process and network isolation but is Linux-only. Containers need privileged mode for Docker-in-Docker, which weakens isolation, and full VMs like Lima cost about 4GB RAM and 30-60s boot per agent. MicroVMs with a dedicated guest kernel and gVisor's user-space syscall interception sit in between, and Docker Sandboxes is pitched as a cross-platform microVM option with hypervisor, network and per-sandbox Docker Engine isolation.

Assumes: Linux processes and filesystemsDocker containersvirtual machines basics

Related posts

  • Docker Sandboxes vs. Containers: Choosing the Right Isolation for AI Agents

    Docker mediumAdept

    Containers are isolated processes sharing the host kernel. Docker Sandboxes are microVMs with their own kernel, filesystem, network and private Docker Engine, designed for autonomous coding agents that accumulate state for hours and act on untrusted instructions. A container escape or a mounted Docker socket can expose the host. In a sandbox, an escape lands in a disposable VM, and network egress and credential injection are enforced by a host-side deny-by-default proxy. The tradeoffs are hypervisor requirements, more memory and disk, and some configuration through Kits and sbxenv.yaml. The recommendation: sandbox the agent and containerize the application it works on.

  • Why MicroVMs: The Architecture Behind Docker Sandboxes

    Docker easyNovice

    Docker Sandboxes run each AI coding agent session in a dedicated microVM with its own kernel and a private Docker daemon, giving VM-grade isolation while still allowing docker build, run and compose without socket mounting or host privileges. Full VMs are too slow for ephemeral sessions, containers force privileged Docker-in-Docker, and WASM/V8 isolates offer weaker isolation and no real OS environment. Because Firecracker is Linux/KVM-only, Docker built a new cross-platform VMM on Hypervisor.framework, Windows Hypervisor Platform and KVM to get fast cold starts on developer laptops. File, network and secret policies are set by infrastructure before the agent runs, with credentials injected from outside the VM boundary.

  • Why AI Agents Need Isolation

    Docker easyNovice

    AI coding agents that run commands, install packages and handle credentials should execute behind an isolation boundary rather than directly on the developer's host. Docker Sandboxes (sbx) runs agents in microVMs instead of plain containers, because containers share the host kernel. Docker built its own VMM rather than using Firecracker so the same model works on macOS and Windows as well as Linux. Credentials stay on the host: the agent sees a sentinel placeholder, and a proxy swaps in the real auth header on outbound requests. Sandbox Kits package tools, network rules, credentials, files, startup commands and agent memory (e.g. AGENTS.md) into reusable specs, either as stackable Mixin Kits that extend an existing agent or as Agent Kits that define a full agent environment from scratch.

  • The Untrusted Autonomous Workload: How AI Coding Agents Reshape What Isolation Has to Do

    Docker mediumAdept

    AI coding agents are untrusted, autonomous workloads that containers were never designed to isolate, so Docker Sandboxes runs each agent in a microVM (custom VMM on Hypervisor.framework, WHP or KVM) with its own kernel and private Docker Engine. Outbound traffic goes through a TLS-intercepting host proxy that enforces domain policies and injects credentials from the host keychain, so secrets never enter the VM. Two limits remain: domain-level allowlists still permit exfiltration via sites like github.com, and the shared workspace lets an agent plant Git hooks, package.json scripts or CI configs that later run on the host. A real Astro build showed no measurable microVM overhead, though a jemalloc dependency failed on 16K-page Apple Silicon VMs. Agent output should be reviewed like an untrusted pull request, for example by diffing .git/hooks and using --branch worktrees.

  • How to Choose the Right Sandbox for AI Agents

    LangChain easyNovice

    Agents that write and run code face prompt injection risk, and Willison's "lethal trifecta" (sensitive data, untrusted content, external communication) and Meta's "Agents Rule of Two" frame when autonomy becomes dangerous. A good sandbox narrows that exposure with an isolated filesystem, egress allowlists, resource limits, controlled reuse, and kernel-level isolation via microVMs, since container-only setups like a default Kubernetes Agent Sandbox deployment share the host kernel. Running the sandbox as a tool rather than putting the agent inside it keeps API keys and agent state out of the execution environment at the cost of network latency. The piece closes by pitching LangSmith Sandboxes, which use per-sandbox microVMs and an auth proxy that injects credentials outside the sandbox.

The quest for software engineering knowledge.

Look:
Layout: