Skip to content

Commit e32f9cc

Browse files
authored
Merge pull request #24102 from dvdksn/sandboxes-461
sandboxes v0.12.0
2 parents 95e834f + 6b7d2fd commit e32f9cc

34 files changed

Lines changed: 1320 additions & 226 deletions

_vale/config/vocabularies/Docker/accept.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Google
9797
Grafana
9898
Gravatar
9999
gRPC
100+
Groq
100101
Grype
101102
HyperKit
102103
inferencing
@@ -115,6 +116,7 @@ JFrog
115116
JUnit
116117
Kata
117118
Kerberos
119+
Kiro
118120
Kitematic
119121
Kubeadm
120122
kubectl
@@ -198,6 +200,7 @@ stargz
198200
stdin
199201
stdout
200202
subfolder
203+
sudo
201204
subvolume
202205
Syft
203206
syntaxes

content/manuals/ai/sandboxes/_index.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ params:
1313
{{< summary-bar feature_name="Docker Sandboxes" >}}
1414

1515
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.
16+
machine. Sandboxes provides a secure way to give agents autonomy without
17+
compromising your system.
1818

1919
## Why use Docker Sandboxes
2020

@@ -45,12 +45,14 @@ coding agents, see [Comparison to alternatives](./architecture.md#comparison-to-
4545
To create and run a sandbox:
4646

4747
```console
48-
$ docker sandbox run claude ~/my-project
48+
$ cd ~/my-project
49+
$ docker sandbox run claude
4950
```
5051

51-
This command creates a sandbox for your workspace (`~/my-project`) and starts
52-
the Claude Code agent inside it. The agent can now work with your code, install
53-
tools, and run containers inside the isolated sandbox.
52+
Replace `claude` with your [preferred agent](./agents/_index.md). This command
53+
creates a sandbox for your workspace (`~/my-project`) and starts the agent. The
54+
agent can now work with your code, install tools, and run containers inside the
55+
isolated sandbox.
5456

5557
## How it works
5658

@@ -84,12 +86,16 @@ that workspace.
8486

8587
Docker Sandboxes works with multiple AI coding agents:
8688

87-
- **Claude Code** - Anthropic's coding agent
88-
- **Codex** - OpenAI's Codex agent (partial support; in development)
89-
- **Copilot** - GitHub Copilot agent (partial support; in development)
90-
- **Gemini** - Google's Gemini agent (partial support; in development)
91-
- **cagent** - Docker's [cagent](/ai/cagent/) (partial support; in development)
92-
- **Kiro** - by AWS (partial support; in development)
89+
- **Claude Code** - Anthropic's coding agent (production-ready)
90+
- **Codex** - OpenAI's Codex agent (in development)
91+
- **Copilot** - GitHub Copilot agent (in development)
92+
- **Gemini** - Google's Gemini agent (in development)
93+
- **OpenCode** - Multi-provider agent with TUI interface (in development)
94+
- **cagent** - Docker's multi-provider coding agent (in development)
95+
- **Kiro** - Interactive agent with device flow auth (in development)
96+
- **Shell** - Minimal sandbox for manual agent installation
97+
98+
For detailed configuration instructions, see [Supported agents](agents/).
9399

94100
## Get started
95101

content/manuals/ai/sandboxes/agents.md renamed to content/manuals/ai/sandboxes/agents/_index.md

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Supported agents
3+
linkTitle: Agents
34
description: AI coding agents supported by Docker Sandboxes with experimental status and configuration details.
45
weight: 50
56
---
@@ -11,14 +12,16 @@ inside microVMs with private Docker daemons.
1112

1213
## Supported agents
1314

14-
| Agent | Command | Status | Notes |
15-
| ----------- | ---------- | ------------ | -------------------------- |
16-
| Claude Code | `claude` | Experimental | Most tested implementation |
17-
| Codex | `codex` | Experimental | In development |
18-
| Copilot | `copilot` | Experimental | In development |
19-
| Gemini | `gemini` | Experimental | In development |
20-
| cagent | `cagent` | Experimental | In development |
21-
| Kiro | `kiro` | Experimental | In development |
15+
| Agent | Command | Status | Notes |
16+
| ----------- | ---------- | ------------ | ----------------------------------------- |
17+
| Claude Code | `claude` | Experimental | Most tested implementation |
18+
| Codex | `codex` | Experimental | In development |
19+
| Copilot | `copilot` | Experimental | In development |
20+
| Gemini | `gemini` | Experimental | In development |
21+
| cagent | `cagent` | Experimental | In development |
22+
| Kiro | `kiro` | Experimental | In development |
23+
| OpenCode | `opencode` | Experimental | In development |
24+
| Custom shell | `shell` | Experimental | Minimal environment for manual setup |
2225

2326
## Experimental status
2427

@@ -36,23 +39,41 @@ Use sandboxes for development and testing, not production workloads.
3639
The agent type is specified when creating a sandbox:
3740

3841
```console
39-
$ docker sandbox create claude ~/my-project
40-
$ docker sandbox create codex ~/my-project
41-
$ docker sandbox create copilot ~/my-project
42-
$ docker sandbox create gemini ~/my-project
43-
$ docker sandbox create cagent ~/my-project
44-
$ docker sandbox create kiro ~/my-project
42+
$ docker sandbox create AGENT [PATH] [PATH...]
4543
```
4644

4745
Each agent runs in its own isolated sandbox. The agent type is bound to the
4846
sandbox when created and cannot be changed later.
4947

48+
## Template environment
49+
50+
All agent templates share a common base environment:
51+
52+
- Ubuntu 25.10 base
53+
- Development tools: Docker CLI (with Buildx and Compose), Git, GitHub CLI, Node.js, Go, Python 3, uv, make, jq, ripgrep
54+
- Non-root `agent` user with sudo access
55+
- Private Docker daemon for running additional containers
56+
- Package managers: apt, pip, npm
57+
58+
Individual agents add their specific CLI tools on top of this base. See
59+
[Custom templates](../templates.md) to build your own agent images.
60+
5061
## Agent-specific configuration
5162

52-
Different agents may require different authentication methods or configuration.
63+
Each agent has its own credential requirements and authentication flow.
64+
Credentials are scoped per agent and must be provided specifically for that
65+
agent (no fallback authentication methods are used).
66+
5367
See the agent-specific documentation:
5468

55-
- [Claude Code configuration](claude-code.md)
69+
- [Claude Code](./claude-code.md)
70+
- [cagent](./cagent.md)
71+
- [Codex](./codex.md)
72+
- [Copilot](./copilot.md)
73+
- [Gemini](./gemini.md)
74+
- [Kiro](./kiro.md)
75+
- [OpenCode](./opencode.md)
76+
- [Custom shell](./shell.md)
5677

5778
## Requirements
5879

@@ -61,9 +82,3 @@ See the agent-specific documentation:
6182
- macOS with virtualization.framework
6283
- Windows with Hyper-V {{< badge color=violet text=Experimental >}}
6384
- API keys or credentials for your chosen agent
64-
65-
## Next steps
66-
67-
- [Claude Code configuration](claude-code.md)
68-
- [Custom templates](templates.md)
69-
- [Using sandboxes effectively](workflows.md)
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: cagent sandbox
3+
description: |
4+
Use Docker cagent in Docker Sandboxes with multi-provider authentication
5+
supporting OpenAI, Anthropic, and more.
6+
keywords: docker, sandboxes, cagent, ai agent, multi-provider, authentication
7+
weight: 60
8+
---
9+
10+
{{< summary-bar feature_name="Docker Sandboxes" >}}
11+
12+
This guide covers authentication, configuration, and usage of Docker cagent in
13+
a sandboxed environment. [cagent](/ai/cagent/) is Docker's open source coding
14+
agent that supports multiple providers.
15+
16+
## Quick start
17+
18+
Create a sandbox and run cagent for a project directory:
19+
20+
```console
21+
$ docker sandbox run cagent ~/my-project
22+
```
23+
24+
The workspace parameter is optional and defaults to the current directory:
25+
26+
```console
27+
$ cd ~/my-project
28+
$ docker sandbox run cagent
29+
```
30+
31+
## Authentication
32+
33+
cagent uses proxy-managed authentication for all supported providers. Docker
34+
Sandboxes intercepts API requests and injects credentials transparently. You
35+
provide your API keys through environment variables, and the sandbox handles
36+
credential management.
37+
38+
### Supported providers
39+
40+
Configure one or more providers by setting environment variables:
41+
42+
```plaintext {title="~/.bashrc or ~/.zshrc"}
43+
export OPENAI_API_KEY=sk-xxxxx
44+
export ANTHROPIC_API_KEY=sk-ant-xxxxx
45+
export GOOGLE_API_KEY=AIzaSyxxxxx
46+
export XAI_API_KEY=xai-xxxxx
47+
export NEBIUS_API_KEY=xxxxx
48+
export MISTRAL_API_KEY=xxxxx
49+
```
50+
51+
You only need to configure the providers you want to use. cagent detects
52+
available credentials and routes requests to the appropriate provider.
53+
54+
### Environment variable setup
55+
56+
Docker Sandboxes use a daemon process that doesn't inherit environment
57+
variables from your current shell session. To make your API keys available to
58+
sandboxes, set them globally in your shell configuration file.
59+
60+
Apply the changes:
61+
62+
1. Source your shell configuration: `source ~/.bashrc` (or `~/.zshrc`)
63+
2. Restart Docker Desktop so the daemon picks up the new environment variables
64+
3. Create and run your sandbox:
65+
66+
```console
67+
$ docker sandbox create cagent ~/project
68+
$ docker sandbox run <sandbox-name>
69+
```
70+
71+
The sandbox detects the environment variables and uses them automatically.
72+
73+
## Configuration
74+
75+
cagent supports YOLO mode that disables safety checks and approval prompts.
76+
This mode grants the agent full access to your sandbox environment without
77+
interactive confirmation.
78+
79+
### Pass options at runtime
80+
81+
Pass cagent CLI options after the sandbox name and a `--` separator:
82+
83+
```console
84+
$ docker sandbox run <sandbox-name> -- run --yolo
85+
```
86+
87+
The `run --yolo` command starts cagent with approval prompts disabled.
88+
89+
## Base image
90+
91+
Template: `docker/sandbox-templates:cagent`
92+
93+
cagent supports multiple LLM providers with automatic credential injection
94+
through the sandbox proxy. Launches with `run --yolo` by default.
95+
96+
See [Custom templates](../templates.md) to build your own agent images.

content/manuals/ai/sandboxes/claude-code.md renamed to content/manuals/ai/sandboxes/agents/claude-code.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
---
2-
title: Configure Claude Code
3-
description: Learn how to configure Claude Code authentication, pass CLI options, and customize your sandboxed agent environment with Docker.
4-
weight: 30
2+
title: Claude Code sandbox
3+
description: |
4+
Use Claude Code in Docker Sandboxes with authentication, configuration, and
5+
YOLO mode for AI-assisted development.
6+
keywords: docker, sandboxes, claude code, anthropic, ai agent, authentication, configuration
7+
weight: 10
58
---
69

710
{{< summary-bar feature_name="Docker Sandboxes" >}}
811

912
This guide covers authentication, configuration files, and common options for
1013
running Claude Code in a sandboxed environment.
1114

15+
Official documentation: [Claude Code](https://code.claude.com/docs)
16+
1217
## Quick start
1318

1419
To create a sandbox and run Claude Code for a project directory:
@@ -17,6 +22,13 @@ To create a sandbox and run Claude Code for a project directory:
1722
$ docker sandbox run claude ~/my-project
1823
```
1924

25+
The workspace parameter is optional and defaults to the current directory:
26+
27+
```console
28+
$ cd ~/my-project
29+
$ docker sandbox run claude
30+
```
31+
2032
### Pass a prompt directly
2133

2234
Start Claude with a specific prompt:
@@ -35,7 +47,7 @@ This starts Claude and immediately processes the prompt.
3547

3648
## Authentication
3749

38-
Claude Code requires an Anthropic API key. You can authenticate using an environment variable (recommended) or through interactive login.
50+
Claude Code requires an Anthropic API key. Credentials are scoped per sandbox.
3951

4052
### Environment variable (recommended)
4153

@@ -66,15 +78,18 @@ The sandbox detects the environment variable and uses it automatically.
6678

6779
### Interactive authentication
6880

69-
If no credentials are found, Claude Code prompts you to authenticate interactively when it starts. You can also trigger the login flow manually using the `/login` command within Claude Code.
81+
If the `ANTHROPIC_API_KEY` environment variable is not set, Claude Code prompts
82+
you to authenticate interactively when it starts. You can also trigger the login
83+
flow manually using the `/login` command within Claude Code.
7084

7185
When using interactive authentication:
7286

73-
- You'll need to authenticate for each workspace/sandbox separately
87+
- You must authenticate each sandbox separately
7488
- If the sandbox is removed or destroyed, you'll need to authenticate again when you recreate it
7589
- Authentication sessions aren't persisted outside the sandbox
90+
- No fallback authentication methods are used
7691

77-
To avoid repeated authentication, use the `ANTHROPIC_API_KEY` environment variable method described above.
92+
To avoid repeated authentication, set the `ANTHROPIC_API_KEY` environment variable.
7893

7994
## Configuration
8095

@@ -93,28 +108,13 @@ For example:
93108
$ docker sandbox run <sandbox-name> -- --continue
94109
```
95110

96-
See the [Claude Code CLI reference](https://docs.claude.com/en/docs/claude-code/cli-reference)
111+
See the [Claude Code CLI reference](https://code.claude.com/docs/en/cli-reference)
97112
for available options.
98113

99114
## Base image
100115

101-
The Claude Code sandbox template is a container image that runs inside the
102-
sandbox VM. It includes:
103-
104-
- Ubuntu-based environment with Claude Code
105-
- Development tools: Docker CLI, GitHub CLI, Node.js, Go, Python 3, Git, ripgrep, jq
106-
- Non-root `agent` user with sudo access
107-
- Private Docker daemon for running additional containers
108-
109-
Claude launches with `--dangerously-skip-permissions` by default in sandboxes.
110-
111-
You can build custom templates based on `docker/sandbox-templates:claude-code`.
112-
See [Custom templates](templates.md) for details.
116+
Template: `docker/sandbox-templates:claude-code`
113117

114-
## Next steps
118+
Claude Code launches with `--dangerously-skip-permissions` by default in sandboxes.
115119

116-
- [Using sandboxes effectively](workflows.md)
117-
- [Custom templates](templates.md)
118-
- [Network policies](network-policies.md)
119-
- [Troubleshooting](troubleshooting.md)
120-
- [CLI Reference](/reference/cli/docker/sandbox/)
120+
See [Custom templates](../templates.md) to build your own agent images.

0 commit comments

Comments
 (0)