Skip to main content
A sandbox is an isolated, short-lived Ubuntu VM. Its CPU, memory, disk, GPU, environment, SSH key, network policy, and lifetime are fixed at creation.

Configure a sandbox

The defaults are 4 vCPUs, 32 GiB of memory, 50 GiB of storage, no GPU, and a 300-second lifetime. Supported resource ranges and GPU types are controlled by your organization’s sandbox configuration. wait_for_capacity retries only a temporary lack of the requested GPU; other errors return immediately.
timeout=None disables automatic expiry. Keep an enforced lifetime unless the caller can always terminate the sandbox itself.

Run commands and move files

Wait for running before using SSH-backed operations.
Commands use the system ssh client; transfers use scp. The SSH user is ubuntu. sandbox.ssh_command returns the exact base command for manual SSH or port forwarding.

Control outbound access

Public internet access is allowed by default. Private, metadata, and other sandbox networks remain blocked, and inbound access is limited to SSH.
CIDR and domain rules are independent: when both are restricted, a connection must pass both controls. A bare domain matches only that name; use *. for its subdomains. Network policy cannot be changed after creation.

Reconnect and list

Every sandbox has a permanent id and an optional name label. Names can be reused after a sandbox stops, so store and use the ID.
The SDK stores generated keys under ~/.thunder/sandbox_keys/<sandbox-id>. You need that private key to run commands or transfer files from a later process or machine; SSH keys cannot be replaced after creation.

Lifecycle and cleanup

The lifecycle is pendingstartingrunningstoppingstopped, with failed as a terminal state. Sandbox.create() returns before startup is complete, and wait_until_running() reports the failure reason if startup fails.
Billing begins when the sandbox reaches running and ends when it stops. Allocated GPUs, vCPUs, memory GiB, and storage GiB are metered per second. Expiry or terminate() permanently destroys the filesystem, while status and configuration remain in sandbox history. Sandboxes cannot be restarted, resized, or snapshotted; create a new one instead. For asyncio applications, AsyncSandbox exposes the same operations as awaitable methods.