Docker Sandboxes
v0.39.0 commercialDocker Sandboxes isolates containerized applications in secure, lightweight environments for testing and development without affecting the host system.
sbx env run # .sbxenv.yaml agent: claude workspace: . kits: - name: my-kit env: - NODE_ENV=development secrets: - MY_API_KEY ports: - 8080 DOCKER_SANDBOXES_FEATURE_SANDBOX_USB=1 sbx create --usb /dev/bus/usb/001/002 my-sandbox sbx run --deny-network 10.0.0.0/8 claude sbx run --model ollama/llama3 claude
Summary
Docker Sandboxes is an open-source command-line tool that runs AI coding agents inside isolated microVM sandboxes, each with its own Docker daemon, filesystem, and network so agents can build containers, install packages, and modify files without touching the host. The `sbx` CLI itself is free, including for commercial use; centrally managing network and filesystem policy across an organization's developers from the Docker Admin Console requires a separate paid subscription. It installs via Homebrew, WinGet, or APT/RPM packages and works with Claude Code, Codex, Gemini CLI, OpenCode, and other agents, making it a fit for developers and platform teams who need to run autonomous coding agents without exposing their machines to arbitrary file or network access. It sits in the runtime-security and sandboxing space, layering egress policy, secrets management, and audit logging around agent execution rather than just isolating processes.
Docker Sandboxes isolates containerized applications in secure, lightweight environments for testing and development without affecting the host system.
What Docker Sandboxes answers
What stops an agent from reaching the internet or exfiltrating data through the back door?
network policy gates DNS resolution and blocks outgoing ICMP by default, closing lookup- and ping-based exfiltration channels even if a domain is otherwise denied
What operating systems and hardware can actually run this?
packages ship for macOS, Windows, Ubuntu, Rocky Linux, and Linux ARM64, though Linux hosts need kvm group membership since sandboxes are microVMs rather than plain containers
Can I keep using the models and secrets I already have configured?
built-in providers like OpenRouter get automatic bearer-token injection, custom secrets support wildcard host patterns and Basic-auth substitution, and Linux falls back to an encrypted on-disk store when no keychain is present
Do I have to trust every kit I find, or can I lock that down?
kit installs are restricted to an allowlist of sources, defaulting to Docker Hub only, so pulling from another registry or a Git URL fails until an admin explicitly permits it
Can I prove to auditors what the agent was allowed to touch?
policy rules can be listed per sandbox with inactive governed rules revealed on demand, and structured audit logs of every policy decision can be forwarded to a SIEM, though that logging requires the paid governance subscription
Will multiple sandboxes for the same project step on each other?
sandboxes can be named independently of the working directory, so several run side by side in one workspace and can be re-attached from any directory by name
Examples
Command line
No option matches that search.
| option | found in | since | description |
|---|
No option matches that search.
Values are placeholders taken from each option’s declared default. Nothing is executed here — the output shown is a recording of a run that already happened.
Release history
- v0.39.0
Docker Sandboxes v0.39.0 adds declarative
.sbxenv.yamlenvironments,sbx envlifecycle commands, USB passthrough, bulksbx prune, and kit signing via cosign.└──▷ GET THIS VERSION$ git clone --branch v0.39.0 https://github.com/docker/sbx-releases.git # already have the repo? check out this version: $ git checkout v0.39.0
└──▷ TRY ITCommit a reproducible sandbox definition with your project so every contributor launches the same environment with one command.$ sbx env runDefine a complete sandbox environment — agent, kits, env vars, secrets, ports, and resource limits — in a project-committed file.# .sbxenv.yaml agent: claude workspace: . kits: - name: my-kit env: - NODE_ENV=development secrets: - MY_API_KEY ports: - 8080
Passthrough a specific USB device into a sandbox for hardware-in-the-loop testing on Linux x86_64/ARM64.$ DOCKER_SANDBOXES_FEATURE_SANDBOX_USB=1 sbx create --usb /dev/bus/usb/001/002 my-sandbox
- ›New
sbx env runcommand provisions a sandbox from.sbxenv.yamland opens an interactive session;sbx env create,sbx env exec, andsbx env rmmanage the full environment lifecycle. - ›New
.sbxenv.yamldeclarative environment file defines agent, workspace, kits, environment variables, secrets, registry credentials, ports, and resource limits — committable with a project for reproducible contributor environments. - ›Multiple
.sbxenv.yamlfiles can be combined for shared configuration and local overrides, with host environment variable references for machine-specific paths and credentials. - ›New experimental
--usbflag onsbx create(enabled viaDOCKER_SANDBOXES_FEATURE_SANDBOX_USBenvironment variable) re-attaches specified USB devices into the sandbox via usbfs on Linux x86_64/ARM64. - ›New
sbx prunecommand bulk-removes stopped sandboxes with filtering by how long each has been stopped, never touching running sandboxes.
+9 moreshow less
- ›
sbx runandsbx createnow accept-e/--envand--env-fileto inject environment variables into a sandbox, followingdocker runprecedence rules. - ›New
--provider ollamaflag onsbx run --modelselects the Ollama backend, replacing the formerollama/model-name prefix. - ›
sbx secret setandsbx secret set-customnow support dynamic secrets that resolve values from a reference or command, with options to control refreshing, verification, and error output. - ›Sandboxes now expose
SANDBOX_NAMEandSANDBOX_IDenvironment variables matching the values shown bysbx ls --json; the olderSANDBOX_VM_IDis deprecated. - ›Claude Code's
/remote-controlendpoint can now be used inside sandboxes by enabling theclaude.remoteControlsetting viasbx settings set claude.remoteControl true. - ›New
platform.images.registryMirrorsetting redirects Docker Hub-resolving sandbox template and kit images to an organization's registry mirror. - ›Kits can now be signed and verified with cosign-compatible Sigstore signatures via
sbx kit sign/sbx kit verify, with optional policy enforcement at load time. - ›OAuth kits can now declare their credential file using the declarative
credentialFile.structureform (rendered to well-formed JSON) instead of a free-form Go template. - ›
sbx diagnosenow reports free disk space on the volume holding sandbox data, detects broken/shadowed/stale SSH client configuration, and checks host virtualization support.
└──▷ BREAKING ON UPGRADE- !
sbx run --modelno longer accepts anollama/prefix to select the Ollama backend; use the new--provider ollamaflag instead.
- ›New
- v0.38.0
Docker Sandboxes v0.38.0 adds MCP gateway management, kit spec v2, GPU passthrough, per-sandbox network deny rules, and local GGUF model support.
└──▷ GET THIS VERSION$ git clone --branch v0.38.0 https://github.com/docker/sbx-releases.git # already have the repo? check out this version: $ git checkout v0.38.0
└──▷ TRY ITBlock a sandbox from reaching an internal IP range at creation time, getting a clear policy message instead of a silent timeout.$ sbx run --deny-network 10.0.0.0/8 claude
Start a Claude Code session using a local GGUF model served by Ollama instead of the cloud API.$ sbx run --model ollama/llama3 claude
- ›Adds
sbx mcpsubcommand for registering and managing remote or local MCP servers, with a built-in MCP gateway that keeps OAuth credentials on the host. - ›Adds dynamic MCP tools
mcp-find,mcp-add, andmcp-config-setfor attaching registered MCP servers to sandboxes. - ›Adds
--deny-network HOSTflag tosbx runandsbx createto record per-sandbox network deny rules at creation time, with layer-aware egress messages. - ›Adds
sbx daemon restartsubcommand to stop and restart the sandboxd daemon in the background. - ›Introduces kit spec
schemaVersion: '2'(v2 grammar) with clearer structure for setup, permissions, agent instructions, networking, and credentials; v1 kits continue to load via the legacy path.
+19 moreshow less
- ›Adds
DOCKER_SANDBOXES_CLONED_WORKSPACE_SIZEenvironment variable to configure the size of the cloned workspace volume. - ›Experimental: adds
sbx run --gpufor NVIDIA VFIO GPU passthrough on Linux, enabled viasbx settings set feature.sandbox-gpu true. - ›Experimental: adds
sbx run --model <name> claudeto run Claude Code against a local GGUF model; prefix withollama/to use a model from an existing Ollama installation. - ›Experimental: adds
proxy,proxy.sandbox,proxy.daemon, and matchingno_proxysettings for separate proxy configuration scopes for sandbox and daemon traffic. - ›Experimental: adds
proxy.integratedAuthsetting on Windows to enable NTLM/Kerberos/Negotiate authentication to upstream proxies. - ›Experimental: adds
tls.allowNegativeSerialsetting (viasbx settings set tls.allowNegativeSerial true) for compatibility with TLS-inspecting proxies that issue certificates with negative serial numbers. - ›MCP server and tool registrations can be governed organization-wide using Cedar policies.
- ›
sbx inspectnow displays custom secrets configured for a sandbox. - ›
sbx createandsbx runshow detailed structured startup progress, including environment files loaded, resources provisioned, and each kit command outcome; kit-install progress streams live duringsbx create --kit. - ›Blocked HTTPS proxy connections now appear in
sbx policy logeven when the client aborts the TLS handshake. - ›Docker Agent and OpenCode sandboxes can authenticate GitHub Copilot requests with proxy-managed GitHub credentials.
- ›Codex sandboxes created from the TUI prefer stored OpenAI OAuth credentials over API keys.
- ›Kit install commands can now consume static files from
files/home, including binary files. - ›Kits using
extendscorrectly inherit and override the base image or build source of their parent. - ›Homebrew installs from a stapled
.dmgartifact instead of a.tar.gzarchive, improving Gatekeeper compatibility on macOS. - ›
sbx policy allow networkreports a clear error when org governance overrides a local allow rule. - ›Signing in refreshes organization policies in the running daemon immediately instead of waiting for the next polling interval.
- ›IP-literal destinations denied by a CIDR rule now fail fast with a policy message instead of timing out.
- ›Service and custom secrets are global by default, with
--sandboxfor sandbox scope; legacy positional and--globalforms are deprecated with warnings.
- ›Adds