Sandboxes
Run generated code in an isolated microVM and see its activity alongside your function steps and retries.
When an agent needs to run generated code or test a repository, put that work in a Sandbox. Each Sandbox has its own filesystem and processes. Inngest records Sandbox operations in the durable function run, so you can inspect the job and retry the surrounding steps from one trace.
What you can do
- Run code in isolation. Each Sandbox runs in a separate VM, isolated from the host and other Sandboxes. Sandboxes cannot send traffic directly to one another; outbound network access is allowed by default.
- Start quickly and keep your work. Sandboxes boot in under a second. Pause and resume the same Sandbox, or capture a snapshot and clone it into a new Sandbox. Its filesystem persists through those operations.
- Share files when tasks need them. S3-backed persistent mounts let different Sandboxes use the same backing path.
- Follow the whole job. See Sandbox operations alongside function steps, waits, and retries in a run trace.
- Run Python or TypeScript in one call.
step.sandbox.pythonandstep.sandbox.typescriptstart a Sandbox, run your code, return a typed result, and clean up. Managed lifecycle - Run commands like a script.
sb.$runs a command as one step and returns text, lines, or JSON. Commands - Let sandboxed code call your app. Tools run your functions as durable steps with your credentials. Tools
- Start from your own image. Choose
image.inngest()orimage.custom()when creating a Sandbox. Base images
A durable function can start a Sandbox, run code, wait for another event, and continue later. With the low-level step.sandbox.create() path your function destroys the Sandbox and handles cleanup after permanent failure; the one-call runners clean up for you.
Start here
- Overview explains how Sandboxes fit into durable execution.
- Quick start runs a command with the TypeScript beta.
- Features covers lifecycle, filesystems, SSH, secrets, isolation, and traces.
- Guides shows how to use Sandboxes in a durable job.
- Reference and Limits give the current API and beta limits.
Open beta. Sandboxes are available on Pro plans and above. The TypeScript Sandbox beta is intended for evaluation.