cloudflare

sandbox-sdk: Run Sandboxed Code on Cloudflare's Edge

Cloudflare Sandbox SDK runs untrusted or generated code in Linux sandboxes built on Cloudflare Durable Objects and Containers. It gives Workers control over sandbox ownership, network access, and credentials, with tools for files, bucket mounts, and backups.

Stars
1.2k
Forks
121
Stars, last 30 days
+15
Last commit
today
Contributors
40

Our take

Activeregular commits and releases

Health score

73/100

How it is scored
Activity
87
Community
67
Issues
52
Pull requests
84

+15 stars in the last 30 days

  • Merges more pull requests than 95% of the projects we track
  • Releases more often than 91% of the projects we track

This is a focused Cloudflare-native toolkit for teams that want to build and operate their own code-execution workflows, backed by active development and a broad contributor base.

Good fit if

  • Your application already runs on Cloudflare Workers and needs Linux Containers for generated or untrusted code.
  • You want Worker-controlled file operations, bucket access, backups, or sandbox networking rather than a turnkey execution service.
  • You can work with the Node.js and Rust toolchain and own the Durable Object logic that starts and selects sandboxes.

Look elsewhere if

  • You need a sandbox runtime that is not tied to Cloudflare Durable Objects and Containers.
  • You only need to run JavaScript or Python without a Linux environment. The README points to Cloudflare Dynamic Workers for that use case.
  • You expect this package itself to manage sandbox selection and Container lifecycle. In version 1.0, those responsibilities belong to your Durable Object.
All health signals
Last commit2026-10-29 (today)
Commits, last 90 days100+
Releases, last 12 months84 (latest @cloudflare/sandbox@1.0.3, 2026-10-22)
Contributors40 (top contributor: 46% of commits)
Issues closed, last 90 days4+ (typically closed in 5 days)
Pull requests merged, last 90 days93 (typically merged in 0 days)
Project age16 months

Checked on 2026-10-30 with the GitHub API.

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

1,166

Forks

123

Change since Nov 14, 2026: +1 stars·0 forks

Overview

Cloudflare Sandbox SDK runs untrusted or generated code in Linux sandboxes built on Cloudflare Durable Objects and Containers. A Worker chooses which user, task, or session gets a sandbox and controls what hosts it can reach, helping keep credentials out of the sandbox while running code on Cloudflare's edge network.

The SDK adds file transfer, S3-compatible bucket mounts, and directory backup and restore to the Container API. It is aimed at teams building code-execution environments and coding-agent workflows as Cloudflare Workers, rather than a standalone sandbox service.

Key Features

  • Run commands in a Linux Container started and managed by a Durable Object.
  • Stream files into and out of a running sandbox, with Linux-style errors such as ENOENT.
  • Mount S3-compatible storage while having the Worker sign requests so storage credentials stay outside the sandbox.
  • Back up directories to R2 and restore them into Containers, including Containers using a newer image.
  • Keep background processes running and expose browser terminals or web-app previews.
  • Control which hosts a sandbox can reach.
  • Provide examples for running coding agents on repositories.

Use Cases

  • A developer-platform team can execute user-submitted scripts in per-user or per-task Linux environments.
  • An AI-agent team can give coding agents a workspace for working with a repository while controlling network access.
  • A build or data-processing service can mount bucket files, run jobs, and persist workspaces for later sessions.
  • A web-development team can let users edit and preview applications inside isolated sandboxes.

What you need

Detected in the repository

  • Node.js >=24.11.0 (from package.json)
  • Rust (from Cargo.toml)
  • Automated checks on GitHub Actions

Getting Started

Create a project from the minimal template:

npm create cloudflare@latest -- my-sandbox --template=cloudflare/sandbox-sdk/examples/minimal

See the README and documentation for requirements, deployment, and examples.

License in Plain Words

No standard license was detected. Without a license, the default copyright rules apply: you may read the code, but not reuse it. Check the repository or ask the authors.

Alternatives

  • CubeSandbox: CubeSandbox runs untrusted workloads in self-hosted hardware-isolated microVMs, while sandbox-sdk uses Cloudflare Durable Objects and Containers.
  • agent-sandbox: Agent Sandbox provisions isolated, stateful workloads through Kubernetes CRDs and controllers, while sandbox-sdk targets Cloudflare Workers and Containers.
ProjectLanguageLicenseStarsStatus
sandbox-sdkTypeScript–1.2kActive
CubeSandboxGoOther12.8kActive
agent-sandboxGoApache-2.04.3kActive

Considerations

  • The project is actively maintained, with regular commits and releases, and contributions from many people rather than reliance on one primary contributor. That indicates ongoing development, but does not by itself establish production suitability for a particular workload.
  • This is not a generic container library: its core model depends on Cloudflare Workers, Durable Objects, and Cloudflare Containers.
  • The README says the Worker needs nodejs_compat and that the image needs the helper used by Files. Check the documented requirements before adopting the file operations.
  • The README identifies the project as Apache License 2.0. Review the license terms for your intended distribution and use.

Found this useful?

Share it with someone who would like sandbox-sdk.

Comparisons