Dev & Engineering

Cloudflare Sandbox Builder

Guides agents in building secure, isolated code execution on Cloudflare Workers.

46/ 100
Use with care

Useful, but reliability, evidence or controls still have material gaps.

See how it was scored ↓
Works as-is in
Codex · Claude Code
Stars
★ 3.1k
Last updated
12d ago
License
Apache-2.0
cloudflare-workerssandboxed-executioncode-interpreterdocker
+3typescriptpythonpreview-urls

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.

Good fit
  • 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?

Before you use it
  • 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.
Before you start
Your agent needs
  • Shell / CLI
  • Network access
  • Local filesystem
Install first
  • Node.js
  • Docker

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.

Generic route: install into Claude Code manually (macOS / Linux)
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?

Try saying

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?

Pros
  • 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.
Limitations
  • 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?

FollowSkills review · FSRS-2.0
Use with care
46/ 100 5-point scale 2.3 / 5
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
1Trust12 / 25 · 2.4/5

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.

2Reliability8 / 20 · 2.0/5

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.

3Adaptability8 / 15 · 2.7/5

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.

4Convention8 / 15 · 2.7/5

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.

5Effectiveness6 / 15 · 2.0/5

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.

6Verifiability4 / 10 · 2.0/5

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.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 20, 2026 Reviewed revision 70215303d44a Review evidence[1][2][3][4][5][6]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

FAQ

Is this a good fit for a Cloudflare Workers project that does not execute code?
Probably not. Its scope is the Sandbox SDK, isolated execution, code interpretation, file operations, and service previews.
What is required for local development?
Install `@cloudflare/sandbox` and ensure `docker info` succeeds. The base image includes Python 3.11, Node.js 20, and common tools.
How should a multi-user application identify sandboxes?
Do not hardcode sandbox IDs. Use user or session identifiers, such as `getSandbox(env.Sandbox, 'user-123')`.
How are temporary sandbox resources released?
Call `destroy()` to release resources immediately. Containers also sleep after 10 minutes of inactivity, configurable with `sleepAfter`.

More skills from this repository

All from cloudflare/skills

Dev & Engineering

Workers Production Review

Write and review production-ready Workers code using current Cloudflare guidance.

★ 3.1k FS 57 Use with care 12d ago
Dev & Engineering

Cloudflare Agents SDK Builder

Guides developers in building stateful, real-time, and durable AI agents on Cloudflare Workers.

★ 3.1k FS 49 Use with care 12d ago
Dev & Engineering

Cloudflare Wrangler Deployment Guide

Helps agents reliably build, develop, deploy, and manage Cloudflare Workers with Wrangler.

★ 3.1k FS 49 Use with care 12d ago
Dev & Engineering

Cloudflare Platform Builder

Helps agents research and build applications on Cloudflare.

★ 3.1k FS 45 Not recommended 12d ago
Dev & Engineering

Cloudflare Email Service Skill

Guides agents through implementing transactional email sending, receiving, and routing on Cloudflare.

★ 3.1k FS 52 Use with care 12d ago
Dev & Engineering

Cloudflare Durable Objects Builder

Build and review stateful coordination applications on Cloudflare.

★ 3.1k FS 48 Use with care 12d ago
Automation & Ops

Cloudflare One Migration Planner

Turns Zscaler, Palo Alto, legacy VPN, SWG, or SASE migrations into verifiable Cloudflare One plans.

★ 3.1k FS 58 Recommended 12d ago
Automation & Ops

Cloudflare One Zero Trust Advisor

Guides agents through designing, configuring, and troubleshooting Cloudflare One.

★ 3.1k FS 55 Use with care 12d ago
Dev & Engineering

Turnstile End-to-End Setup

Adds Cloudflare Turnstile to existing forms with frontend embedding, backend verification, and validation.

★ 3.1k FS 54 Use with care 12d ago
Dev & Engineering

Web Performance Auditor

Use Chrome DevTools MCP to diagnose page-load performance, Core Web Vitals, and accessibility gaps.

★ 3.1k FS 43 Not recommended 12d ago

Related skills