What does this skill do, and when should you use it?
This skill helps build secure, isolated execution environments on Cloudflare Workers. It covers Sandbox SDK lifecycle management, commands, files, the code interpreter, and preview URLs. Local development requires `@cloudflare/sandbox` and Docker. For Sandbox SDK work, it directs agents to retrieve current Cloudflare documentation and examples before implementing features.
Guides installation of @cloudflare/sandbox, configuration of wrangler.jsonc, and re-exporting the Sandbox class from the Worker entry point. It shows how to obtain sandboxes with getSandbox(), execute commands with exec(), run Python, JavaScript, or TypeScript with runCode(), create persistent code contexts, read and write files, create and list directories, expose ports, and destroy sandboxes. It also covers Dockerfile extensions, preview URL requirements, and integration helpers for the OpenAI Agents SDK.
- A Cloudflare Workers developer executing untrusted code can use it to build an isolated runtime.
- An AI product team building a code execution feature or interpreter can use `runCode()` with persistent contexts.
- An engineer implementing CI/CD or build pipelines can use `exec()` for exit codes and stderr capture.
- A team building an interactive development environment can combine workspace file operations, port exposure, and preview URLs.
- A developer running data analysis in a sandbox can use Python, pandas, and rich chart or table outputs.
How do you install this skill?
- Do not treat the claims of being secure or isolated as verified security boundaries; separately review networking, credentials, quotas, tenant isolation, and preview URL authentication before deployment.
- Verify the actual readFile() return type and SDK version because the supplied examples are inconsistent.
- Before executing user- or model-generated code, define confirmation, data-access, external-network, and destruction/recovery policies.
- The retrieval workflow depends on Cloudflare documentation and GitHub examples; confirm reachability from mainland-China networks and prepare an offline version if needed.
- Shell / CLI
- Network access
- Local filesystem
Node.jsDocker
Install the dependency and verify local Docker: npm install @cloudflare/sandbox, then run docker info. Copy the repository folder skills/sandbox-sdk into the skill directory used by your Agent Skills client. The README lists ~/.claude/skills/ for Claude Code, ~/.cursor/skills/ for Cursor, ~/.config/opencode/skills/ for OpenCode, ~/.codex/skills/ for OpenAI Codex, and ~/.pi/agent/skills/ for Pi.
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/cloudflare/skills.git "$tmp"
mkdir -p ~/.claude/skills
cp -R "$tmp/skills/sandbox-sdk" ~/.claude/skills/
rm -rf "$tmp"Generated from the source repository and skill path; it copies only this skill's folder. If the author's install steps above differ, follow those first. To scope it to one project, replace ~/.claude/skills with that project's .claude/skills.
How do you use this skill?
Once installed, send your agent any of these to trigger it:
- Create a Cloudflare Workers Sandbox that runs Python code and returns the result.
In an Agent Skills-compatible client, make a specific Sandbox SDK request such as: “Create a Cloudflare Workers Sandbox that runs Python code and returns the result.” Before implementation, retrieve the relevant page from https://developers.cloudflare.com/sandbox/, the API reference, or the examples. Preserve the required container, Durable Object binding, migration, and export { Sandbox } configuration.
What are this skill's strengths and limitations?
- Covers sandbox acquisition, commands, code interpretation, files, ports, and lifecycle management.
- Provides directly reusable TypeScript patterns and configuration examples.
- Uses a retrieval-first workflow to address potentially outdated SDK knowledge.
- Includes guidance for Dockerfile extensions, preview URLs, and OpenAI Agents SDK integration.
- Docker is explicitly required for local development.
- Production preview URLs require a custom domain with wildcard DNS; `workers.dev` does not support preview URL subdomains.
- The SKILL.md provides no test suite or automated verification workflow.
- Full API options and return types are delegated to reference files that are not included in the supplied material.
How does this skill compare with similar options?
Side by side with related skills; every score comes from the same FSRS standard.
| Skill | FS score | Stars | Last updated | License |
|---|---|---|---|---|
| Cloudflare Sandbox Builder this page | 46 · Use with care | ★ 3.1k | 12d ago | Apache-2.0 |
| Workers Production Review | 57 · Use with care | ★ 3.1k | 12d ago | Apache-2.0 |
| PinMe Worker OpenRouter API Integration | 64 · Recommended | ★ 3.7k | 3mo ago | MIT |
| PinMe UniwebPay Payment Integration | 60 · Recommended | ★ 3.7k | 3mo ago | MIT |
| Code Clarity Refactor | 57 · Use with care | ★ 107k | 13d ago | MIT |
How did FollowSkills review this skill?
The document explicitly targets isolated execution of untrusted code and recommends per-user or per-session sandbox IDs and cleanup. However, it does not explain network isolation, credential or environment-variable handling, sensitive-data flows, preview URL access control, user confirmation, or recovery. The irreversible impact of destroy() is also underexplained, so points are deducted.
Installation requirements, configuration, core APIs, error handling, and result-error checks are documented, making the happy path plausible. However, the quick reference describes readFile() as returning an object while an earlier example treats the result directly as file content; there is no committed test suite, compatibility matrix, or broad failure-diagnostic coverage. Under static calibration, the score is capped below 10.
Target scenarios, triggers, and main API use cases are fairly clear for AI code execution, CI/CD, and interactive development. Non-fit cases, permission boundaries, network requirements, I/O constraints, and Chinese-language support are insufficiently specified, and the retrieval-first workflow depends on external Cloudflare documentation, limiting environment-fit evidence.
The skill includes installation steps, layered references, an example index, anti-patterns, lifecycle notes, and an Apache-2.0 license. It lacks a named maintenance owner, update path, changelog, SDK version policy, known-limitations section, and systematic FAQ; the instruction to preserve an exact configuration structure also hides assumptions.
Copyable configuration, Worker export, command, interpreter, file, and port examples provide clear value for the core setup task. However, the examples have no execution evidence in the supplied files, important production safety configuration is incomplete, and API details are partly inconsistent, so the score reflects only plausible completion of the core task.
The skill supplies pinned-looking documentation, API, and example repository references plus return types and error structures, providing some traceability. Evidence is still primarily author-provided documentation, with no committed tests, CI coverage of Sandbox key paths, or independent reproduction record. Under static calibration, the score is capped below 5.
Open a dimension to read why it scored that way
Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.
See the full review method →