Sandbox SDK

One TypeScript API to run commands, edit files and serve previews on 11 cloud sandbox providers or local Docker.

Stars
★ 117
Last updated
1d ago
License
MIT
Primary language
TypeScript

At a glance

How it runs
Library / SDK
Works with
Universal · cross-platform
Cost
Free software; you pay for model usage
Setup effort
Low · running in minutes
You'll need
Node.js 22+ or Bun 1.3+Provider SDK (optional peer, e.g. e2b)Docker (only for the local provider)Shell / CLINetwork accessLocal filesystem
Typical use
Teams giving coding agents an isolated place to work: pair sandboxTools with the AI SDK so the model runs tests and fixes the first failure.
Not a fit if
  • Teams that want a ready-made hosted service or GUI
  • Environments that cannot install any provider SDK
  • Projects whose backend is not TypeScript/Node
Website
sandbox-sdk.app ↗ set on GitHub
Maintenance
Commits in the last 30 dayslast commit 2026-11-20latest release @opencoredev/[email protected] (2026-11-20)+0.6 ★/day over 7 days
Source review
63/100 · Some gaps

What does this agent do, and when should you use it?

Sandbox SDK is an MIT-licensed TypeScript library from OpenCore that collapses sandbox creation, command execution, file editing, dev-server startup, preview URLs, git clone/commit/push, pause and snapshot into a single createSandbox() surface. The core package is @opencoredev/sandbox-sdk; each backend ships as a subpath export (/e2b, /daytona, /vercel, /upstash, /railway, /tenki, /freestyle, /local and more), so switching providers means changing one import, and each vendor SDK is an optional peer you install only when used. A memory() in-process fake sandbox lets you try the API and write tests without an account, and runConformance validates custom Provider implementations. sandboxTools exposes the same sandbox as tools for the AI SDK, Mastra and the OpenAI Agents SDK, with registered secrets kept out of model context. Execution happens inside your own server-side code; the provider creates the sandbox and its own rules govern preview ports.

createSandbox(provider, { key }) creates or reconnects to a sandbox for the chosen provider; await using deletes keyless sandboxes at scope exit or calls close() when a key is present, leaving the box running until you call destroy(). Commands run via box.run("npm test") or `box.$git checkout ${branch} with output streaming and timeouts; a non-zero exit resolves as ok: false instead of throwing. Files are handled by box.files.write()/read()/edit()/search()/upload(). box.start("npm run dev", { ready: { port: 3000 } }) boots a server and waits until the port answers, and box.preview(3000) returns a URL. box.git.clone()/commit()/push() perform repository operations without leaking tokens. box.pause()/resume()/snapshot() work only on providers that support them, and TypeScript types reflect which do. Every failure is a SandboxError with a branchable code. sandboxTools(box, { root }) turns the box into callable run, read_file, write_file, edit_file` and background-process tools for a model.

  1. Teams giving coding agents an isolated place to work: pair sandboxTools with the AI SDK so the model runs tests and fixes the first failure.
  2. Projects already on E2B that worry about lock-in: keep business code unchanged while migrating provider by provider or A/B testing backends.
  3. Backends that must hand users live preview links, such as online IDEs or low-code builders: start a dev server with box.start and read the URL from box.preview.
  4. CI or integration suites needing a real Linux box: exercise the API against memory() first, then validate on E2B or local Docker.
  5. Teams that want self-hosted isolation: use the /local provider to run commands in Docker on their own machine with no cloud account.
  6. Engineers evaluating multiple sandbox vendors: the repo includes a bench harness and runConformance for capability checks.
  7. Scenarios needing scripted git work without exposing credentials: use box.git.clone()/commit()/push() in place of raw shell git.

Key setup facts

Pulled from the install and usage notes below. The project README has the current values.

Install / run
  • npm install @opencoredev/sandbox-sdk
  • npm install e2b
  • npm install ai zod e2b
Environment variables
E2B_API_KEY AI_GATEWAY_API_KEY
Runtime
Node.js 22+ · Bun 1.3+
Install notes cover
Linux · Docker

How do you install or deploy this agent?

Requires Node.js 22+ or Bun 1.3+ at runtime. Install the core package plus only the vendor SDKs you actually use.

npm install @opencoredev/sandbox-sdk
npm install e2b

If you only want to try the API, the memory() provider needs no account, no Docker and no extra dependency. For local container execution, install the core package alone and make sure Docker is running:

npm install @opencoredev/sandbox-sdk

How do you use this agent?

Start with the in-memory fake sandbox — no credentials required:

