When to use sandboxes
- Untrusted code execution: run code from end users or LLM agents in isolation
- Agentic tool use: give an LLM a fresh execution environment per task
- Parallel batch work: fan out many short jobs concurrently
- On-demand processing: create a runtime for a request, job, or workflow step
Lifecycle
A sandbox moves through these phases:| Phase | Description |
|---|---|
queued | The sandbox was accepted and is waiting for capacity. |
creating | Porter is preparing the runtime and starting the container. |
running | The sandbox is ready and can accept exec calls. |
succeeded | The sandbox command completed successfully. |
failed | The sandbox command or runtime failed. |
terminated | The sandbox was explicitly terminated through the API, SDK, or CLI. |
running sandboxes accept exec calls. Logs remain available after terminal phases so you can fetch output from completed or terminated sandboxes.
Names
Names are the canonical way to refer to sandboxes and volumes in the SDK and CLI.| Resource | Naming rule |
|---|---|
| Sandbox | Sandbox names must be unique within a cluster and currently cannot be reused, even after the sandbox is terminated. Omit the name only for one-off sandboxes where you do not need stable lookup later. |
| Volume | Volume names must be unique within a cluster for the lifetime of the volume. After a volume is deleted, its name can be used again. |
Build with the Sandbox SDK
Your application creates and manages sandboxes with a Sandbox SDK. For now, we recommend deploying that application as a Porter Application in the same AWS cluster where you want to run sandboxes.Use the CLI for operations
Use the sandbox CLI to inspect and operate on sandboxes from your terminal:- Create sandboxes from container images
- List sandboxes by phase
- Fetch logs
- Exec into a running sandbox
- Terminate one sandbox or many sandboxes at once
- Create, list, inspect, and delete sandbox volumes
Persistent storage
Volumes provide persistent storage that can be mounted into sandboxes at launch. Create a volume first, then passvolume_mounts when creating a sandbox.

