Skip to main content
A sandbox is a sandbox — a fully isolated Linux environment with its own filesystem, process tree, and network namespace. Each sandbox boots in approximately 125 milliseconds and runs until it times out or is explicitly killed.

Sandbox states

Creating and Snapshotting above are transient phases, not values the API returns. Only three states are ever reported in the state field:

Create a sandbox

Create with full options

SandboxInfo model

The SandboxInfo object is returned by create(), get(), and list().

Inspect a sandbox

List sandboxes

Connect to an existing sandbox

Use connect() to reconnect to a running or paused sandbox from a different process or after a restart.

Extend timeout

Pause and resume

Pausing a sandbox preserves the full memory state and filesystem. No CPU is consumed while paused. The sandbox can be resumed instantly.

SandboxMetrics model

Not available yet. The platform endpoint behind this returns 501 metrics collection not yet implemented, so this call currently fails. The method is part of the SDK surface, but there is no metrics data to retrieve.

Resource configuration

Resources (vCPUs, memory, disk) are fixed at the template level — they cannot be overridden per sandbox. Sending a resources field in Sandbox.create() is rejected with HTTP 400 "resources field is not supported; set resources at template level". To run with different resource sizing, build or select a template with the desired allocation. See Templates.
Each sandbox receives its own copy-on-write rootfs derived from the template. Template-derived resources are also validated against your account tier on every create — requests exceeding MaxVCPUs, MaxMemoryMB, or MaxStorageGiB return HTTP 403.

Kill a sandbox

Auto-injected environment variables

Every sandbox receives these environment variables automatically:

Lifecycle configuration

With on_timeout="pause", the sandbox is paused rather than destroyed when it times out: a pause snapshot is taken and the sandbox stops consuming CPU and memory, exactly as if you had called sbx.pause(). Wake it up with sbx.resume(), which also re-arms the timeout. A pause that fails is retried a few times; if it still fails, the sandbox is killed instead. A paused sandbox is kept until you resume or kill it; its timeout does not run while it is paused. auto_resume is accepted but not yet enforced: a paused sandbox is resumed only by an explicit resume() call.
Maximum runtime per session is 1 hour on the Free tier, 72 hours on Pro and 7 days on Enterprise. Pausing stops the clock; resuming re-arms the sandbox’s timeout.