Sandboxing agents
For engineers
Running agents and AI-written code in containers, microVMs and OS sandboxes with default-deny network egress, and the mistakes that break isolation
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
What does an OS-level sandbox in an agent CLI do that a permission prompt does not?
Check yourself · 2 of 5
What does a Docker container NOT isolate from the host?
Check yourself · 3 of 5
What is the main security difference between a container and a Firecracker microVM?
Check yourself · 4 of 5
What does default-deny egress mean for an agent sandbox?
Check yourself · 5 of 5
Why is mounting /var/run/docker.sock into an agent container dangerous?
Topics
- Built-in sandboxes in agent CLIs4 min read · OS-level sandboxing in coding agents such as Claude Code and Codex CLI (Seatbelt, bubblewrap, Landlock), sandbox modes and how they pair with approvals
- Container sandboxes for coding agents4 min read · Dev containers and Docker for agents: non-root users, minimal mounts, dropped capabilities, and the shared kernel a container does not isolate
- MicroVMs and hosted sandboxes for untrusted code4 min read · gVisor, Firecracker microVMs and hosted code sandboxes, and when untrusted AI-generated code needs a VM boundary instead of a container
- Default-deny network egress for agents4 min read · Proxy allow-lists for package registries and APIs, blocking everything else, and data leaving through DNS or allowed domains
- Sandbox escapes and leaky mounts4 min read · Mounted Docker sockets, home directories, SSH keys and .env files, privileged mode and host networking that quietly undo a sandbox
Start here
- Sandboxing (Claude Code docs) (opens in a new tab)DocsFree
How a coding agent's sandbox limits files and network, and how it pairs with permission prompts.
- Making Claude Code more secure and autonomous with sandboxing (Anthropic) (opens in a new tab)ArticleFree
Why filesystem and network isolation must work together, explained by the team that built it.
- Docker Engine security (opens in a new tab)DocsFree
What containers isolate, what they share with the host, and how capabilities and the daemon socket matter.
Helps to know first
110 questions · last verified 2026-12