import { createSandbox } from "@opencoredev/sandbox-sdk";
import { memory } from "@opencoredev/sandbox-sdk/memory";

await using box = await createSandbox(memory());

await box.files.write("hello.txt", "hello from the sandbox\n");
const result = await box.run("cat hello.txt");
console.log(result.ok, result.stdout); // true "hello from the sandbox\n"

For a real Linux machine, swap the provider; E2B reads E2B_API_KEY from the environment:

import { createSandbox } from "@opencoredev/sandbox-sdk";
import { e2b } from "@opencoredev/sandbox-sdk/e2b";

// Reads E2B_API_KEY from the environment. Run `npm install e2b` first.
await using box = await createSandbox(e2b());

await box.files.write("hello.py", "print('hello from the sandbox')");
const result = await box.run("python3 hello.py");
console.log(result.stdout); // "hello from the sandbox\n"

To hand it to an agent, also install the AI SDK, zod and the provider package, and set AI_GATEWAY_API_KEY plus E2B_API_KEY on your server:

npm install ai zod e2b
import { generateText, stepCountIs } from "ai";
import { createSandbox } from "@opencoredev/sandbox-sdk";
import { sandboxTools } from "@opencoredev/sandbox-sdk/ai";
import { e2b } from "@opencoredev/sandbox-sdk/e2b";

await using box = await createSandbox(e2b());
await box.git.clone("https://github.com/opencoredev/sandbox-sdk", { dir: "app", depth: 1 });

const { text } = await generateText({
  model: "anthropic/claude-opus-5-5",
  tools: sandboxTools(box, { root: "/workspace/app" }),
  stopWhen: stepCountIs(20),
  prompt: "Run the tests and fix the first failure.",
});

To find the same sandbox on a later request, pass a key at creation:

await using box = await createSandbox(e2b(), { key: "user:123" });

For your own backend, implement the Provider interface from @opencoredev/sandbox-sdk/provider and validate it with runConformance from @opencoredev/sandbox-sdk/testing. Upgrading from 0.2 is a breaking change; follow the official upgrade-from-0-2 guide step by step.

What are this agent's strengths and limitations?

Pros
  • One interface spans 11 cloud providers plus local Docker, and switching backends is a single import change — strong protection against sandbox vendor lock-in.
  • memory() gives a fake sandbox for development and tests with no account, key or Docker, so the first working API call is minutes away.
  • await using plus SandboxError with a code makes lifecycle cleanup and error branching language-level conventions, and non-zero exits resolve as ok: false rather than throwing.
  • sandboxTools plugs directly into the AI SDK, Mastra and the OpenAI Agents SDK, with registered secrets kept out of model context.
  • Ships runConformance and a bench harness, which helps when writing a custom provider or comparing vendors.
  • Vendor SDKs are optional peers, so you never pull in dependencies for backends you do not use.
Limitations
  • The 0.2 to 1.0 jump is a breaking API change, so existing code must be rewritten per the migration guide.
  • Capabilities are not uniform: pause, resume and snapshot exist only on some providers, so cross-backend ports need feature checks.
  • Every real provider demands its own vendor SDK and credentials, which compounds dependency and secret management in multi-backend setups.
  • Server-side TypeScript only, with Node.js 22+ or Bun 1.3+ required, so non-JS backends cannot use it directly.
  • Preview URL rules, credential handling and limits are provider-defined, forcing you into each vendor's documentation.

How does this agent compare with similar options?

The README positions E2B, Daytona, Vercel Sandbox, Upstash Box, Railway, Tenki, Freestyle and local Docker as interchangeable backends, and discusses self-hosting E2B (E2B Embed) versus Docker. It is a unifying abstraction over those vendor SDKs rather than a replacement for any single sandbox product.

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
Sandbox SDK This agent 63 · Some gaps Library / SDKFree + model costs ★ 117 1d ago TypeScript —
Judge0 Online Code Execution System 52 · Major gaps Self-hosted serviceFreemium ★ 4.5k 26d ago HTML —
Capsule Sandbox Runtime 54 · Major gaps CLIFree ★ 304 1mo ago Rust —
AI SDK 54 · Major gaps Library / SDKFree + model costs ★ 28k today TypeScript OpenAI API · Claude API

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Some gaps
63/ 100 5-point scale 3.2 / 5
This review covers the source as of Nov 11, 2026. The project has shipped 2 stable release(s) since, which have not been re-reviewed. The score and verdict describe the reviewed version only. Recent releases ↓
Trust 16/29
Reliability 9/14
Adaptability 14/18
Convention 11/18
Effectiveness 9/13
Verifiability 4/8
Why each dimension lost points
Trust16 / 29 · 2.8/5

