TypeScript Reference
A simple sandbox API on Chainguard Workspaces, shaped like the E2B, Vercel Sandbox and Modal Sandbox SDKs: create a sandbox, run commands, move files in and out, delete it.
import { Sandbox } from "chainguard-sandbox-sdk";
await using sbx = await Sandbox.create({ packages: ["python-3.13"] });const r = await sbx.commands.run("python3 -c 'print(2+2)'");console.log(r.stdout); // 4await sbx.files.write("data/input.txt", "hello");A sandbox is a Workspaces session created from an empty workspace with an environment document listing your packages. Commands run one at a time per sandbox; there are no exposed ports. Durations are in milliseconds.
Classes
Section titled “Classes”- CommandExitError
- CommandHandle
- Commands
- FileNotFoundError
- Filesystem
- GitHubAppNotInstalledError
- GitHubLinkRequiredError
- InvalidPathError
- LimitReachedError
- NotFoundError
- OutcomeUnknownError
- Sandbox
- SandboxBusyError
- SandboxError
- SandboxNotFoundError
- TermsNotAcceptedError
- TimeoutError
- WorkspacesNotEnabledError
Interfaces
Section titled “Interfaces”- CommandResult
- CommandStartOpts
- ConnectOpts
- EnableOpts
- EntryInfo
- Organization
- ProcessInfo
- SandboxInfo
- SandboxOpts
- SetupOpts
- TermsDocument
- WorkspacesStatus
- WriteEntry
- WriteInfo
