Sandboxes
Trusted infrastructure for untrusted agents
High performance sandboxes designed to give agents the computers they need at a scale they demand.
Computers for agents.
Reinforcement learning rollouts
import modalapp = modal.App("code-rl-reward")@app.function()def compute_reward(completion: str, testcase: list[str]) -> int: code = get_generated_code_and_test_cases(completion, testcase) # Each rollout gets its own isolated, disposable sandbox sb = modal.Sandbox.create(app=app) score = 0 try: p = sb.exec("python", "-c", code, timeout=30) p.wait() score = 1 if p.returncode == 0 else 0 # reward = did the code run? finally: sb.terminate() return score SANDBOXES
1M+ in parallel
Rollouts that scale fast without slowing down your workflow.
Get started1M+ sandboxes in under a minute
Keep your GPUs saturated and rollouts fast with massively parallel sandboxes that spin up fast.
Any dependency, any image
Programmatically define your exact rollout environment and dependencies.
Egress controls to prevent cheating
Lock each rollout's egress, keeping rollout environments reproducible and contained.
Coding Agents
import modalapp = modal.App.lookup("coding-agent", create_if_missing=True)sandbox = modal.Sandbox.create(app=app)try: code = agent.generate_code("Calculate the first 20 Fibonacci numbers") result = sandbox.exec("python", "-c", code, timeout=30) agent.process_result(result)finally: sandbox.terminate() SANDBOX
Started
Environment
agent.py - tools.py
Image
Resources
Volumes
Task
Executing untrusted code
python / workspace / agent.py
The fast, reliable computer your coding agent needs to do its best work.
Get startedFast startup on any image
Snapshot full or partial filesystems to save state and resume instantly later.
Secure networking
Lock down domain egress while still giving agents access to the Secrets, data, and tools they need.
Build robust environments
Start from any image, install what you need at runtime, and keep state across a long agent session.
import modalapp = modal.App("code-rl-reward")@app.function()def compute_reward(completion: str, testcase: list[str]) -> int: code = get_generated_code_and_test_cases(completion, testcase) # Each rollout gets its own isolated, disposable sandbox sb = modal.Sandbox.create(app=app) score = 0 try: p = sb.exec("python", "-c", code, timeout=30) p.wait() score = 1 if p.returncode == 0 else 0 # reward = did the code run? finally: sb.terminate() return score SANDBOXES
1M+ in parallel
Rollouts that scale fast without slowing down your workflow.
Get started1M+ sandboxes in under a minute
Keep your GPUs saturated and rollouts fast with massively parallel sandboxes that spin up fast.
Any dependency, any image
Programmatically define your exact rollout environment and dependencies.
Egress controls to prevent cheating
Lock each rollout's egress, keeping rollout environments reproducible and contained.
Engineered for the speed and scale agents require
Scale to a million in under a minute
Modal's infrastructure scales to the parallelism that production agent systems and RL training actually demand.
Fast on any image
Bring your dependencies, your base image, your setup scripts. Sub-second cold-starts even on custom and large images.
Adaptive provisioning of resources
Elastically scale both CPU and Memory as needed so you never have to worry about under provisioning or over paying.
Modal Sandbox Pricing
Only pay for what you use. Burst up to what you need without over-allocating CPU or memory in advance.
Compute costs
CPU
Physical core (2 vCPU equivalent)
$0.1419 / core / h
*minimum of 0.125 cores per container
Memory
$0.0240 / GiB / h
“Modal powers both our reinforcement learning infrastructure and production inference. Millions of sandboxes on one end, real-time serving on the other.”
“We use Sandboxes to power Coding Sessions, which allows users to delegate and iterate on issues with their coding agent by tagging @Linear.”
“It would have been really hard to build Inspect without Modal. A lot of the complexity is hidden behind just being able to spin up sandboxes very quickly with a lot of services and data, and effectively have infinite of them at any given time.”
Latest updates

Building fast filesystems for VMs
How we made VM Sandbox filesystems fast by speaking in blocks instead of files.

Muse Spark Open is now available on Modal
Muse Spark Open, a coding-optimized multimodal model from Meta, is now available on Modal Auto Endpoints.

Modal crosses $1B in Annualized Run Rate and raises $750M Series D
Modal has crossed $1B in annualized run rate and raised a $750M Series D led by Accel to build new infrastructure for AI applications. We can't think of a better time to be building software.

