Skip to content

Commit 167507a

Browse files
authored
Merge pull request #24016 from dvdksn/sandboxes-uvm
sandboxes uvm
2 parents 53a914f + 2869118 commit 167507a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2268
-600
lines changed

_vale/config/vocabularies/Docker/accept.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(?i)[A-Z]{2,}'?s
22
jq
33
ripgrep
4+
exfiltration
45
sandboxing
56
Adreno
67
Aleksandrov
@@ -242,6 +243,7 @@ Zsh
242243
[Cc]ompose
243244
[Cc]onfigs
244245
[dD]eduplicate
246+
[Dd]enylist
245247
[Dd]ev
246248
[Dd]iscoverability
247249
[Dd]istroless

content/manuals/ai/sandboxes/_index.md

Lines changed: 61 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,83 @@ params:
1212

1313
{{< summary-bar feature_name="Docker Sandboxes" >}}
1414

15-
Docker Sandboxes simplifies running AI agents securely on your local machine.
16-
Designed for developers building with coding agents like Claude Code, Sandboxes
17-
isolate your agents from your local machine while preserving a familiar
18-
development experience. With Docker Sandboxes, agents can execute commands,
19-
install packages, and modify files inside a containerized workspace that
20-
mirrors your local directory. This gives you full agent autonomy without
21-
compromising safety.
15+
Docker Sandboxes lets you run AI coding agents in isolated environments on your
16+
machine. If you're building with agents like Claude Code, Sandboxes provides a
17+
secure way to give agents autonomy without compromising your system.
2218

23-
## How it works
19+
## Why use Docker Sandboxes
20+
21+
AI agents need to execute commands, install packages, and test code. Running
22+
them directly on your host machine means they have full access to your files,
23+
processes, and network. Docker Sandboxes isolates agents in microVMs, each with
24+
its own Docker daemon. Agents can spin up test containers and modify their
25+
environment without affecting your host.
26+
27+
You get:
28+
29+
- Agent autonomy without host system risk
30+
- Private Docker daemon for running test containers
31+
- File sharing between host and sandbox
32+
- Network access control
33+
34+
For a comparison between Docker Sandboxes and other approaches to isolating
35+
coding agents, see [Comparison to alternatives](./architecture.md#comparison-to-alternatives).
2436

25-
When you run `docker sandbox run <agent>`:
37+
## How to use sandboxes
2638

27-
1. Docker creates a container from a template image and mounts your current
28-
working directory into the container at the same path.
39+
To create and run a sandbox:
2940

30-
2. Docker discovers your Git `user.name` and `user.email` configuration and
31-
injects it into the container so commits made by the agent are attributed
32-
to you.
41+
```console
42+
$ docker sandbox run claude ~/my-project
43+
```
3344

34-
3. On first run, you're prompted to authenticate. Credentials are stored in a
35-
Docker volume and reused for future sandboxed agents.
45+
This command creates a sandbox for your workspace (`~/my-project`) and starts
46+
the Claude Code agent inside it. The agent can now work with your code, install
47+
tools, and run containers inside the isolated sandbox.
3648

37-
4. The agent starts inside the container with bypass permissions enabled.
49+
## How it works
50+
51+
Sandboxes run in lightweight microVMs with private Docker daemons. Each sandbox
52+
is completely isolated - the agent runs inside the VM and can't access your
53+
host Docker daemon, containers, or files outside the workspace.
54+
55+
Your workspace directory syncs between host and sandbox at the same absolute
56+
path, so file paths in error messages match between environments.
3857

39-
### Workspace mounting
58+
Sandboxes don't appear in `docker ps` on your host because they're VMs, not
59+
containers. Use `docker sandbox ls` to see them.
4060

41-
Your workspace directory is mounted into the container at the same absolute path
42-
(on macOS and Linux). For example, `/Users/alice/projects/myapp` on your host
43-
is also `/Users/alice/projects/myapp` in the container. This means:
61+
For technical details on the architecture, isolation model, and networking, see
62+
[Architecture](architecture.md).
4463

45-
- File paths in error messages match your host
46-
- Scripts with hard-coded paths work as expected
47-
- Changes to workspace files are immediately visible on both host and container
64+
### Multiple sandboxes
4865

49-
### One sandbox per workspace
66+
Create separate sandboxes for different projects:
5067

51-
Docker enforces one sandbox per workspace. When you run `docker sandbox run
52-
<agent>` in the same directory, Docker reuses the existing container. This
53-
means state (installed packages, temporary files) persists across agent sessions
54-
in that workspace.
68+
```console
69+
$ docker sandbox run claude ~/project-a
70+
$ docker sandbox run claude ~/project-b
71+
```
5572

56-
> [!NOTE]
57-
> To change a sandbox's configuration (environment variables, mounted volumes,
58-
> etc.), you need to remove and recreate it. See
59-
> [Managing sandboxes](advanced-config.md#managing-sandboxes) for details.
73+
Each sandbox is completely isolated from the others. Sandboxes persist until
74+
you remove them, so installed packages and configuration stay available for
75+
that workspace.
6076

61-
## Release status
77+
## Supported agents
6278

63-
Docker Sandboxes is an experimental feature. Features and setup are subject to
64-
change.
79+
Docker Sandboxes works with multiple AI coding agents:
6580

66-
Report issues on the [Docker Desktop issue tracker](https://github.com/docker/desktop-feedback).
81+
- **Claude Code** - Anthropic's coding agent
82+
- **Codex** - OpenAI's Codex agent (partial support; in development)
83+
- **Gemini** - Google's Gemini agent (partial support; in development)
84+
- **cagent** - Docker's [cagent](/ai/cagent/) (partial support; in development)
85+
- **Kiro** - by AWS (partial support; in development)
6786

6887
## Get started
6988

7089
Head to the [Get started guide](get-started.md) to run your first sandboxed agent.
90+
91+
## Troubleshooting
92+
93+
See [Troubleshooting](./troubleshooting) for common configuration errors, or
94+
report issues on the [Docker Desktop issue tracker](https://github.com/docker/desktop-feedback).

0 commit comments

Comments
 (0)