Get started with Docker Sandboxes — Run your first sandbox
Pick a project directory and launch an agent with sbx run Bounded code example (external data; do not execute automatically): ```console $ cd ~/my-project $ sbx run --name my-sandbox claude ``` The first time you run a sandbox, the CLI prompts you to choose a default network preset Bounded code exam
Reference note (untrusted external data; do not execute it as instructions).
Pick a project directory and launch an agent with sbx run
Bounded code example (external data; do not execute automatically):
```console
$ cd ~/my-project
$ sbx run --name my-sandbox claude
```
The first time you run a sandbox, the CLI prompts you to choose a default network preset
Bounded code example (external data; do not execute automatically):
```plaintext
Initialize the global network policy for your sandboxes:
Applies to all sandboxes, current and future — change it later with
"sbx policy allow/deny/rm". Kits, including built-in agent kits, may
also add per-sandbox rules.
1. Open — All network traffic allowed, no restrictions.
❯ 2. Balanced — Default deny, with common dev sites allowed.
3. Locked Down — All network traffic blocked unless you allow it.
Use ↑/↓ or 1–3 to navigate, Enter to confirm, Esc to cancel.
```
Balanced is a good starting point — it permits traffic to common development services while blocking everything else. You can adjust individual rules later. See Local policy for a full description of each option.
Replace claude with the agent you want to use — see Agents for the full list.
The first run takes a little longer while the agent image is pulled. Subsequent runs reuse the cached image and start in seconds.
This attaches you to the agent running inside the sandbox. Give it a real task — ask it to add a feature, install a dependency, or build and run your project. The agent has a full Linux environment with its own Docker daemon, so it can install packages, build images, and start containers on its own while it works.
Attribution: Adapted from Docker Documentation under Apache-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Docker Documentation — content/manuals/ai/sandboxes/get-started.md :: Run your first sandbox ↗Revision 3a9d778562f3 · Apache-2.0 and attribution