cloudflare-sandbox

Execute untrusted code in isolated Linux containers via Cloudflare Workers and Durable Objects.

16|7|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/jackspace/ClaudeSkillz --skill cloudflare-sandbox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-sandbox
Source: https://github.com/jackspace/ClaudeSkillz/tree/main/skills/cloudflare-sandbox
Command: npx skills add https://github.com/jackspace/ClaudeSkillz --skill cloudflare-sandbox

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill explains Cloudflare Sandboxes architecture and patterns for secure, isolated code execution at the edge with stateful sessions.

Core Features & Use Cases

  • 3-layer architecture (Worker, Durable Object, Container)
  • Sessions, persistence, and session management
  • Git operations, CI/CD, and ephemeral containers
  • Error prevention patterns and migrations

Quick Start

Install the Cloudflare Sandboxes SDK, create a sandbox, and run a simple script.

Frequently Asked Questions about cloudflare-sandbox

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely execute untrusted code at the edge?

Cloudflare Sandboxes provide isolated Linux containers for secure code execution at the edge. You create a sandbox session via the getSandbox API, execute code using sandbox.exec, and maintain state across commands within ephemeral Ubuntu containers running on Cloudflare Workers and Durable Objects.

Can I run Python and Node.js scripts in isolated containers?

Yes. Sandboxes execute Python, Node.js, shell commands, and Git operations inside isolated Ubuntu containers with full filesystem access under /workspace, /tmp, and /home directories, plus proper exit-code handling for error detection.

How do I manage sessions and state across multiple sandbox commands?

Sessions persist state between consecutive sandbox.exec calls within a single container instance. The 3-layer architecture—Worker, Durable Object, Container—handles session management, ensuring data and environment variables survive across command sequences until the session expires.

What's the best way to run CI/CD pipelines and Git operations in ephemeral containers?

Use Sandboxes to run Git operations, build scripts, and CI/CD commands in ephemeral Ubuntu containers integrated with Cloudflare Workers. Each sandbox provides isolated execution with proper migrations and exit-code handling to track success and failures reliably.

Can I use Sandboxes for AI code interpreters and dynamic code execution?

Yes. Sandboxes support AI code interpreter scenarios where untrusted generated code must execute safely. The isolation prevents malicious or buggy code from affecting the host, making it ideal for dynamic execution alongside Workers and Durable Objects.

What limitations should I know before implementing edge sandboxes?

Sandboxes are ephemeral—containers terminate after use. Plan for session timeouts, manage large file operations within /workspace constraints, and account for container startup latency. Migrations and proper exit-code patterns prevent data loss and execution errors.