Sandbox States
A sandbox transitions through three states:| State | Description |
|---|---|
| Pending | Sandbox is being created. The container image is being pulled and the container is being started. |
| Running | Sandbox is active and ready to execute code. |
| Terminated | Sandbox has been stopped, either manually via client.delete() or due to a timeout. |
Resource Configuration
Configure CPU, memory, and disk for each sandbox:| Parameter | Type | Default | Description |
|---|---|---|---|
cpus | float | 1.0 | Number of CPUs to allocate |
memory_mb | int | 512 | Memory in megabytes |
ephemeral_disk_mb | int | 1024 | Ephemeral disk space in megabytes |
Timeouts
Set a timeout to automatically terminate sandboxes that run too long:timeout_secs is not set, the sandbox runs until explicitly terminated with client.delete().
Container Images
Specify any Docker image for your sandbox:Secrets
Inject secrets as environment variables:Sandbox Information
TheSandboxInfo object returned by client.get() contains:
| Field | Type | Description |
|---|---|---|
sandbox_id | str | Unique sandbox identifier |
namespace | str | Namespace the sandbox belongs to |
status | SandboxStatus | Current state (Pending, Running, Terminated) |
image | str | Container image used |
resources | ContainerResourcesInfo | CPU, memory, and disk allocation |
secret_names | list[str] | Injected secret names |
timeout_secs | int | Timeout in seconds |
entrypoint | list[str] | Custom entrypoint command |
network | NetworkConfig | Network configuration |
pool_id | str | Pool ID if created from a pool |
created_at | str | Creation timestamp |
terminated_at | str | Termination timestamp |