Docker distinguishes containers from Docker Sandboxes. A container is an isolated process sharing the host kernel (namespaces + cgroups), ideal for packaged apps, CI, and short-lived execution. Docker Sandboxes run an AI coding agent inside a dedicated microVM with its own Linux kernel, filesystem, network stack, and private Docker Engine, started via sbx run <agent>; the agent gets sudo and can build images, run Compose/Testcontainers without touching the host Docker daemon or socket.
Motivation: coding agents accumulate state over hours (packages, databases, images) and act on untrusted instructions (READMEs, web pages, MCP tool output), so a shared-kernel boundary is insufficient — a kernel exploit, Docker socket mount, or misconfigured host mount can expose the host.
Controls: network egress flows through a host-side deny-by-default proxy, credentials are injected host-side (raw values never enter the VM), and policies are enforced outside the agent process. Kits package repeatable tooling/config; sbxenv.yaml files let teams reproduce setups (Kits in early access, env files experimental). Cloud Sandboxes offer the same isolation on Docker-managed compute.
Limitations: requires a supported hypervisor (Apple silicon/macOS 14+, Windows Hypervisor Platform, or KVM on Ubuntu; nested virtualization inside VMs) and more memory/disk than a container. Shared resources — the read-write workspace mount (or clone mode, which still exposes the repo read-only), local MCP servers, and skills — remain reachable by the agent.
Guidance: containers when you control the code; Sandboxes when workloads generate/fetch code at runtime, run unattended, need their own Docker Engine, or need host-enforced network/credential policy. Recommended pattern: sandbox the agent, containerize the application.