Skip to content

Commit 87fa1fa

Browse files
committed
sandboxes: add agent-specific documentation
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent cc292c1 commit 87fa1fa

15 files changed

Lines changed: 815 additions & 71 deletions

File tree

_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
@@ -196,6 +198,7 @@ stargz
196198
stdin
197199
stdout
198200
subfolder
201+
sudo
199202
subvolume
200203
Syft
201204
syntaxes

content/manuals/ai/sandboxes/_index.md

Lines changed: 15 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

@@ -49,9 +49,10 @@ $ cd ~/my-project
4949
$ docker sandbox run claude
5050
```
5151

52-
This command creates a sandbox for your workspace (`~/my-project`) and starts
53-
the Claude Code agent inside it. The agent can now work with your code, install
54-
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.
5556

5657
## How it works
5758

@@ -85,14 +86,16 @@ that workspace.
8586

8687
Docker Sandboxes works with multiple AI coding agents:
8788

88-
- **Claude Code** - Anthropic's coding agent
89-
- **OpenCode** - Multi-provider agent with AGENTS.md support
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)
9096
- **Shell** - Minimal sandbox for manual agent installation
91-
- **Codex** - OpenAI's Codex agent (partial support; in development)
92-
- **Copilot** - GitHub Copilot agent (partial support; in development)
93-
- **Gemini** - Google's Gemini agent (partial support; in development)
94-
- **cagent** - Docker's [cagent](/ai/cagent/) (partial support; in development)
95-
- **Kiro** - by AWS (partial support; in development)
97+
98+
For detailed configuration instructions, see [Supported agents](agents/).
9699

97100
## Get started
98101

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

Lines changed: 23 additions & 8 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
---
@@ -20,7 +21,7 @@ inside microVMs with private Docker daemons.
2021
| cagent | `cagent` | Experimental | In development |
2122
| Kiro | `kiro` | Experimental | In development |
2223
| OpenCode | `opencode` | Experimental | In development |
23-
| Shell | `shell` | Experimental | Minimal environment for manual setup |
24+
| Custom shell | `shell` | Experimental | Minimal environment for manual setup |
2425

2526
## Experimental status
2627

@@ -44,6 +45,19 @@ $ docker sandbox create AGENT [PATH] [PATH...]
4445
Each agent runs in its own isolated sandbox. The agent type is bound to the
4546
sandbox when created and cannot be changed later.
4647

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+
4761
## Agent-specific configuration
4862

4963
Each agent has its own credential requirements and authentication flow.
@@ -52,7 +66,14 @@ agent (no fallback authentication methods are used).
5266

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: 14 additions & 25 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:
@@ -42,8 +47,7 @@ This starts Claude and immediately processes the prompt.
4247

4348
## Authentication
4449

45-
Claude Code requires an Anthropic API key. Credentials are scoped per sandbox
46-
and must be provided through environment variables or interactive login.
50+
Claude Code requires an Anthropic API key. Credentials are scoped per sandbox.
4751

4852
### Environment variable (recommended)
4953

@@ -85,7 +89,7 @@ When using interactive authentication:
8589
- Authentication sessions aren't persisted outside the sandbox
8690
- No fallback authentication methods are used
8791

88-
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.
8993

9094
## Configuration
9195

@@ -104,28 +108,13 @@ For example:
104108
$ docker sandbox run <sandbox-name> -- --continue
105109
```
106110

107-
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)
108112
for available options.
109113

110114
## Base image
111115

112-
The Claude Code sandbox template is a container image that runs inside the
113-
sandbox VM. It includes:
114-
115-
- Ubuntu-based environment with Claude Code
116-
- Development tools: Docker CLI, GitHub CLI, Node.js, Go, Python 3, Git, ripgrep, jq
117-
- Non-root `agent` user with sudo access
118-
- Private Docker daemon for running additional containers
119-
120-
Claude launches with `--dangerously-skip-permissions` by default in sandboxes.
121-
122-
You can build custom templates based on `docker/sandbox-templates:claude-code`.
123-
See [Custom templates](templates.md) for details.
116+
Template: `docker/sandbox-templates:claude-code`
124117

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

127-
- [Using sandboxes effectively](workflows.md)
128-
- [Custom templates](templates.md)
129-
- [Network policies](network-policies.md)
130-
- [Troubleshooting](troubleshooting.md)
131-
- [CLI Reference](/reference/cli/docker/sandbox/)
120+
See [Custom templates](../templates.md) to build your own agent images.

0 commit comments

Comments
 (0)