Skip to main content
This page gets you from zero to a working Claude Code sandbox:
  1. Set API keys
  2. Create an Identity provider + network allowlist
  3. Create a runtime from the platform claude template and smoke-test with claude -p
  4. Open an interactive shell

1. Environment

Use the platform template name claude (Claude Code is already installed). Do not omit --template — the CLI default is base-small, which does not include claude. Sandboxes block outbound traffic by default. Without a network policy that allows api.anthropic.com:443, Claude cannot reach Anthropic.

2. Create sandbox and smoke-test

The examples below create a provider, an allowlist, a runtime on claude, run a short headless prompt, then print IDs you can reuse. They leave the runtime running so you can open a shell next.
Identity secrets are injected for run_cmd / run_code. Interactive runtime shell / SSH does not get them automatically — that is why we also pass env_vars at create time.

3. Interactive shell

Inside the sandbox:
You should get the Claude Code TUI. When you are done:

Optional allowlist hosts

For a quick experiment you can use --egress-mode allow_all, then tighten. See Network policies.

Troubleshooting

Next