SandboxSDK & APIAPI map & integrations

API map and integrations

Use the task guides for complete programs. The tables below locate the SDK’s other operations and integration entrypoints.

Account and sandbox APIs

APIOperationsGuide
SandboxCreate, list, get, wait, and delete matching sandboxes.Lifecycle
client.shapes(), .environments, .listBackends()Discover resource sizes, environments, and harnesses.Resources
client.usage(), .subscription(), .getIdentity(), .health()Read usage, plan, identity, and service health.Access and usage
box.exec(), .runCode(), .processExecute code, spawn processes, read logs, signal, and wait.Commands and files
box.read(), .write(), .writeMany(), .fs, .search()Read, write, search, list, upload, download, and manage files.Commands and files
box.gitStatus, diff, branch, commit, push, pull, and repository history.Git operations
Image, box.images, client.publicTemplatesBuild images, publish workspaces, and share templates.Images and storage
box.snapshot(), .revertToSnapshot(), .restorePaths(), .fork()Save, restore, and clone workspaces.Snapshots
box.restoreFromStorage()Restore from a customer bucket.Snapshot storage
box.ports(), .previewLinks, .network, .sshCommand()Discover ports, publish previews, and connect over SSH.Ingress
box.egressRead and change outbound policy; inspect traffic and denials.Egress
box.terminals, session.interactive()Attach shells and native agent terminals.Interactive access
box.getMcpEndpoint()Delegate computer tools to an MCP client.Computer use
box.gpuAttach, inspect, execute on, and detach GPU leases.GPUs

Agents and execution

APIOperationsGuide
box.prompt(), .streamPrompt()Run an agent and consume its result or events.Agents
box.sessions(), .createSession(), .session()Manage conversations, messages, results, and execution history.Sessions
box.createTaskSession(), task.changes(), .commit()Inspect and apply isolated task changes.Task changes
box.dispatchPrompt(), .driveTurn(), .driveConversationTurn()Resume work using stable turn and session identities.Durable turns
session.interactions(), .answer(), .respondToPermission()Read and respond to questions and permissions.Human decisions
session.plan(), .approvePlan(), .rejectPlan()Review a plan and submit a decision.Human decisions
client.instancesMaintain a workspace per customer.Customer workspaces
client.runBatch(), .streamBatch()Run independent jobs in temporary sandboxes.Batches
client.fleetsProvision named workers and coordinate agents.Fleets
box.trace(), .exportTrace(), .intelligence()Inspect runtime records and export them for analysis.Traces
client.intelligenceEstimate, create, read, and list analysis reports.Analysis

Git and tools

box.git provides status(), diff(), log(), commit(), branches(), checkout(), pull(), and push(). Use the sandbox’s configured Git credentials for private repositories. Review changes before committing or pushing them.

box.tools lists installed tools and manages tool installation. box.backend exposes the active backend’s configuration, models, and supported provider operations. Provider-specific operations can return NOT_SUPPORTED; use client.listBackends() to inspect advertised capabilities.

Human decisions

Read outstanding requests with session.interactions() and keep their exact IDs. Respond with answer(), respondToPermission(), or respondToInteraction() for the matching request. An interrupted or waiting execution has not completed successfully.

approvePlan() and rejectPlan() can enqueue a follow-up turn. Read that turn’s admission and result rather than sending the same prompt again. Use interrupt() or cancelRun() to stop work, and delete() to remove a session.

Security and sharing

APIUse
client.secretsCreate, list, and delete account secrets.
client.sshKeysRegister and manage SSH public keys.
client.teamsTeams, invitations, member roles, team secrets, and templates.
box.permissionsManage sandbox users, directory permissions, and access policies.
box.mintScopedToken()Issue short-lived access for runtime or session clients.
box.grantNativeCredential()Grant a named native credential to an agent backend.
box.collaborate(), .refreshCollaborationToken()Authorize shared document editing.
createConfidentialSandbox()Provision with a compatible confidential operator.

See Access, secrets, and usage for account credentials and browser access.

Package entrypoints

ImportUse
@tangle-network/sandboxAccount client, sandboxes, fleets, images, sessions, and traces.
@tangle-network/sandbox/coreClient without the optional chain integration.
@tangle-network/sandbox/runtimeBrowser or worker runtime access with scoped credentials.
@tangle-network/sandbox/interactive-controlInteractive agent state, attachment, and input control.
@tangle-network/sandbox/session-gatewayBrowser WebSocket events, reconnection, and replay.
@tangle-network/sandbox/collaborationCollaborative documents and file synchronization.
@tangle-network/sandbox/agentManaged agents, AI SDK and Mastra tools, and an MCP bridge.
@tangle-network/sandbox/openaiOpenAI-compatible request and event translation.
@tangle-network/sandbox/intelligenceBrowser-safe reads of Intelligence traces.
@tangle-network/sandbox/authServer-side token issuance and validation.
@tangle-network/sandbox/tangleDirect Tangle chain operations.
@tangle-network/sandbox/linesPhone and messaging lines.
@tangle-network/sandbox/previewManaged agent preview helpers.

Install optional framework dependencies only for the integration you use. The package includes TypeScript declarations for every exported method and option; open a symbol’s definition in your editor for its signature.

Messaging and collaboration

client.lines manages messaging addresses connected through Tangle Hub. box.lines attaches a line to a sandbox so incoming messages reach its agent. Line creation and delivery require the corresponding Hub connection.

CollaborationClient and CollaborationFileBridge connect shared document changes with sandbox files. Get the transport and access grant from box.collaborate() after checking the viewer’s access. Use refreshCollaborationToken() to renew it.