least_privilege: createSandbox pre-validates size/network/snapshot capabilities and SECURITY.md states Local denies outbound networking and host bindings by default — solid permission narrowing (2). user_confirmation: no user-facing confirmation flow exists; only the bench harness has a --yes budget gate, so the product layer is absent (1). data_flow_transparency: SECURITY.md states no telemetry and forbids logging commands/files/keys; Redactor and preview-token handling are documented (2). sensitive_data_handling: secrets go through Redactor, preview headers are stripped, and callers are warned about logging causes, but no key rotation or audit logging is implemented (2). dependency_security: CI pins action SHAs and uses frozen lockfiles, but root package.json uses caret ranges and no SCA/audit step is visible (1). external_effects: create/destroy/abort paths explicitly destroy late sandboxes and stop() is idempotent, though real cloud side effects depend on the provider (2). rollback: abort destroys late-arriving sandboxes, stop is idempotent, withSandbox preserves the original error — clear recovery semantics (2). source_attribution: MIT and OpenCore attribution are clear, but the publisher is unverified and README vs SKILL.md disagree on provider list and API shape, weakening traceability (1).

Reliability9 / 14 · 3.2/5

self_consistency: README uses createSandbox(e2b()) and createSandbox(memory()) while SKILL.md uses createSandbox({ provider: local() }), and the provider lists (Ascii Box, Superserve, Boat) differ from the README table — a substantive contradiction (1). dependency_availability: provider SDKs are optional peers with per-provider install names and Node 22+/Bun 1.3+ is stated, but root engines says >=24, conflicting with the README (2). failure_messages: SandboxError carries a code and validate() emits specific actionable messages such as 'Creation refused. Provider cannot enforce size.' — a standout (3).

Adaptability14 / 18 · 3.9/5

audience_and_scenarios: targets server-side TypeScript developers and agent integrations, covering many providers, Docker, and a memory fake for tests (2). capability_boundaries: the capabilities set, hasCapability type narrowing, requireCapability, and validate() rejecting unsupported operations make boundaries very explicit (3). trigger_precision: the SKILL.md description gives clear trigger conditions, but docs must be fetched from llms.txt, so in-packet trigger information is limited (2). environment_fit: fits Node/Bun, Docker, and multiple clouds, but the Node version conflict and the beta AgentOS dependency add uncertainty (2).

Convention11 / 18 · 3.1/5

information_architecture: README has install, quickstart, capability table, provider table, and repo layout — clear, though the AGENTS.md 1.0-rewrite branch coexisting with the docs site muddies the hierarchy (2). install_notes: npm install, peer dependencies, and Node/Bun versions are documented, but the version requirements contradict each other (2). naming_stability: README flags 1.0 breaking changes and SKILL.md vs README disagree on API shape, so naming stability is questionable (1). examples_and_faq: quickstart, agent-tools example, examples directory, and blog guides exist, but there is no formal FAQ (2). known_limitations: EARLY_ACCESS.md is referenced, SECURITY.md explicitly lists what is not secured, and provider docs note limits (2). license: full MIT text with a clear copyright holder (3). versioning_changelog: a CHANGELOG link, changeset workflow, and CI-enforced changesets exist, but no actual changelog content is in the packet (2). maintenance_responsibility: SECURITY.md contact, RELEASING.md, and an issue channel exist, but the publisher is unverified and maintainer identity is unclear (1).

Effectiveness9 / 13 · 3.5/5

output_usability: the API returns structured RunResult (ok/stdout) and SandboxError with a code, directly consumable (2). marginal_value: a unified multi-provider abstraction has real value, but similar sandbox abstractions already exist, limiting differentiation (2). cost_benefit: optional peer deps, a memory fake for tests, and a bundle-size check show cost awareness, though maintaining many adapters is expensive (2).

Verifiability4 / 8 · 2.5/5

claim_traceability: README claims 11 providers and 'change one import', but SKILL.md lists a different set and several providers lack doc links, so claims are hard to trace individually (1). cross_source_corroboration: README, SKILL.md, docs/providers/sandboxer.md, and source disagree on provider set and API signature, so cross-source corroboration is weak (1). fact_inference_separation: SECURITY.md clearly separates 'SDK does not provide isolation' from provider boundaries, and docs are restrained about capabilities vs limits (2).

