spawn/sh/sandbox/README.md
Ahmed Abushagur 18bbe3e9a5
Some checks are pending
CLI Release / Build and release CLI (push) Waiting to run
Lint / ShellCheck (push) Waiting to run
Lint / Biome Lint (push) Waiting to run
Lint / macOS Compatibility (push) Waiting to run
feat(sandbox): promote sandbox from --beta flag to first-class cloud (#3432)
Running an agent in a local Docker container is now a cloud target:
`spawn <agent> sandbox`, instead of `spawn <agent> local --beta sandbox`.

- Extract local orchestration into local/run.ts (runLocalAgent), shared
  by the local and sandbox clouds; add sandbox/main.ts entry point.
- Add 9 sh/sandbox/*.sh shims + README for the Docker-capable agents.
- Register the sandbox cloud and matrix entries in manifest.json.
- Remove sandbox from the --beta gate and the fast_provision experiment.
- Bump CLI to 1.1.0; update tests for the new wiring.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 06:09:04 +00:00

57 lines
2.3 KiB
Markdown

# Local Sandbox
Run agents inside a throwaway Docker container on your own machine.
> Same setup as the `local` cloud, but the agent runs in an isolated Docker container instead of directly on your host. No account or payment needed. Docker is auto-installed if missing, and the container is removed when the session ends — so the agent can't touch your host filesystem, shell, or SSH keys.
This was previously the `--beta sandbox` flag on the `local` cloud. It is now a first-class cloud.
## Quick Start
If you have the [spawn CLI](https://github.com/OpenRouterTeam/spawn) installed:
```bash
spawn claude sandbox
spawn openclaw sandbox
spawn codex sandbox
spawn opencode sandbox
spawn kilocode sandbox
spawn hermes sandbox
spawn junie sandbox
spawn cursor sandbox
spawn pi sandbox
```
Or run directly without the CLI:
```bash
bash <(curl -fsSL https://openrouter.ai/labs/spawn/sandbox/claude.sh)
bash <(curl -fsSL https://openrouter.ai/labs/spawn/sandbox/openclaw.sh)
bash <(curl -fsSL https://openrouter.ai/labs/spawn/sandbox/codex.sh)
bash <(curl -fsSL https://openrouter.ai/labs/spawn/sandbox/opencode.sh)
bash <(curl -fsSL https://openrouter.ai/labs/spawn/sandbox/kilocode.sh)
bash <(curl -fsSL https://openrouter.ai/labs/spawn/sandbox/hermes.sh)
bash <(curl -fsSL https://openrouter.ai/labs/spawn/sandbox/junie.sh)
bash <(curl -fsSL https://openrouter.ai/labs/spawn/sandbox/cursor.sh)
bash <(curl -fsSL https://openrouter.ai/labs/spawn/sandbox/pi.sh)
```
## Requirements
- **Docker** — auto-installed if missing (OrbStack on macOS, `docker.io` via apt on Linux).
- **`OPENROUTER_API_KEY`** — prompted interactively, or set in the environment.
## How it works
The `sandbox` cloud reuses the `local` orchestrator with a Docker-wrapped runner:
1. Ensure Docker is installed and running.
2. Pull the agent image `ghcr.io/openrouterteam/spawn-<agent>:latest` and start a container.
3. Inject OpenRouter credentials and write agent config files **inside the container**.
4. Drop into an interactive session via `docker exec -it`.
5. Remove the container on exit.
## Notes
- Agents that need a Docker image: `claude`, `codex`, `cursor`, `hermes`, `junie`, `kilocode`, `openclaw`, `opencode`, `pi`. The container images are built from `sh/docker/<agent>.Dockerfile`.
- For host-native execution (no container), use the [`local`](../local/README.md) cloud instead.