Documentation

Sandboxes

An isolated Linux environment with a fixed image and resources.

What it is

A sandbox starts from a known image and runs commands in its own filesystem and process space.

Create

TypeScript
const sandbox = await Sandbox.create({
  image: "ubuntu-24.04:base",
  cpuCores: 2,
  memoryMb: 2048,
});

Lifecycle

Sandboxes are persistent by default: stopping one snapshots its filesystem so it can be resumed later (or forked into copies), while deleting it removes everything. A stopped sandbox bills no compute — only snapshot storage. See Snapshots for resume, fork, and retention.

Reconnect

Store the sandbox id if another request needs to inspect the same sandbox.

TypeScript
const sandbox = await Sandbox.get("sbx_...");
const commands = await sandbox.listCommands();

console.log(sandbox.state);
console.log(commands.at(0)?.state);

Resources

CPU and RAM are billable. Disk is fixed at 20 GB.

  • CPU can be requested up to the project limit.
  • Memory can be requested up to the project limit.
  • Disk is fixed sandbox scratch space.