Give your AI agents a safe place to run code
Run agent-generated code in isolated sandboxes that boot in under a second, with filesystem access, exposed ports, and snapshots.
Compute primitives built for agents
Everything an agent needs. Process management, file system operations, and access to stdout and stderr.
Give your agents a computer
Create a sandbox
Define the image — Python version, packages, even non-Python runtimes — and call create(). It's up in seconds.
Let the agent work
Run generated code, execute processes, read logs, and move files through the SDK from your agent loop.
Snapshot, expose, or terminate
Fork state with filesystem snapshots, expose ports for previews, set a TTL for long sessions, or tear it down.
# Process management
process = sandbox.process.exec("python3", "train.py")
for line in process.logs:
print(line, end="")
# Filesystem in and out
sandbox.fs.upload_file("data.csv", "/workspace/data.csv")
sandbox.fs.download_file("/workspace/output.csv", "results.csv")
# Keep the session alive for an hour
sandbox.update_ttl(3600)
# Snapshot the filesystem to fork or resume later
image_id = sandbox.create_image_from_filesystem()Frequently asked questions
How isolated are sandboxes?
Each sandbox runs in its own isolated, non-root container, separated from your other workloads. For stricter requirements, Beam also offers a self-hosted deployment that keeps everything inside your own VPC.
Can agents run things other than Python?
Yes. Sandboxes run arbitrary processes — start from any base image (Node, for example) and exec whatever the agent needs.
How long can a sandbox stay alive?
As long as you want. Sandboxes shut down automatically by default, but update_ttl lets you extend sessions or keep them running indefinitely.
Can I resume or branch an agent's environment?
Yes. Snapshot the filesystem to an image, then boot any number of new sandboxes from that state — ideal for retries and exploring branches.
Which agent frameworks does this work with?
Any of them. The Sandbox SDK is plain Python, so LangChain tools, custom loops, or anything that can call a function can drive it.
Related use cases
Sandboxes for RL rollouts at scale
Forkable, restorable sandboxes for reinforcement learning rollouts.
InferenceDeploy open-source LLMs
Serve open-source LLMs behind an autoscaling, OpenAI-compatible API.
Task QueuesFan out batch jobs across thousands of containers
Fan out batch inference and ETL across thousands of containers.
Start shipping on infra
you won’t outgrow.
Run sandboxes and GPU workloads on your cloud, and scale out to ours when you need to. No infra to manage.