Sandbox resourcing: burst, don't reserve
Modal Sandboxes default to a tiny guaranteed request (0.125 cores, 128 MiB) and burst into a shared pool of idle machine capacity, billed per second on actual use rather than a fixed peak reservation. Since typical sandboxes spend over half their life under 6% of peak CPU, costs should be estimated from average rather than peak usage; an illustrative 20-minute coding-agent task comes out 58% cheaper than a fixed-size reservation. Bursting works because unrelated workloads rarely spike together, but CPU contention slows sandboxes and memory pressure can OOM-evict those above their request, backed by an SLO of under 0.0001% per minute for sandboxes under 8 GiB. Set limits for consistent eval/RL environments or cost caps, and raise the memory request if evictions are unacceptable.
Related posts
- How Abundant designed efficient rollout architecture with Modal Sandboxes
Modal easyNovice
Abundant runs its reinforcement learning rollout platform on Modal, with each of 75,000+ RL tasks executing in an isolated Modal Sandbox and Modal Functions powering the scheduler API. The design places a small monitor inside each Sandbox that sends heartbeats every 30 seconds, live events and final results over HTTP. The control plane retries three times before terminating a silent Sandbox. CPU and memory bursting let them request average rather than peak resources, cutting idle compute spend and avoiding OOMs. To counter evaluation awareness, they delete task instructions before work starts and add a reviewer agent that flags suspicious traces during verification.
- How Legora runs 2,000 parallel agent evals on Modal Sandboxes
Modal mediumAdept
Legora tests its long-running legal agent by booting the full application, pinned to a specific commit, inside a separate Modal Sandbox for each eval run. A typical experiment is about 2,000 runs (100 cases × 4 harness variants × 5 trials), all executed in parallel. Modal Volumes snapshot world state such as documents, database state, permissions and blobs, and also cache Docker images. An hourly pipeline pre-builds the image and pre-warms Sandboxes, and moving from gVisor to VM-backed Sandboxes let the team delete their Docker networking and FUSE workarounds. Agents now drive the eval CLI to hill-climb the harness, which helped cut agent cost by 30% through smarter compaction and custom tool search.
- Scaling to 1 million concurrent sandboxes in seconds
Modal mediumAdept
Modal rebuilt its sandbox control plane to run 1 million concurrent sandboxes, creating all of them in under a minute, by removing central coordination and durable stores from the creation path. A horizontally scaled fleet of scheduling servers picks workers using in-memory state that workers publish to a Redis stream, then calls the worker directly over RPC; workers act as their own source of truth and reject requests when full. Kubernetes and Modal's old Postgres-backed design hit limits from O(pods) and O(nodes) etcd and Postgres writes and serialized scheduling. The new path takes two network hops, scheduling takes tens of milliseconds, and median start time is under 0.5s, with tail latency driven by kernel rtnl lock contention during container networking setup.
- What is an AI code sandbox?
Modal easyNovice
AI code sandboxes are ephemeral, isolated environments for executing LLM-generated code so hallucinated packages, crashes or prompt-injected exploits can't affect the host or other tenants. They run on VMs or containers, ideally with a hardened runtime like gVisor that intercepts syscalls through a user-space kernel instead of sharing the host kernel as runc does. Around that sit filesystem sync APIs, controlled networking, orchestration and state snapshotting. Use cases include background coding agents, code review, chatbot code interpreters, RL reward scoring and AI app builders. Buyers should weigh sub-second cold starts, isolation strength, egress control, high-concurrency scaling, dynamic runtime images and snapshotting.
- NVIDIA Vera CPUs double throughput for Modal Sandboxes
Modal mediumAdept
Modal benchmarked NVIDIA's Arm-based Vera CPU for its multi-tenant Sandbox workloads and found up to 2x task throughput versus a comparable Intel Granite Rapids x86 host under heavy concurrent load. Individual task latency stayed equal or lower, whereas competing CPUs hit throughput plateaus as contention rose. On a quiet host, serial latency was only marginally better than Graviton 4/5, AMD Zen 5 and Intel GNR. The tests used an internal suite called Agentless Agent Bench: 50 Terminal-Bench oracle solutions run in concurrent prewarmed Docker containers without network calls. Modal attributes Vera's behaviour under contention to its high memory bandwidth, which allows denser packing and more forgiving burst capacity for spiky agent and RL rollout workloads.