sandbox-sdk
sandbox sdk
What it does
- getSandbox() returns immediately - container starts lazily on first operation
- Containers sleep after 10 minutes of inactivity (configurable via sleepAfter)
- Use destroy() to immediately free resources
- Same sandboxId always returns same sandbox instance
- Don't use internal clients (CommandClient, FileClient) - use sandbox. methods
- Don't skip the Sandbox export - Worker won't deploy without export { Sandbox }
- Don't hardcode sandbox IDs for multi-user - use user/session identifiers
Requirements & configuration
- | Need | Use | Why |
- Production requirement: Preview URLs need a custom domain with wildcard DNS (.yourdomain.com). The .workers.dev domain does not support preview URL subdomains.
Derived from the skill's own SKILL.md documentation · extracted 2026-07-23
sandbox-sdk FAQ
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. getSandbox() returns immediately - container starts lazily on first operation Containers sleep after 10 minutes of inactivity (configurable via sleepAfter)
What does sandbox-sdk require?
| Need | Use | Why | Production requirement: Preview URLs need a custom domain with wildcard DNS (.yourdomain.com). The .workers.dev domain does not support preview URL subdomains.
How do I install sandbox-sdk?
Run: npx -y skills add https://github.com/cloudflare/skills --skill sandbox-sdk --agent claude-code — the source lives at github.com/cloudflare/skills.
Maintain sandbox-sdk?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[](https://getagentictools.com/skills/cloudflare-skills-sandbox-sdk?ref=badge) npx agentictools info skills/cloudflare-skills-sandbox-sdk The second line is the CLI lookup for this page — handy in READMEs and docs.