Benchmarks7 min read

10 AI Code Sandboxes Compared

Compare how agents use ten code sandboxes through SDKs, CLIs, and MCP, along with session limits, startup times, and hourly costs.

Alan ZabihiCo-founder & CEO
XLinkedIn

Our January benchmark covered seven providers. This edition adds Azure Container Apps Sandboxes and the managed code interpreters from AWS and Google Cloud. The Blaxel entry now covers Baseten Sandboxes, which the Blaxel team launched after joining Baseten.

An agent often needs to run a command, read the output, and decide what to do next in the same sandbox. We compared the interfaces that let it do that, alongside session limits, startup times, and hourly costs.

At a glance

Provider Good fit Entry plan or allowance
Modal Python orchestration and GPU sandboxes $30/month in Starter compute credits (plans)
E2B Template-based sandboxes with CLI controls $100 one-time Hobby credit (plans)
Daytona 2.0 Persistent workspaces managed from a CLI $200 one-time Starter credit (plans)
Cloudflare Apps built on Workers $5/month Workers Paid, with included usage (plan)
Vercel Named workspaces an agent can manage over MCP Hobby includes 5 active CPU hours/month (plans)
Beam CPU tier choice and self-hosting $20/month Developer, with $20 in monthly credits (plans)
Baseten Fast standby resume and per-sandbox MCP Usage-based (pricing)
AWS Code Interpreter Managed code execution through an SDK or MCP Usage-based (pricing)
Azure Sandboxes Persistent workspaces with CLI controls Usage-based (pricing)
Google Code Execution Analysis and scripting with reusable state Usage-based (pricing)

Feature comparison

SDKs, CLIs, and MCP

An app can use an SDK or API to manage a sandbox. An agent with a terminal can use a CLI, and an agent with a Model Context Protocol (MCP) client can call sandbox tools by name.

The table uses provider docs and tool catalogs for operations such as starting a session, running code, and reading files. A dash means we found no first-party sandbox interface in that column.

Provider SDK or API CLI MCP
Modal Python, JS/TS (beta), Go (beta) Modal Shell opens a sandbox, attaches to an existing one, or runs a command. —
E2B Python and JS/TS E2B CLI creates, attaches, runs commands, reads logs, pauses, and resumes. Code Interpreter MCP is archived. MCP Gateway brings external tools into a sandbox.
Daytona 2.0 Python, TypeScript, and Go Daytona CLI creates sandboxes, runs commands, and manages their lifecycle. MCP docs list sandbox, file, and process tools. Setup is documented for v0 and unconfirmed for v2.
Cloudflare TypeScript Wrangler opens SSH or runs a command in a running Container. Hosted Container Sandbox server starts ephemeral containers, runs commands, and handles files. Work in progress.
Vercel Python and JS/TS Vercel CLI creates, connects, runs commands, and stops sessions. Hosted Vercel MCP creates and resumes named sandboxes, runs commands, reads logs, handles files, and stops sessions.
Beam Python and TypeScript Beam CLI manages persistent VMs. Disposable Sandboxes use the SDK. Workspace MCP lists tools for persistent VMs.
Baseten Python, TypeScript, and Go Pre-release CLI creates and deletes sandboxes, opens a shell, and runs commands. Per-sandbox MCP exposes commands and files in an existing sandbox.
AWS Code Interpreter Python, TypeScript, and API AWS CLI starts, inspects, lists, and stops sessions. AWS Labs' locally launched server manages sessions, runs code or shell commands, and transfers files.
Azure Sandboxes Python, TypeScript, .NET, and REST ACA CLI (preview) creates and deletes sandboxes and runs commands. Azure's hosted execution MCP belongs to its separate Dynamic Sessions product.
Google Code Execution Python and REST gcloud is for setup. Sandbox operations use the SDK or REST. Agent Platform MCP lists notebook tools. Code Execution sandbox tools are undocumented.

Runtime and startup

Providers time different events, from booting a cached image to completing the first command. Baseten also reports how long it takes to wake an existing sandbox from standby.

Provider Session limit or expiry Published startup figure
Modal Up to 24 h (limits) Under 1 s, including custom images (product)
E2B 1 h on Hobby, 24 h on Pro (plans) 150–170 ms to start a new VM in one customer case (case study)
Daytona 2.0 24 h on Starter, 48 h on Team (plans) Under 90 ms from code to execution (quickstart)
Cloudflare Idle timeout up to 6 h (lifecycle) 648 ms median to first command in a 100-sandbox burst with the beta scheduler (test)
Vercel 45 min on Hobby, 24 h on Pro and Enterprise (limits) 700 ms median creation with Drives (changelog)
Beam 10 min by default, with a manual stop option (config) 680 ms median to first command with cached images in Beam's 100-sandbox test (test)
Baseten Configurable expiry, 7 days by default (lifecycle) Under 1 s for a fresh start, about 25 ms to resume (product)
AWS Code Interpreter 15 min by default, up to 8 h per session (API) No numeric figure published (announcement)
Azure Sandboxes Configurable idle suspend (lifecycle) Under 1 s from a cached image (overview)
Google Code Execution Up to 14 days of state retention (overview), 5 min per call (limit) Up to 2 min for initial provisioning (docs)

GPUs, state, and images

A dash means the provider's docs leave support unspecified. BYOC stands for bring your own cloud.

Provider GPU Self-host or BYOC State and images
Modal Yes — Snapshots and volumes, custom images
E2B No Self-host, BYOC Pause and resume, custom templates
Daytona 2.0 Yes Enterprise BYOC Persistent VMs, OCI images
Cloudflare — — R2 mounts, filesystem snapshots in beta, container images
Vercel No — Drives, filesystem snapshots, registry images
Beam Yes Self-host Snapshots, volumes and custom images
Baseten — — Full-state snapshots, custom images
AWS Code Interpreter — — Session files, S3 Files and EFS mounts, managed runtimes
Azure Sandboxes — — Memory and disk snapshots, volumes, OCI images
Google Code Execution — — Session state, separate custom-image sandbox type

Pricing for one active hour

We checked the rate cards on December 3, 2026. Each estimate assumes one vCPU busy for the full hour and 2 GiB of RAM, or 2 billed GB where the provider uses GB. Figures are in USD before credits, plan fees, egress, and optional storage.

Provider CPU rate per hour RAM rate per hour Estimated cost
Modal $0.1419 / physical core $0.0240 / GiB $0.1190
E2B $0.0504 / vCPU $0.0162 / GiB $0.0828
Daytona 2.0 $0.1010 / physical core $0.0162 / GiB $0.0829
Cloudflare $0.0720 / active vCPU $0.0090 / GiB $0.0905
Vercel (iad1) $0.1280 / active vCPU $0.0212 / GB $0.1704
Beam Performance $0.0500 / vCPU $0.0100 / GiB $0.0700
Baseten $0.0655 / vCPU $0.0211 / GiB $0.1077
AWS Code Interpreter (N. Virginia) $0.0895 / used vCPU $0.00945 / used GB $0.1084
Azure Sandboxes (East US) $0.0864 / vCPU $0.0108 / GiB $0.1080
Google Code Execution $0.0850 / vCPU $0.0090 / GiB $0.3760 at 4 vCPU / 4 GiB
  • Modal and Daytona use half a physical core for the 1-vCPU estimate. Daytona uses its lowest on-demand rate on a host with simultaneous multithreading enabled. Modal rates · Daytona rates
  • The Cloudflare estimate includes 2 GB of provisioned disk on a custom instance. Azure uses the default M size. The default Google Code Execution size has 1.5 GiB of RAM, so we priced the 4 vCPU and 4 GiB option. Cloudflare sizing · Azure sizes · East US meters · Google machine sizes
  • AWS meters active CPU and peak memory, including system overhead. Beam's Shared tier costs $0.0220 per hour for the same size, and its preemptible Spot tier costs $0.0090. AWS billing · Beam rates

Between tasks, Vercel still bills for memory while the sandbox is running. E2B stops compute charges when you pause the sandbox. Google bills while a Code Execution sandbox exists, with an expiry you can set at creation. Vercel billing · E2B lifecycle · Google lifecycle and billing


Recommendations by use case

Steering a sandbox from an agent

Use Vercel if the agent needs to create and resume named sandboxes over MCP, subject to the tools available to its client and team. Baseten fits when your app provisions the sandbox and the agent only needs commands and files. If the agent already has terminal access, the E2B and Daytona CLIs can both create a sandbox and run follow-up commands in it. Vercel tool access · Baseten sandbox APIs · E2B CLI · Daytona CLI

Coding agents and dev environments

Start with E2B if you want to package the agent's dependencies in a template. Daytona gives you a workspace you can stop and restart with its disk intact. For agents that pick up work between turns, Baseten's standby restores memory and running processes. E2B templates · Daytona Linux VMs · Baseten lifecycle

GPU workloads and batch jobs

Modal and Beam run GPU sandboxes. Beam also gives CPU-only jobs a choice of Shared, Performance, or preemptible Spot. Use Spot for jobs that can restart after an interruption. Modal resources · Beam CPU tiers

Apps already on a cloud platform

Cloudflare fits Workers apps that manage workspaces with Durable Objects. Vercel supports persistent files through Drives. AWS and Google offer managed code interpreters for analysis and scripting. Use Azure when you need to bring an OCI image and control when the sandbox suspends and resumes. Cloudflare · Vercel · AWS · Google Cloud · Azure

Before you pick a sandbox

Run one of your own tasks through the interface your agent will use. Check that it can read the result and run a follow-up command. If the task spans user turns, leave the sandbox idle for that interval and check what survives when it resumes. Stop the session and price the full cycle with the provider's billing rules.

Last updated December 3, 2026

Join our newsletter

Updates on securing code and agents, vulnerability research, and product news.