sandbox-sdk
Build sandboxed applications for secure code execution. Load when building AI code execution, code interpreters, CI/CD systems, interactive dev environments, or executing untrusted code. Covers Sandbox SDK lifecycle, commands, files, code interpreter, and preview URLs. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
npx skills add cloudflare/skills --skill sandbox-sdk --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Cloudflare Sandbox SDK Build secure, isolated code execution environments on Cloudflare Workers. ## FIRST: Verify Installation ```bash npm install @cloudflare/sandbox docker info # Must succeed - Docker required for local dev ``` ## Retrieval Sources Your knowledge of the Sandbox SDK may be outdated. **Prefer retrieval over pre-training** for any Sandbox SDK task. | Resource | URL | |----------|-----| | Docs | https://developers.cloudflare.com/sandbox/ | | API Reference | https://developers.cloudflare.com/sandbox/api/ | | Examples | https://github.com/cloudflare/sandbox-sdk/tree/main/examples | | Get Started | https://developers.cloudflare.com/sandbox/get-started/ | When implementing features, fetch the relevant doc page or example first. ## Required Configuration **wrangler.jsonc** (exact - do not modify structure): ```jsonc { "containers": [{ "class_name": "Sandbox", "image": "./Dockerfile", "instance_type": "lite", "max_instances": 1 }], "durable_objects": { "bindings": [{ "class_name": "Sandbox", "name": "Sandbox" }] }, "migrations": [{ "new_sqlite_classes": ["Sandbox"], "tag": "v1" }] } ``` **Worker entry** - must re-export Sandbox class: ```typescript import { getSandbox }
- FIRST: Verify Installation
- Retrieval Sources
- Required Configuration
- Quick Reference
- Core Patterns
- Execute Commands
- Code Interpreter (Recommended for AI)
- File Operations
- When to Use What
- Extending the Dockerfile
- Preview URLs (Port Exposure)
- OpenAI Agents SDK Integration
- Sandbox Lifecycle
- Anti-Patterns
npm install @cloudflare/sandbox docker info # Must succeed - Docker required for local dev
What does the sandbox-sdk skill do?
Build sandboxed applications for secure code execution. Load when building AI code execution, code interpreters, CI/CD systems, interactive dev environments, or executing untrusted code. Covers Sandbox SDK lifecycle, commands, files, code interpreter, and preview URLs. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
How do I install it?
Run `npx skills add cloudflare/skills --skill sandbox-sdk --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From cloudflare/skills, a repository with 2,539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.