# 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. - [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. - [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. - [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): The build-time base image for a sandbox. A single opaque string on SandboxSpec, mapped per-adapter to that provider's nearest concept. - [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 (GA June 2026) with suspend/resume up to 8h. Control plane via @aws-sdk/client-lambda-microvms; you bake a small runner into the image. - [Beam Cloud](https://sbox-sdk.vercel.app/llms.mdx/adapters/beam): A sandbox per Beam Cloud container. Fast, GPU-capable sandboxes with snapshots, via @beamcloud/beam-js. - [Blaxel](https://sbox-sdk.vercel.app/llms.mdx/adapters/blaxel): A sandbox per Blaxel instance. The "perpetual sandbox" — stays in standby indefinitely and resumes in sub-25ms, via @blaxel/core. - [Cloudflare Sandbox](https://sbox-sdk.vercel.app/llms.mdx/adapters/cloudflare): Cloudflare Sandbox via a Worker / Durable Object binding — a code interpreter, native ports with proxied fetch, and get-or-create semantics. Worker-only. - [CodeSandbox](https://sbox-sdk.vercel.app/llms.mdx/adapters/codesandbox): A sandbox per CodeSandbox microVM. Native filesystem, fast hibernate/resume, and public preview hosts, via @codesandbox/sdk. - [Daytona](https://sbox-sdk.vercel.app/llms.mdx/adapters/daytona): A full-featured sandbox — code interpreter with charts, stop/pause/resume, preview links, and regions. Backed by @daytonaio/sdk. - [E2B](https://sbox-sdk.vercel.app/llms.mdx/adapters/e2b): The canonical reference adapter — richest capability set, with a code interpreter, snapshots, native ports, and pause/resume. 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. - [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 and first-class GPU. Backed by the modal JS SDK; an App + Image are created lazily. - [Morph](https://sbox-sdk.vercel.app/llms.mdx/adapters/morph): A sandbox per MorphCloud instance. Snapshot-first VMs with instant branching, via the morphcloud SDK. - [Northflank](https://sbox-sdk.vercel.app/llms.mdx/adapters/northflank): A sandbox per Northflank deployment service. The services platform, driven through @northflank/js-client — a sleep-infinity container you exec into. - [Railway](https://sbox-sdk.vercel.app/llms.mdx/adapters/railway): A sandbox per Railway sandbox. Ephemeral, isolated Debian Linux VMs with native streaming exec, byte-accurate files, checkpoints and forking. - [Runloop](https://sbox-sdk.vercel.app/llms.mdx/adapters/runloop): A sandbox per Runloop devbox. AI-focused devboxes with suspend/resume and disk snapshots, via @runloop/api-client. - [Vercel Sandbox](https://sbox-sdk.vercel.app/llms.mdx/adapters/vercel): Vercel Sandbox via @vercel/sandbox — exec-emulation, native ports, and a filesystem that is auto-snapshotted on stop. No code interpreter. ## 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.