Risks and how to mitigate them
  • README and SKILL.md disagree on the createSandbox call shape and the provider list; verify against source and docs/spec.md rather than copying examples verbatim.
  • Root package.json requires Node >=24 while the README says Node 22+; confirm your runtime before deploying.
  • SECURITY.md states the SDK provides no execution isolation — the security boundary is entirely the chosen provider, and Local relies on a beta AgentOS unsuitable for untrusted workloads.
  • The publisher is unverified and AGENTS.md points at a 1.0 rewrite branch, so the current API may be unstable.
  • This is a static source review; no code or tests were executed, so bench and CI pass status is unknown.
Evidence confidence: Low Reviewed Nov 11, 2026 Reviewed revision c0be02db3068 New commits since this review; the score may not cover them
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/sandbox-sdk.svg)](https://followagents.com/en/agents/sandbox-sdk)
<a href="https://followagents.com/en/agents/sandbox-sdk"><img src="https://followagents.com/badge/sandbox-sdk.svg" alt="FARS review"></a>

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. Release notes excerpt
    Minor Changes - 9b43183: Add the Beam provider, beam() from @opencoredev/sandbox-sdk/beam. It runs Beam Sandboxes through Beam's official @beamcloud/beam-js SDK (1.1.6 or later), an optional peer. It supports commands, files (files over Beam's gateway limits move in pieces), listing and reconnect, public preview URLs, memory snapshots and restore, and size presets (small 1 vCPU / 2048 MiB, medium 2 / 4096, large 4 / 8192) and exact sizes in whole vCPUs and MiB. With no size, a sandbox gets Beam's own default of 1 vCPU and 128 MiB. Keys are best-effort, stored in a marker file in …
    View on GitHub ↗
  2. Release notes excerpt
    Minor Changes - 62bd329: Add the Baseten provider, baseten() from @opencoredev/sandbox-sdk/baseten. It runs Baseten Sandboxes through Baseten's official @basetenlabs/sandbox SDK (0.5.0), an optional peer. Keys are exact (unique sandbox names). It supports size presets and the exact sizes 1 vCPU / 2048 MiB, 2 / 4096 and 4 / 8192 (Baseten sets CPU from memory), timeoutMs and idleTimeoutMs as Baseten lifecycle policies, public preview URLs without declared ports, and a volume option that creates, mounts and deletes a volume per sandbox, for workspaces too large to keep in memor …
    View on GitHub ↗
  3. Release notes excerpt
    Patch Changes - 83ff7b9: Commands add less overhead on top of each provider's own SDK. Freestyle and Superserve keep one guest supervisor per sandbox instead of starting Python for every command. boxd, Freestyle, Superserve and Tenki supervisors start faster. E2B and Upstash no longer wrap each command in an activity script; reapSandboxes({ idleOnly: true }) finds running commands by scanning for the SANDBOX_SDK_RUN=1 tag instead, and still treats a sandbox it can't inspect as busy. On E2B and Upstash, files.edit takes one call and changes the file the way that provider's own write …
    View on GitHub ↗

FAQ

Do I have to pay to use the SDK?
The SDK itself is MIT-licensed and free. Every cloud provider except memory() and local Docker needs that vendor's account and key, and you pay that vendor on its own terms.
Can I try it without any cloud account?
Yes. memory() is an in-process fake sandbox needing no account or Docker — good for exploring the API and writing tests. Switch to E2B or local Docker when you need a real Linux box.
How much code changes if I switch sandbox vendors?
The README says only the provider import changes. Pause, resume and snapshot remain conditional on provider support, and the TypeScript types mark which backends offer them, so assess those gaps before porting.
When is a sandbox destroyed?
A sandbox created without a key is deleted when the await using scope ends, even if your code throws. With a key, only close() runs and the sandbox keeps running until you call destroy().
Can I plug in my own sandbox backend?
Yes. Implement the Provider interface from @opencoredev/sandbox-sdk/provider and check it with runConformance from @opencoredev/sandbox-sdk/testing.
Is Sandbox SDK open source?
Yes. The source code is on GitHub (opencoredev/sandbox-sdk) under the MIT licence.
Is Sandbox SDK still maintained?
Yes. The latest commit on GitHub is from 2026-11-20, within the last 30 days. The latest release is @opencoredev/[email protected] (2026-11-20).
Who makes Sandbox SDK?
Sandbox SDK is published on GitHub by the account opencoredev. FollowAgents has not verified which person or company is behind that account.
What is Sandbox SDK's official website?
The project's GitHub repository lists https://sandbox-sdk.app as its website. That link is set by the repository owner; the source code itself is on GitHub (opencoredev/sandbox-sdk).
Was this page helpful?
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts