# Sandbox SDK Build secure, isolated code execution environments > Links below point directly to Markdown versions of each page. Any page can also be retrieved as Markdown by sending an `Accept: text/markdown` header to the page's URL without the `index.md` suffix (for example, `curl -H "Accept: text/markdown" https://docs.ahq.lat/sandbox/`). > > For other Cloudflare products, see the [Cloudflare documentation directory](https://docs.ahq.lat/llms.txt). ## Overview - [Sandbox SDK](https://docs.ahq.lat/sandbox/index.md): Build secure, isolated code execution environments powered by Cloudflare Workers and Containers. ## Getting started - [Getting started](https://docs.ahq.lat/sandbox/get-started/index.md): Create your first Sandbox SDK Worker to execute Python code in isolated containers. ## Tutorials - [Tutorials](https://docs.ahq.lat/sandbox/tutorials/index.md): Step-by-step Sandbox SDK tutorials for building AI agents, code executors, and testing pipelines. - [Build an AI code executor](https://docs.ahq.lat/sandbox/tutorials/ai-code-executor/index.md): Use Claude to generate Python code from natural language and execute it securely in sandboxes. - [Analyze data with AI](https://docs.ahq.lat/sandbox/tutorials/analyze-data-with-ai/index.md): Upload CSV files, generate analysis code with Claude, and return visualizations. - [Automated testing pipeline](https://docs.ahq.lat/sandbox/tutorials/automated-testing-pipeline/index.md): Build a testing pipeline that clones Git repositories, installs dependencies, runs tests, and reports results. - [Run Claude Code on a Sandbox](https://docs.ahq.lat/sandbox/tutorials/claude-code/index.md): Use Claude Code to implement a task in your GitHub repository. - [Set up Claude Managed Agents](https://docs.ahq.lat/sandbox/tutorials/claude-managed-agents/index.md): Run Claude Managed Agents on self-managed Cloudflare environments. - [Build a code review bot](https://docs.ahq.lat/sandbox/tutorials/code-review-bot/index.md): Clone repositories, analyze code with Claude, and post review comments to GitHub PRs. - [Build an AI coding agent with OpenAI Agents SDK](https://docs.ahq.lat/sandbox/tutorials/openai-agents/index.md): Use the OpenAI Agents SDK with Cloudflare Sandbox to build a Python agent that writes, tests, and delivers code in an isolated environment. - [Data persistence with R2](https://docs.ahq.lat/sandbox/tutorials/persistent-storage/index.md): Mount R2 buckets as local filesystem paths to persist data across sandbox lifecycles. - [Code interpreter with Workers AI](https://docs.ahq.lat/sandbox/tutorials/workers-ai-code-interpreter/index.md): Build a code interpreter using Workers AI GPT-OSS model with the official workers-ai-provider package. ## API reference - [API reference](https://docs.ahq.lat/sandbox/api/index.md): Sandbox SDK API for executing code, managing files, running processes, and exposing services. - [Backups](https://docs.ahq.lat/sandbox/api/backups/index.md): Create point-in-time snapshots of sandbox directories and restore them with copy-on-write overlays. - [Commands](https://docs.ahq.lat/sandbox/api/commands/index.md): Execute commands and manage background processes in Sandbox SDK containers. - [File watching](https://docs.ahq.lat/sandbox/api/file-watching/index.md): Monitor sandbox filesystem changes in real-time using the Sandbox SDK watch API. - [Files](https://docs.ahq.lat/sandbox/api/files/index.md): Read, write, and manage files in the Sandbox SDK filesystem. - [Code interpreter](https://docs.ahq.lat/sandbox/api/interpreter/index.md): Execute Python, JavaScript, and TypeScript code with rich output formats in Sandbox SDK. - [Lifecycle](https://docs.ahq.lat/sandbox/api/lifecycle/index.md): Create, configure, and manage Sandbox SDK container instances and their resources. - [Ports](https://docs.ahq.lat/sandbox/api/ports/index.md): Expose sandbox services via public preview URLs using the Sandbox SDK ports API. - [Sessions](https://docs.ahq.lat/sandbox/api/sessions/index.md): Create shell sessions with independent working directories and environment variables within a sandbox. - [Storage](https://docs.ahq.lat/sandbox/api/storage/index.md): Mount S3-compatible storage buckets into the Sandbox SDK filesystem for persistent data access. - [Terminal](https://docs.ahq.lat/sandbox/api/terminal/index.md): Connect browser-based terminal UIs to sandbox shells via WebSocket. - [Tunnels](https://docs.ahq.lat/sandbox/api/tunnels/index.md): Expose sandbox services on zero-config *.trycloudflare.com URLs using the Sandbox SDK tunnels API. ## How-to guides - [How-to guides](https://docs.ahq.lat/sandbox/guides/index.md): Practical guides for solving specific tasks with the Sandbox SDK. - [Run background processes](https://docs.ahq.lat/sandbox/guides/background-processes/index.md): Start and manage long-running services and applications. - [Backup and restore](https://docs.ahq.lat/sandbox/guides/backup-restore/index.md): Create point-in-time backups and restore sandbox directories. - [Browser terminals](https://docs.ahq.lat/sandbox/guides/browser-terminals/index.md): Connect browser-based terminals to sandbox shells using xterm.js or raw WebSockets. - [Use code interpreter](https://docs.ahq.lat/sandbox/guides/code-execution/index.md): Execute Python and JavaScript code with rich outputs. - [Run Docker-in-Docker](https://docs.ahq.lat/sandbox/guides/docker-in-docker/index.md): Run Docker commands inside a sandbox container. - [Execute commands](https://docs.ahq.lat/sandbox/guides/execute-commands/index.md): Run commands with streaming output, error handling, and shell access. - [Expose services](https://docs.ahq.lat/sandbox/guides/expose-services/index.md): Create preview URLs and expose ports for web services. - [Watch filesystem changes](https://docs.ahq.lat/sandbox/guides/file-watching/index.md): Monitor files and directories in real-time to build responsive development tools and automation workflows. - [Work with Git](https://docs.ahq.lat/sandbox/guides/git-workflows/index.md): Clone repositories, manage branches, and automate Git operations. - [Manage files](https://docs.ahq.lat/sandbox/guides/manage-files/index.md): Read, write, organize, and synchronize files in the sandbox. - [Mount buckets](https://docs.ahq.lat/sandbox/guides/mount-buckets/index.md): Mount S3-compatible object storage as local filesystems for persistent data storage. - [Handle outbound traffic](https://docs.ahq.lat/sandbox/guides/outbound-traffic/index.md): Intercept and handle outbound HTTP from sandboxes using Workers. - [Deploy to production](https://docs.ahq.lat/sandbox/guides/production-deployment/index.md): Set up custom domains for preview URLs in production. - [Proxy requests to external APIs](https://docs.ahq.lat/sandbox/guides/proxy-requests/index.md): Keep credentials secure by routing sandbox requests through a Worker proxy that injects authentication at request time. - [Stream output](https://docs.ahq.lat/sandbox/guides/streaming-output/index.md): Handle real-time output from commands and processes. - [WebSocket connections](https://docs.ahq.lat/sandbox/guides/websocket-connections/index.md): Connect to WebSocket servers running in sandboxes. - [Connect to Workers bindings](https://docs.ahq.lat/sandbox/guides/workers-connections/index.md): Access KV, R2, Durable Objects, and other bindings from a sandbox. ## Concepts - [Concepts](https://docs.ahq.lat/sandbox/concepts/index.md): Learn how the Sandbox SDK works, including architecture, lifecycle, security, and sessions. - [Architecture](https://docs.ahq.lat/sandbox/concepts/architecture/index.md): Sandbox SDK combines Workers, Durable Objects, and Containers for secure code execution. - [Container runtime](https://docs.ahq.lat/sandbox/concepts/containers/index.md): Sandbox SDK containers run isolated Linux environments with Python, Node.js, and common dev tools. - [Preview URLs](https://docs.ahq.lat/sandbox/concepts/preview-urls/index.md): Sandbox SDK preview URLs provide public HTTPS access to services running inside sandboxes. - [Sandbox lifecycle](https://docs.ahq.lat/sandbox/concepts/sandboxes/index.md): Sandbox SDK sandboxes transition through running, sleeping, and destroyed states based on activity. - [Security model](https://docs.ahq.lat/sandbox/concepts/security/index.md): Sandbox SDK uses VM-level isolation, input validation, and network controls to run untrusted code safely. - [Session management](https://docs.ahq.lat/sandbox/concepts/sessions/index.md): Sandbox SDK sessions are shell execution contexts within a single sandbox. - [Terminal connections](https://docs.ahq.lat/sandbox/concepts/terminal/index.md): Sandbox SDK terminal connections stream bidirectional data between browser UIs and container shells. ## Configuration - [Configuration](https://docs.ahq.lat/sandbox/configuration/index.md): Configure Sandbox SDK deployments with Wrangler, Dockerfiles, environment variables, and transport modes. - [Dockerfile reference](https://docs.ahq.lat/sandbox/configuration/dockerfile/index.md): Customize the Sandbox SDK container image with packages, tools, and configurations. - [Environment variables](https://docs.ahq.lat/sandbox/configuration/environment-variables/index.md): Pass configuration, secrets, and runtime settings to Sandbox SDK containers using environment variables. - [Sandbox options](https://docs.ahq.lat/sandbox/configuration/sandbox-options/index.md): Configure Sandbox SDK behavior with sleep timeouts, resource limits, and container settings. - [Transport modes](https://docs.ahq.lat/sandbox/configuration/transport/index.md): Configure how Sandbox SDK communicates between Durable Objects and containers. - [Wrangler configuration](https://docs.ahq.lat/sandbox/configuration/wrangler/index.md): Set up Wrangler bindings, Durable Objects, and container settings for Sandbox SDK. ## Sandbox bridge - [Sandbox bridge](https://docs.ahq.lat/sandbox/bridge/index.md): Deploy the sandbox bridge Worker to control Cloudflare Sandboxes over HTTP from any language or platform. - [HTTP API reference](https://docs.ahq.lat/sandbox/bridge/http-api/index.md): Complete HTTP API reference for the sandbox bridge Worker. ## Platform - [Platform](https://docs.ahq.lat/sandbox/platform/index.md): Sandbox SDK platform information including pricing and resource limits. - [Limits](https://docs.ahq.lat/sandbox/platform/limits/index.md): Resource limits for Sandbox SDK including vCPU, memory, disk, and container constraints. - [Pricing](https://docs.ahq.lat/sandbox/platform/pricing/index.md): Sandbox SDK pricing is based on the underlying Containers platform usage rates.