Secure Sandboxes
for any workload
Spin up isolated, Python-native compute environments in seconds — with GPUs, networking, and persistent storage. Run untrusted or LLM-generated code safely, at any scale.
A cloud environment for anything you can run
Sandboxes give you a secure, fully configurable machine in the cloud — booted in seconds and controlled entirely from Python.
From zero to a live environment in seconds
Create a sandbox
Define CPU, memory, GPU, and your image in a single Sandbox() constructor, then call create() to launch it into the cloud in seconds.
Run code and commands
Execute Python with run_code, run any shell command with exec, upload and download files, and stream logs back in real time.
Expose, snapshot, or terminate
Expose ports behind secure preview URLs, snapshot the filesystem or memory to fork later, and auto-terminate when you're done.
Frequently asked questions
What can I run inside a sandbox?
Anything — sandboxes aren't limited to Python. Run shell commands, start a Node.js server, launch a headless browser, or execute arbitrary code. You get a full isolated environment with networking, storage, and optional GPUs.
How fast do sandboxes boot?
Sandboxes cold boot in 1–3 seconds, even with dependencies included. Beam caches dependencies in your base image, so subsequent sandboxes launch even faster.
Is it safe to run untrusted or LLM-generated code?
Yes. Every sandbox is fully isolated. You can block all outbound network traffic with block_network, or define CIDR allow lists to permit only specific destinations — and update those permissions at runtime without restarting.
Can I use GPUs?
Yes. Assign a GPU like an A10G alongside CPU and memory directly in the Sandbox constructor, so you can run rendering, machine learning, or other accelerated workloads.
How does persistent storage work?
Mount fast distributed Volumes to persist files between sessions and share data across sandboxes, or connect your own S3-compatible cloud buckets for large datasets and long-term storage in your own infrastructure.
How does pricing work?
You're billed per-second only while your sandbox is running. Set a timeout to auto-terminate, or terminate manually when you're done. Every account gets $30 of free credit each month.