Skip to content

Guide library

Comparison · Quality, cost & reliability

AI Agent Sandboxes Compared: Cost, Pause and Limits

One 60-minute, 2 vCPU agent session costs $0.10 to $0.26 across six sandbox platforms at Nov 26, 2026 list rates. The bigger difference is what each one keeps when the agent goes idle: memory and processes, or files only.

Nalini Groves · Nov 26, 2026 · 10 min read

AWS Compute Blog banner announcing Lambda MicroVMs: serverless compute environments with VM-level isolation and near-instant startup
Amazon Web Services, Announcing Lambda MicroVMs (AWS Compute Blog), Jul 10, 2026. Source: https://aw

An agent's code sandbox spends most of its life waiting. It waits on the model, then on the user, then on the model again. So two things decide which sandbox platform suits an agent, and neither is the headline per-second rate: what the meter counts while nothing runs, and what survives when the sandbox goes idle.

This comparison costs one identical agent session on six platforms, using each one's own billing unit and list rates as of Nov 26, 2026. It then maps which platforms keep memory and running processes across an idle gap, which keep only files, and the limits that end a session. The platforms are AWS Lambda MicroVMs, E2B, Daytona, Modal Sandboxes, Vercel Sandbox and Cloudflare Containers.

What is compared, and what is not

The criteria are the ones that change an agent's architecture: the isolation boundary, what is billed while code runs and while it idles, how a sandbox pauses or stops, what returns afterwards, and the hard time limits. Cold-start speed, SDK quality and regional coverage matter too, but vendors measure them differently, and Metarix has not run any of these platforms. Every figure below comes from official pricing pages and docs, checked on Nov 26, 2026.

AWS is the reason to look again now. Lambda MicroVMs went generally available on June 22, 2026. On Nov 25, AWS added a developer preview that lets Lambda durable functions launch MicroVMs, run tasks in them and manage their lifecycle. More on that below.

One session, six meters

The worked example is a single 60-minute session with 2 vCPU and 4 GiB of memory. The agent's code keeps the CPU busy 15% of the time. The other 85% is waiting on a model or a person. Both the shape and the 15% are Metarix assumptions, chosen to resemble a coding agent that runs tests now and then. Each cost is plain arithmetic on the platform's published list rate, before free allowances, plan fees and data transfer.

Scroll the table horizontally on smaller screens.

One 60-minute agent session, 2 vCPU and 4 GiB, CPU busy 15% of the time. USD, list rates as of Nov 26, 2026
PlatformWhat the meter countsSession costSame hour, fully idle but running
AWS Lambda MicroVMs (Graviton, us-east-1)Baseline vCPU and memory every running second (4 GB buys 2 vCPU); snapshot read on launch$0.255 ($0.252 compute + $0.003 to launch a 2 GB image)$0.252
E2BReserved vCPU and memory every running second$0.166$0.166
DaytonaReserved vCPU, memory and disk (first 5 GiB of disk free)$0.166$0.166
Modal SandboxesThe higher of requested or used CPU and memory, at 3x non-preemptible rates$0.117 (if the agent holds 4 GiB)$0.114
Vercel Sandbox (Pro, iad1)Active CPU only, plus provisioned memory and a per-creation fee$0.123$0.085
Cloudflare Containers (standard-3: 2 vCPU, 8 GiB)Active CPU only, plus provisioned memory and disk$0.098$0.076
Rates from each provider's pricing page, checked Nov 26, 2026: AWS Lambda pricing, E2B pricing, Daytona pricing, Modal pricing, Vercel Sandbox pricing and Cloudflare Containers pricing. Session shape and 15% CPU are Metarix assumptions. Cloudflare has no 2 vCPU/4 GiB predefined type, so the nearest (8 GiB) is used; Workers and Durable Objects charges and the Workers Paid inclusions are excluded. Modal assumes no resource request and 4 GiB held for the hour. Not a benchmark: Metarix did not run these platforms.

Three things fall out of that table.

First, the spread is about 2.6x, not 10x. Memory dominates everywhere, so the shape you provision matters more than which vendor you pick. At Vercel, the 4 GB of provisioned memory is $0.085 of the $0.123.

Second, E2B and Daytona list the same compute rates. E2B's pricing page quotes $0.000014 per vCPU-second and $0.0000045 per GiB-second. Daytona's pricing page quotes $0.0504 per vCPU-hour and $0.0162 per GiB-hour. Multiply E2B's figures by 3,600 and they match to the cent. Between those two, the plan fee and the lifecycle features decide, not the rate. E2B's Pro plan costs $150 a month, and any sandbox that must run more than an hour without a pause needs it.

Third, the 'idle' column is where billing models split. Lambda MicroVMs, E2B and Daytona bill the reservation for every running second. Busy or idle, the hour costs the same. Vercel and Cloudflare bill CPU only when code uses it, so an idle hour costs only the memory. Modal bills whatever is higher, the request or actual use, and its own pricing FAQ tells you to request nothing and let the sandbox burst. Its idle cost is the 0.125-core minimum plus whatever memory your processes still hold.

That last point needs care. Billing by actual use is cheap for a small agent, but a process that loads a large model or a dependency cache into memory pays for it all hour.

What survives an idle gap

If an agent waits five minutes, any of these platforms can simply stay running. If it waits an hour for a person to review a diff, you either pay the idle column above or put the sandbox to sleep. What it wakes up with differs a lot.

Table graphic comparing what survives an idle gap on Lambda MicroVMs, E2B, Daytona, Vercel Sandbox, Modal and Cloudflare Containers: memory and processes, or files only, plus time limits
What each platform offers between an agent's bursts of work, and what comes back. Graphic: Metarix, Nov 26, 2026, based on AWS, E2B, Daytona, Vercel, Modal and Cloudflare documentation.

Memory and processes come back

Lambda MicroVMs suspend manually or through an idle policy, keeping memory and disk. While suspended you pay only for snapshot storage. Each suspend writes a snapshot and each resume reads one. With 4 GB of state, at the Lambda pricing page rates, one cycle costs about $0.021 ($0.0152 to write and $0.0062 to read). Storage adds about $0.0004 an hour. Against $0.252 an hour of running, suspending pays for itself once a gap is longer than about five minutes. The constraint is the clock: a MicroVM's maximum duration is 8 hours, suspended time included.

E2B pauses on request, or automatically when the timeout runs out if you set the lifecycle to pause. Its persistence docs say a paused sandbox keeps filesystem and memory and is kept indefinitely. A pause takes about 4 seconds per GiB of RAM and a resume about 1 second. Its billing docs say compute billing stops on pause and list no charge for paused sandboxes; confirm that before you keep thousands of them. The 1-hour (Hobby) or 24-hour (Pro) cap is on continuous running and resets on resume.

Daytona's VM sandboxes (Linux VM and Windows) pause with memory, and by default auto-pause after 60 minutes idle. Per its billing docs, a paused sandbox pays for disk only. The catch is the default class: Daytona sandboxes are containers unless you ask for a VM, and containers cannot pause.

Files come back, processes do not

Vercel Sandbox stops and resumes persistent sandboxes. Its persistence docs say stopping snapshots the filesystem and the next call boots a new session from it. A dev server or a loaded model has to start again. Snapshots cost $0.08 per GB-month and expire 30 days after last use by default.

Cloudflare Containers start a new instance every time. The sandbox lifetime docs are blunt: processes and files on disk end when an instance stops, and a snapshot, in public beta and free during the beta, carries only the writable root filesystem to the next instance. Snapshots expire 30 days after creation or last restore.

Daytona containers stop after 15 minutes idle by default. They keep their filesystem, can be archived to object storage at no charge, and lose their memory.

Modal Sandboxes have no pause. A sandbox ends at its timeout, 5 minutes by default and 24 hours at most, per the Sandboxes guide. Filesystem snapshots carry files to a new sandbox and now expire after 30 days by default. Memory snapshots exist but are in alpha and last 7 days, according to the snapshots guide.

The idle timer that kills a running build

Several of these platforms decide 'idle' by outside traffic, not by what runs inside. That is the failure mode to test before launch: an agent starts a 20-minute test suite, nobody calls the sandbox, and the platform stops it halfway.

  • Daytona: its sandbox docs say background scripts and long tasks without outside interaction do not reset the auto-stop timer. A task longer than 15 minutes can be stopped mid-run.
  • Cloudflare: code inside the instance does not count as activity. If no requests arrive, the instance stops when the inactivity timeout ends, even mid-build. The docs suggest an alarm that checks on the work every minute.
  • Lambda MicroVMs: the idle policy watches traffic through the MicroVM's endpoint. AWS's launch docs tell asynchronous apps to disable auto-suspend or set a suitable idle window.
  • E2B: the timeout is wall-clock, not activity-based. Connecting only ever extends it, by 5 minutes by default, and on expiry the sandbox is killed unless you chose pause.
  • Modal: an optional idle timeout treats a running exec command, stdin writes or an open tunnel connection as activity, so a build started with exec keeps the sandbox alive.

So set timeouts on purpose, keep a heartbeat for long jobs, and make the agent save work before any stop it does not control.

