SandboxIntegrations

Integrations

Coding agents in the sandbox

Claude Code, Codex, OpenCode, Pi and other coding agents run inside the sandbox itself. You send a task; the agent works in the sandbox and returns a result. client.listBackends() lists the ones your account can run.

GuideUse it for
Run a coding agentHeadless turns from the SDK, CLI or HTTP.
Interactive modeThe agent’s own terminal UI, in your terminal and the browser.
Claude Code on your Claude plan, Codex on your ChatGPT plan, coding plansPaying for the model with your own subscription or key.

Agent framework tool packs

Your own agent loop calls the model, and the sandbox is its tools. Each pack turns the same tools into the framework’s format and runs the calls in the sandbox. Import them from @tangle-network/sandbox/agent.

FrameworkFunctionGuide
Anthropic SDKanthropicTools(box)Anthropic SDK
OpenAI Chat CompletionsopenaiTools(box)OpenAI
Vercel AI SDKvercelAiTools(box)Vercel AI SDK
MastramastraTools(box)Mastra

The tools: sandbox_run_code (Python, Node, TypeScript or Bash in a kernel that keeps its variables), sandbox_exec, sandbox_read, sandbox_write, sandbox_list and sandbox_search. Preview tools (sandbox_preview and its siblings) are off by default; name them in allow to expose them.

These packs are TypeScript only.

Packs that manage sandboxes and fleets

Two more packs let a model create and drop sandboxes itself. They take the client, not a sandbox:

PackToolsFunctions
Lifecyclesandbox_create, sandbox_run_command, sandbox_destroyanthropicLifecycleTools(client), openaiLifecycleTools(client)
Fleetsandbox_fleet_spawn, sandbox_fleet_dispatch, sandbox_fleet_status, sandbox_fleet_destroy, sandbox_fleet_runanthropicFleetTools(client), openaiFleetTools(client), vercelAiFleetTools(client), mastraFleetTools(client)

A fleet pack built with { parent: { fleetId, agentId } } records that parent on every fleet it spawns, so the child’s budget comes out of the parent’s.

In Python, create_manage_sandboxes_tool(client) returns a manageSandboxes tool with a name, description, JSON parameters and execute(input), which creates, inspects and deletes fleets. Wire it into any Python agent framework.

MCP

PathUse it forGuide
Local stdio serverClaude Desktop, Cursor, Zed or any MCP client gets the sandbox tools above. tangle mcp serve <sandbox> or createMcpServer(box).MCP clients
Hosted computer-use endpointAn MCP client controls the sandbox’s desktop over HTTPS with box.getMcpEndpoint().MCP clients

Coding agents inside the sandbox take MCP servers from their AgentProfile, and Hub accounts from connections.

Other sandbox clouds and runtimes

PackageUse it forGuide
@tangle-network/agent-runtimeSupervised, budgeted agent runs on sandboxes.agent-runtime
@tangle-network/agent-provider-e2b, -daytona, -boat, -computesdkThe same agent on E2B, Daytona, Boat or ComputeSDK, with models billed to your Tangle key.Run on E2B, Daytona and more
@tangle-network/agent-evalScoring runs, comparing models and coding agents, gating releases.Evaluate agents

Retries and duplicate work

Framework loops and MCP clients run outside the sandbox, so the sandbox cannot make their loop durable. Three things it does provide:

NeedUse
Keep Python or Node variables between tool callsPass the same sessionId to the pack: anthropicTools(box, { sessionId: conversationId }). The kernel for that session keeps its state. Without a sessionId, calls share one default kernel.
Run one runCode call at most oncebox.runCode(language, source, { sessionId, idempotencyKey }). A second call with the same key and session within 15 minutes returns the first result, and one that arrives while the first is running waits for it. A failed run is not cached. The tool packs do not pass a key.
Survive a restart of the whole agent turnRun the sandbox’s own coding agent with box.dispatchPrompt(message, { sessionId, turnId }) instead of a local loop. See Sessions.

dispatchPrompt runs the coding agent inside the sandbox. It does not replay or deduplicate a framework loop running in your process. If your loop restarts, it calls the model again; make the tools it calls safe to repeat, or key them.

Next