sandbox-sdk

Installation
Summary

Secure, isolated code execution environments on Cloudflare Workers with multi-language support.

  • Provides exec() for shell commands, runCode() for LLM-generated code with state persistence, and file operations (read, write, mkdir, list)
  • Supports Python, JavaScript, and TypeScript with a base image including Python 3.11, Node.js 20, and common tools; extend via Dockerfile for additional dependencies
  • Includes code interpreter contexts for data analysis workflows, port exposure for HTTP services, and lazy container startup with automatic sleep after 10 minutes of inactivity
  • Requires Docker for local development, wrangler.jsonc configuration with Durable Objects bindings, and explicit Sandbox class re-export in Worker entry point
SKILL.md

Cloudflare Sandbox SDK

Build secure, isolated code execution environments on Cloudflare Workers.

FIRST: Verify Installation

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/
Related skills

More from cloudflare/skills

Installs
6.4K
GitHub Stars
1.5K
First Seen
Feb 5, 2026