Isolation: microVM, VM or container

All six run untrusted code away from your app, but the boundary differs. Lambda MicroVMs, Vercel Sandbox and E2B use Firecracker microVMs, per AWS, Vercel and E2B's open-source runtime repo. Cloudflare describes each container instance as a microVM with its own kernel and network on its sandbox overview. Modal runs sandboxes on gVisor, Google's user-space kernel, or on a VM runtime with its own Linux kernel for jobs that need Docker, FUSE or nested cgroups; if you do not choose, Modal picks. Daytona's default is a container with dedicated namespaces and enforced limits, per its isolation docs, with full VMs as an option.

Isolation does not stop data leaving. If an agent can reach the internet with a token in its environment, a hypervisor will not help. Pair any of these with the controls in our guide to stopping AI coding agents leaking secrets.

Durable functions now drive MicroVMs on AWS

The Nov 25 preview adds two operations to the Durable Execution SDK for TypeScript and Python: one runs a single job in a fresh MicroVM, the other keeps a session in which jobs share files and memory. The durable function checkpoints each task, retries failures, refreshes MicroVM tokens and can drive several MicroVMs in parallel, triggered from Amazon SQS or EventBridge. AWS says developer preview features may change and should not be used in production.

Two constraints come from the parts underneath. A durable function can run for up to a year, but each MicroVM still ends at 8 hours, so a long workflow needs several sessions with state saved between them. And the extension only exists where both durable functions and MicroVMs do. If you are already weighing Lambda against containers for the agent loop itself, our AWS agent deployment guide covers that layer.

Which one fits which agent

  • Per-user sandboxes that idle for hours and must keep a running process: E2B, or Daytona's VM class. Both pause with memory and charge nothing for compute while paused.
  • AWS shops that need VPC access, IAM roles and sessions under 8 hours: Lambda MicroVMs. Turn on suspend, because the running rate is the highest in the table.
  • Short bursts of agent code that mostly waits on a model: Vercel Sandbox or Modal. Active-CPU or actual-use billing keeps the waiting cheap.
  • Apps already on Cloudflare Workers: Cloudflare Containers have the lowest idle cost here. Design for restarts, because only files survive and no run time is guaranteed.
  • Agents that also need GPUs: Modal or Daytona. For GPU pricing, see our serverless GPU comparison.

We left out Amazon Bedrock AgentCore, which hosts the agent loop rather than a general sandbox, and newer entrants such as Fly.io Sprites and Railway sandboxes, which we have not costed.

Our take

Pick on idle behaviour first and the rate second. For most coding agents the deciding question is whether a sandbox must come back with its processes still running after a long wait. If it must, E2B or a Daytona VM is the safer default, and Lambda MicroVMs fit AWS-native teams whose sessions end within 8 hours. If files are enough, Vercel Sandbox or Modal will usually cost less, because they stop charging for CPU while the agent waits. Before you commit, run one real agent session on your shortlist with the idle timer set the way production will set it, and check it survives a 20-minute build with nobody watching.

Prices and limits as of Nov 26, 2026. We will recheck them by Feb 24, 2027. Tool pages: E2B, Daytona, Vercel Sandbox, Modal, AWS Lambda and Cloudflare.

Sources

Tools covered in this guide

Frequently asked questions

Is Lambda MicroVM orchestration with durable functions ready for production?
Not yet. AWS released it on Nov 25, 2026 as a developer preview for the Durable Execution SDK for TypeScript and Python, and says preview features may change and should not be used for production workloads. Lambda MicroVMs themselves have been generally available since June 22, 2026.
Do these sandboxes charge for network traffic?
Usually, and differently. As of Nov 26, 2026, Vercel bills data a sandbox sends out plus all traffic on exposed ports, while downloads into the sandbox are free. Cloudflare Containers include 1 TB of egress a month in North America and Europe, then charge $0.025 per GB. Modal lists $0.04 per GiB of egress, and Lambda MicroVMs use standard AWS data transfer rates.
Why does Modal recommend not requesting CPU or memory for a sandbox?
Modal bills sandboxes on the higher of the requested and the used amount. With no request, a sandbox reserves 0.125 cores and 128 MiB and bursts as needed, so you pay for average use. A large request would be billed even while the sandbox sits idle.
Is gVisor isolation the same as a microVM?
No. gVisor intercepts system calls in a user-space kernel, while a microVM runs a separate guest kernel behind a hypervisor. Modal says gVisor provides strong isolation for most workloads and offers a VM runtime for jobs that need Docker, FUSE or nested cgroups.

More in Quality, cost & reliability

Share