run_code calls stays in scope without any extra setup.
What you get in every sandbox
Each sandbox includes:- A dedicated Linux kernel (guest kernel 6.1) and 2 vCPUs by default
- ~1 GiB RAM by default (see resource limits)
- A private 2 GB ext4 rootfs (Ubuntu 24.04 minimal)
- A persistent Python REPL started at boot — variables, imports, and open file handles survive across calls
- A private filesystem isolated from every other sandbox — writes are copy-on-write from a shared base image
Sandbox lifecycle
run_code call adds a few milliseconds. Destroying a sandbox frees all resources in ~50 ms.
Because each sandbox holds a live Python process,
run_code calls are not independent — later calls see the variables, imports, and open files set by earlier calls. Create a new sandbox when you want a clean slate.Create, use, and destroy a sandbox
- Python
- TypeScript
- curl
Fast creation: the warm pool
Podflare keeps a pool of pre-booted VMs ready socreate() doesn’t wait for a cold kernel boot. On a pool hit, your sandbox is ready in 7–11 ms. On a pool miss (burst traffic), creation falls back to a cold boot (~1.4 s) while the pool refills in the background.
See Warm Pool for what to expect during bursts and how the pool recovers.
Isolation guarantees
Podflare sandboxes use Firecracker microVMs, not containers:- KVM hardware boundary — your code cannot access another sandbox’s memory at the kernel level
- Dedicated guest kernel — no shared kernel with other tenants
- Copy-on-write filesystem — each sandbox gets its own reflink of the base rootfs; writes only touch your VM
- No outbound network by default — sandboxes boot without a network interface, preventing data exfiltration from LLM-authored code
Allowlisted egress (letting sandboxes call specific external domains) is coming in a future release. See Network & Egress for the current data-in/data-out patterns.
Resource limits
Number of vCPUs allocated to the sandbox VM.
Memory allocated to the sandbox in MiB. The default is 1024 MiB (~1 GiB).
Related concepts
Fork
Branch a running sandbox N ways with copy-on-write isolation
Python REPL
How state persists across run_code calls
Warm Pool
Why create() returns in under 11 ms
Network & Egress
How to move data in and out of a sandbox