# sbox SDK > One unified TypeScript SDK for agent sandbox providers (E2B, Vercel, Cloudflare, and a built-in in-memory provider). One namespaced API, capability gating, a single error taxonomy, a typed escape hatch, and a plugin system that exposes sandbox tools to AI agent frameworks. ## General - [Errors](https://sbox-sdk.vercel.app/llms.mdx/general/errors): Every provider normalizes to one SandboxError taxonomy — a small set of codes, a retryable flag, and the native error preserved on cause. - [Escape hatch](https://sbox-sdk.vercel.app/llms.mdx/general/escape-hatch): Drop down to the native, per-adapter client for any provider feature outside the unified surface — fully typed, no casting. - [Installation](https://sbox-sdk.vercel.app/llms.mdx/general/installation): Install sbox-sdk and the optional peer dependency for the adapter you're using — nothing else is bundled. - [Lifecycle](https://sbox-sdk.vercel.app/llms.mdx/general/lifecycle): Idle timeouts, max age, pause/resume, reconnecting after a restart, get-or-create by name, fork and snapshots. - [llms.txt](https://sbox-sdk.vercel.app/llms.mdx/general/llms-txt): The docs are available as plain markdown for LLMs — an llms.txt index, a full-text bundle, and any page as markdown. Feed them to ChatGPT, Claude, Cursor, or your own agent. - [Migrating to 0.1](https://sbox-sdk.vercel.app/llms.mdx/general/migration-0-1): What changed between sbox-sdk 0.0.x and 0.1, and how to update. - [Network & secrets](https://sbox-sdk.vercel.app/llms.mdx/general/network): Egress allow/deny policies, credential injection that never exposes secrets to the sandbox, and SSH access. - [Overview](https://sbox-sdk.vercel.app/llms.mdx/general/overview): sbox SDK is a unified TypeScript API for agent sandbox providers — one namespaced surface, capability gating, a single error taxonomy, and a typed escape hatch. - [Previews & browser access](https://sbox-sdk.vercel.app/llms.mdx/general/previews): Expose a sandbox port as https/wss URLs, choose public or private access, and open private previews from a browser (including WebSockets). - [Retries & fallback](https://sbox-sdk.vercel.app/llms.mdx/general/retries): The client retries retryable failures with backoff and can fall back across providers — guarded by an idempotency key so a retry never orphans a second sandbox. - [Skills](https://sbox-sdk.vercel.app/llms.mdx/general/skills): Install the sbox-sdk agent skill so coding agents (Claude Code, Cursor, Codex, Copilot) can set up and use sbox correctly — or paste the setup prompt directly. - [Anonymous usage data](https://sbox-sdk.vercel.app/llms.mdx/general/telemetry): sbox SDK collects limited anonymous usage data to understand adoption and improve the SDK. - [Templates](https://sbox-sdk.vercel.app/llms.mdx/general/templates): Build a reusable base image from a Dockerfile, an image or a snapshot, in your own provider account, cached by content hash. - [Terminals (PTY)](https://sbox-sdk.vercel.app/llms.mdx/general/terminals): Interactive pseudo-terminal sessions with resize, reconnect and exit codes. - [Usage](https://sbox-sdk.vercel.app/llms.mdx/general/usage): Construct a client, create a sandbox, and run the core namespaces — commands, files, code, ports, and lifecycle. - [Capability graph](https://sbox-sdk.vercel.app/llms.mdx/general/capabilities/graph): One static table per adapter drives compile-time gating, a runtime read-model, and fail-fast errors. Every capability, every provider — declared. - [Capabilities](https://sbox-sdk.vercel.app/llms.mdx/general/capabilities): Each provider declares a static capability table. It drives compile-time type gating, a runtime read-model, and fail-fast errors before any network call. ## Adapters - [AWS Lambda MicroVMs](https://sbox-sdk.vercel.app/llms.mdx/adapters/aws-lambda): Firecracker-based serverless sandboxes with suspend/resume and idle policies. Control plane via @aws-sdk/client-lambda-microvms; a small runner baked into the image handles exec and files. - [Beam Cloud](https://sbox-sdk.vercel.app/llms.mdx/adapters/beam): A sandbox per Beam Cloud container. GPU-capable sandboxes with native streaming exec, processes, filesystem, egress control, brokered secrets, memory snapshots and image builds, via @beamcloud/beam-js. - [Blaxel](https://sbox-sdk.vercel.app/llms.mdx/adapters/blaxel): Perpetual sandboxes that drop into standby when idle and resume with memory intact. Native streaming exec, snapshots, fork, egress control, private previews and image builds, via @blaxel/core. - [Cloudflare Sandbox](https://sbox-sdk.vercel.app/llms.mdx/adapters/cloudflare): Cloudflare Sandbox SDK 0.12 through a Worker / Durable Object binding. Deprecated; a 1.0 adapter is planned. - [CodeSandbox](https://sbox-sdk.vercel.app/llms.mdx/adapters/codesandbox): Deprecated: CodeSandbox sandboxes are now Together Sandbox. Use sbox-sdk/together. This adapter is removed in 0.2.0. - [Daytona](https://sbox-sdk.vercel.app/llms.mdx/adapters/daytona): Full-featured Daytona sandboxes through the stable v0 surface of @daytona/sdk. Streaming exec, PTY, code interpreter with stateful Python kernels, pause/stop, snapshots, fork, SSH, egress allow lists, vault secrets, volumes, metrics, browser-safe signed previews, and Dockerfile template builds. - [Docker](https://sbox-sdk.vercel.app/llms.mdx/adapters/docker): Local containers through the Docker Engine API, with no npm dependency. Works with OrbStack, Docker Desktop, Colima, Rancher Desktop and Podman. Streaming exec with stdin, a PTY, pause/resume, commit-based snapshots and forks, Dockerfile template builds, volumes and published ports. - [E2B](https://sbox-sdk.vercel.app/llms.mdx/adapters/e2b): The reference cloud adapter. Code interpreter, memory pause/resume, memory or filesystem snapshots, fork, PTY, egress rules with secret injection, volumes, and Dockerfile template builds. Backed by @e2b/code-interpreter. - [Fly Machines](https://sbox-sdk.vercel.app/llms.mdx/adapters/fly): A sandbox per Fly Machine over the Machines REST API. Pure fetch, no SDK, so it runs anywhere the core does, including the edge. - [Freestyle](https://sbox-sdk.vercel.app/llms.mdx/adapters/freestyle): Full Linux KVM VMs from Freestyle through the freestyle SDK. Exec, reattachable PTY sessions, files readable while paused, pause/resume with memory, memory+disk snapshots and fork, style.dev preview domains, allow-only firewall plus TLS egress with header injection, SSH, and snapshot templates (with an emulated Dockerfile build). - [In-Memory](https://sbox-sdk.vercel.app/llms.mdx/adapters/memory): An in-memory sandbox backed by Maps — the zero-config default and the conformance fixture. No dependencies, no network, non-persistent. Ideal for tests. - [Modal](https://sbox-sdk.vercel.app/llms.mdx/adapters/modal): Modal sandboxes with streaming exec, first-class GPU, native file API and watch, PTY, filesystem snapshots, egress allow lists with header injection, secrets, volumes, regions, browser-safe connect-token previews, and private image builds. Backed by the modal JS SDK (≥ 0.11). - [Morph](https://sbox-sdk.vercel.app/llms.mdx/adapters/morph): A sandbox per Morph Cloud instance. Snapshot-first VMs with pause/resume, instant branching and cached setup chains, via the morphcloud SDK. - [Northflank](https://sbox-sdk.vercel.app/llms.mdx/adapters/northflank): A sandbox per Northflank deployment service, driven through @northflank/js-client. Streaming exec, PTYs, container snapshots, GPUs and metrics. - [Railway](https://sbox-sdk.vercel.app/llms.mdx/adapters/railway): Isolated Debian Linux VMs on Railway, with streaming exec, real kill, background sessions you can reattach to, native files, checkpoints, forks and preview domains. - [Runloop](https://sbox-sdk.vercel.app/llms.mdx/adapters/runloop): Deprecated: a sandbox per Runloop devbox, via @runloop/api-client. Runloop ended customer support on 2026-11-13. - [Fly Sprites](https://sbox-sdk.vercel.app/llms.mdx/adapters/sprites): Named, persistent Firecracker VMs on Fly.io that pause on their own when idle. Streamed exec, detachable TTY sessions, native files, filesystem checkpoints and DNS egress policy, via @fly/sprites. - [Superserve](https://sbox-sdk.vercel.app/llms.mdx/adapters/superserve): Firecracker microVMs from Superserve (Apache-2.0 core) through @superserve/sdk. Streamed exec over WebSockets, background processes with stdin, pause/resume with memory, memory+disk snapshots and fork, per-port public or token-auth previews, egress allow/deny lists, stand-in-token secrets, volumes, and Dockerfile/image template builds. - [Tensorlake](https://sbox-sdk.vercel.app/llms.mdx/adapters/tensorlake): Firecracker / Cloud Hypervisor microVMs with streamed exec, PTYs, memory snapshots, fork, suspend/resume, versioned volumes, egress control and GPUs, over Tensorlake's HTTP API. - [Together Sandbox](https://sbox-sdk.vercel.app/llms.mdx/adapters/together): Firecracker VMs booted from snapshots on Together AI (the successor to CodeSandbox). Remote Dockerfile builds, streamed execs, PTY, and hibernate/resume, via together-sandbox. - [Upstash Box](https://sbox-sdk.vercel.app/llms.mdx/adapters/upstash-box): Persistent Linux containers from Upstash that pause when idle and wake on the next request. Streamed exec over live sessions, PTY, native files, public URLs, filesystem snapshots and network policy (plus opt-in SSH), via @upstash/box. - [Vercel Sandbox](https://sbox-sdk.vercel.app/llms.mdx/adapters/vercel): Named, persistent Firecracker microVMs on Vercel. Streaming exec with real kill, a PTY, snapshots and forks, Drives, egress policy with credential injection, and public port URLs. ## Plugins - [Writing a plugin](https://sbox-sdk.vercel.app/llms.mdx/plugins/authoring): Build a custom plugin with the SandboxPlugin interface — graft typed properties onto the sandbox, run setup on create, and clean up on destroy. - [Overview](https://sbox-sdk.vercel.app/llms.mdx/plugins/overview): Plugins extend every sandbox a client builds — graft properties onto the sandbox, hook its lifecycle, and add cross-cutting behavior. AI tool providers are the first plugin kind. - [Catalog](https://sbox-sdk.vercel.app/llms.mdx/plugins/catalog): Every plugin that ships with sbox SDK, and what's on the roadmap. AI tool providers are available today; middleware, lifecycle, and MCP plugins are next. - [Lifecycle (coming soon)](https://sbox-sdk.vercel.app/llms.mdx/plugins/catalog/lifecycle): Lifecycle plugins will bootstrap a sandbox on create — seed files, install dependencies, warm a dev server. Planned — build your own today. - [MCP server (coming soon)](https://sbox-sdk.vercel.app/llms.mdx/plugins/catalog/mcp): An MCP plugin will expose the sandbox's tools over the Model Context Protocol for any MCP client. Planned. - [Middleware (coming soon)](https://sbox-sdk.vercel.app/llms.mdx/plugins/catalog/middleware): Middleware plugins will wrap tool and command calls for audit, redaction, and metrics. Planned — build your own today. ## AI agent tools - [Vercel AI SDK](https://sbox-sdk.vercel.app/llms.mdx/ai/ai-sdk): Project sandbox tools into the AI SDK's tool() shape as a map for generateText / streamText. Use the ai() plugin with the aiSdk() framework, or the standalone toAISDKTools(). - [Anthropic / Claude](https://sbox-sdk.vercel.app/llms.mdx/ai/anthropic): Project sandbox tools into the Anthropic SDK's runnable-tool shape. One array works with both the toolRunner auto-loop and a manual messages.create loop. Use the ai() plugin with the anthropic() framework, or toAnthropicTools(). - [Approval](https://sbox-sdk.vercel.app/llms.mdx/ai/approval): One SandboxPolicy decides allow / ask / deny per tool call. Each framework maps "ask" to its native human-in-the-loop. Destructive actions pause by default. - [LangChain](https://sbox-sdk.vercel.app/llms.mdx/ai/langchain): Project sandbox tools into @langchain/core tool() objects as an array for any LangChain agent or LangGraph ToolNode. Use the ai() plugin with the langchain() framework, or toLangChainTools(). - [Mastra](https://sbox-sdk.vercel.app/llms.mdx/ai/mastra): Project sandbox tools into Mastra's createTool() shape, keyed by id for an Agent. Use the ai() plugin with the mastra() framework, or the standalone toMastraTools(). - [OpenAI Agents](https://sbox-sdk.vercel.app/llms.mdx/ai/openai): Project sandbox tools into the OpenAI Agents SDK tool() shape as an array, with native needsApproval human-in-the-loop. Use the ai() plugin with the openaiAgents() framework, or toOpenAITools(). - [Overview](https://sbox-sdk.vercel.app/llms.mdx/ai/overview): Turn any sandbox into a set of tools your AI agent can call — one plugin shapes sandbox.tools for your framework, capability-gated to the provider and gated by an approval policy. - [AI providers](https://sbox-sdk.vercel.app/llms.mdx/ai/providers): AI-provider plugins shape sandbox.tools for your framework — capability-gated, policy-aware, and typed. One per client, configurable per sandbox. - [Tools](https://sbox-sdk.vercel.app/llms.mdx/ai/tools): The 10 canonical sandbox tools, each mapped to the core Sandbox API and gated by the provider's capabilities. Authored once, projected into every framework. ## API reference - [Client](https://sbox-sdk.vercel.app/llms.mdx/api/client): createSandboxClient is the single entry point — it owns provider selection, idempotency-aware retry and fallback, lifecycle hooks, and disposal. - [code](https://sbox-sdk.vercel.app/llms.mdx/api/code): The code interpreter namespace — run code in a stateful kernel and collect rich results. Gated on the codeInterpreter capability. - [commands](https://sbox-sdk.vercel.app/llms.mdx/api/commands): Run, spawn, stream, and kill processes. commands.run returns a handle that is both a Promise and an AsyncIterable, and never throws on a non-zero exit. - [files](https://sbox-sdk.vercel.app/llms.mdx/api/files): The filesystem namespace — read, write, list, mkdir, remove, rename, stat, exists, upload, download, and watch. Web-standard bodies in, StoredFile out. - [lifecycle](https://sbox-sdk.vercel.app/llms.mdx/api/lifecycle): Top-level sandbox lifecycle — getInfo, setTimeout, pause, resume, stop, and destroy. Always present, runtime-gated per provider. - [ports](https://sbox-sdk.vercel.app/llms.mdx/api/ports): Expose a port and get a preview URL, list exposures, and proxy a fetch through the sandbox. Gated on the exposePort capability. - [Sandbox](https://sbox-sdk.vercel.app/llms.mdx/api/sandbox): The object you hold after create() — always-present commands and files namespaces, capability-gated sub-APIs, lifecycle methods, and the raw() escape hatch. - [snapshots](https://sbox-sdk.vercel.app/llms.mdx/api/snapshots): Checkpoint and restore sandbox state, fork a sandbox, and manage snapshot refs. Gated on the snapshot capability.