Skip to content

Build an agent

The best sandbox for AI agents: 7 compared on isolation, idle billing and price

7 code sandboxes compared on how each isolates an agent’s code, how fast it starts, what it bills while the agent waits on a model and how long a session runs. Prices as listed on 23 November 2026.

The best sandbox for AI agents depends on how much of each hour the agent spends waiting. E2B, Daytona and Northflank bill a running sandbox’s full size, while Vercel and Cloudflare bill CPU by active time. Obsession bills its sandbox by active CPU time, at $0.12 an active vCPU hour, beside the agent’s own inbox, phone number and browser.

ComparedAI agent sandboxes comparedGo straight to the comparison
On this page
  1. What to check before you choose
  2. Sandboxes built for agents
  3. Sandboxes on a cloud platform
  4. AI agent sandboxes comparedCompared
  5. What 1,000 sandbox hours cost when the agent waits
  6. A sandbox beside the agent’s inbox and browser
  7. Which to choose, by job
  8. Questions about sandboxes for AI agents

A sandbox for AI agents is a computer in the cloud, set apart from your own systems, where an agent runs the code it writes. It installs packages, works on files and returns the result, then stops. Coding agents test their changes in one, data agents run Python on a spreadsheet, and AI labs start thousands at once to train and score models on real tasks.

These 7 services fall into 2 kinds:

  • Sandboxes built for agents: E2B, Daytona and Runloop, which sell the sandbox itself, with SDKs to start one from an agent’s code.
  • Sandboxes on a cloud platform: Modal, Vercel, Cloudflare and Northflank, which add sandboxes to compute a team may already run its app on.

What to check before you choose

  • Isolation. A microVM is a small virtual machine with its own kernel, the core of the operating system, so code in one sandbox can’t reach another through a shared kernel. A container shares the host’s kernel and adds a layer such as gVisor, a runtime from Google that intercepts the container’s calls to the kernel.
  • Start time. An agent that starts a sandbox for each step waits for every start, so milliseconds add up over a task.
  • Billing while the agent waits. An agent spends much of each hour waiting for its model to answer. Some providers bill the sandbox’s full size while it runs, and others bill CPU only while it works.
  • Session length and persistence. How long one session may run, and whether its files and memory can be paused and resumed later.
  • Concurrency. How many sandboxes can run at once, which matters most for training and evaluation runs.
  • Network access. Whether code inside can reach the internet, and whether you can turn that off.

Every service is described from its own pricing, product and documentation pages as listed on 23 November 2026, with prices in US dollars.

Sandboxes built for agents

E2B

E2B’s home page reads “The AI Agent Cloud”. Every session gets a hardware-isolated Firecracker microVM, and parts of the stack are open source, including a single-node package under Apache 2.0. Its docs say pausing saves a sandbox’s files and memory, and paused sandboxes are kept until you delete them.

  • What it does well: microVM isolation built for agents, with pause and resume that keeps memory as well as files.
  • Price as listed: on its pricing page, a running sandbox costs $0.000014 per vCPU second and $0.0000045 per GiB second. That is about $0.05 a vCPU hour and $0.016 a GiB hour, with disk free. Hobby is $0 with a one-time $100 credit. Pro is $150 a month plus usage.
  • Where it stops: sessions run 1 hour on Hobby and 24 hours on Pro, with 10 and 100 sandboxes at once.
  • Best for: agent products that start a sandbox per user or per task and want microVM isolation.

Daytona

Daytona’s pricing page promises “Sub 90ms sandbox creation from code to execution”, billed by the second. Its billing docs charge a stopped sandbox for its disk only and an archived one nothing.

  • What it does well: the fastest stated start here, and cheap storage for sandboxes kept between tasks.
  • Price as listed: $0.0504 a vCPU hour, $0.0162 a GiB hour and $0.000108 a GiB hour of storage after 5 GiB free, billed by the second. New accounts get $200 of compute with no card.
  • Where it stops: a started sandbox is billed for everything it reserves, and its GitHub repository says core development moved to a private codebase in June 2026.
  • Best for: agents that start sandboxes often and keep some of them stopped between tasks.

Runloop

Runloop’s home page reads “Your AI Agent Accelerator”. Its devboxes start a 10 GB image in under 2 seconds, run more than 10,000 at once, and snapshot and branch their disk state.

  • What it does well: large images ready fast, with snapshots for branching an agent’s work and suspend and resume.
  • Price as listed: on its pricing page, $0.108 a CPU hour and $0.0252 a GB hour of memory. Basic is free plus usage, and Pro $250 a month plus usage. A suspended devbox stops CPU and memory charges.
  • Where it stops: suspend and resume are on Pro, and the page names no concurrency limit for paid plans.
  • Best for: coding agents and evaluation teams that branch from snapshots of a repository.

Sandboxes on a cloud platform

Modal’s sandbox docs describe secure containers for untrusted code, on gVisor or on VMs with their own Linux kernel. A sandbox lives 5 minutes by default, up to 24 hours, and filesystem snapshots carry its state further.

  • What it does well: sandboxes on the same account as GPUs and functions, for teams running models and code side by side.
  • Price as listed: on its pricing page, $0.00003942 per physical core second, a core being 2 vCPUs on its FAQ, and $0.00000667 per GiB second, billed at non-preemptible rates of 3 times list price. Starter is $0 plus compute with $30 of monthly credit.
  • Where it stops: it bills the higher of what a sandbox requests and what it uses, and a session runs 24 hours at most.
  • Best for: teams already running models or batch jobs on Modal.

Vercel Sandbox

  • What it does well: it bills Active CPU, time the code uses the processor, so time spent waiting on a model call doesn’t count. Persistent sandboxes resume after a stop, and Pro runs 10,000 at once.
  • Price as listed: Pro charges $0.128 an active CPU hour and $0.0212 a GB hour of memory, against Pro’s $20 monthly credit. Hobby includes 5 active CPU hours a month.
  • Where it stops: memory is billed for the whole time it is provisioned, and a session runs 45 minutes on Hobby and 24 hours on Pro.
  • Best for: apps already on Vercel whose agents wait on model calls most of the time.

Cloudflare Sandboxes

  • What it does well: sandboxes on Cloudflare run untrusted code in Linux virtual machines or isolated Workers, with preview URLs for apps the code serves.
  • Price as listed: on the Workers Paid plan at $5 a month, Containers pricing charges $0.000020 per vCPU second of active use, about $0.07 an hour, and $0.0000025 per GiB second of memory. The plan includes 375 vCPU minutes and 25 GiB hours a month.
  • Where it stops: memory and disk are billed on the size provisioned, and each sandbox also runs on Durable Objects and Workers, billed separately.
  • Best for: teams whose app already runs on Cloudflare Workers.

Northflank

Northflank’s sandbox page reads “Secure microVM sandboxes for untrusted code”. Each sandbox gets its own guest kernel on Cloud Hypervisor, is ready in 0.8 seconds with a cached image, and runs with no time limit until you delete it. Northflank says more than 50,000 can run at once, in its cloud or in your own cloud account.

  • What it does well: the lowest compute rate here, microVM isolation and sessions that run for weeks.
  • Price as listed: on its pricing page, $0.01667 a vCPU hour and $0.00833 a GB hour, billed by the second. A free tier includes up to $20 of resources a month with no card.
  • Where it stops: a running sandbox is billed for its full size, whether its code is busy or waiting.
  • Best for: long-running sandboxes, and teams that need sandboxes inside their own cloud account.

AI agent sandboxes compared

We make Obsession, so every other option is described from its provider’s own pages as of 23 November 2026.

OptionWhat it does wellPriceWhere it stopsBest for
Your own containers on a serverFull control, no per-second feeYour servers and your team’s hoursIsolation, scaling and clean-up are yours to runTrusted code at low volume
Built for agentsE2B, Daytona, RunloopFast starts, pause or snapshots, SDKs for agentsE2B: about $0.05 a vCPU hourDaytona: $0.0504 a vCPU hourRunloop: $0.108 a CPU hourE2B: 24-hour sessions on ProDaytona: full size billed while startedRunloop: suspend on ProAgent products starting a sandbox per task
On a cloud platformModal, Vercel, Cloudflare, NorthflankSandboxes beside compute the team already runsModal: $0.00003942 a core secondVercel: $0.128 an active CPU hourCloudflare: about $0.07 an active vCPU hourNorthflank: $0.01667 a vCPU hourModal: 24 hours at mostVercel: memory billed while provisionedCloudflare: Workers Paid requiredNorthflank: full size billed while runningTeams already on that platform
ObsessionOursSandbox, Email, Browser, Train and test agentsA sandbox billed by active CPU time, beside the agent’s inbox, number and browser, every run in one event logFree, then $20, $99 or $499 a month; usage per pieceSays it’s an AI to a person; stops before payment unless given your cardAgents that work on the files their inbox and browser bring in
Sandboxes for AI agents. Prices in US dollars from each provider’s own pages, as listed on 23 November 2026

What 1,000 sandbox hours cost when the agent waits

An agent that calls a model on every step leaves its sandbox idle for much of each hour. Vercel’s own cost examples assume the CPU is busy 10% of the time for that reason. Taking a sandbox of 2 vCPUs and 4 GiB, the size Vercel’s own examples use, here is what 1,000 hours cost at each provider’s listed rates:

ProviderCPU busy 10% of the timeCPU busy all the timeWhat is billed while it runs
Cloudflare$50$180CPU when active, memory as provisioned
Northflank$67$67vCPUs and memory, the full size
Obsession$84$300CPU when active, memory per GiB hour
Vercel$110$341CPU when active, memory as provisioned
E2B$166$166vCPUs and memory, the full size
Daytona$166$166Everything the sandbox reserves
Modal$238$238The higher of request or use, 1 core = 2 vCPUs
Runloop$317$317CPU and memory, the full size
Example inputs: 2 vCPUs and 4 GiB of memory for 1,000 hours. Listed rates on 23 November 2026, before plan fees, credits and included amounts. Each provider sets the sizes it offers, so the nearest size sets the real bill

The busy share decides the ranking. A reinforcement learning run can reach 1 million sandbox hours a month. At that scale and 10% busy, the same rates run from about $50,000 on Cloudflare to $317,000 on Runloop, with Obsession at $84,000. A sandbox that compiles or trains all hour costs least on Northflank, E2B and Daytona.

A sandbox beside the agent’s inbox and browser

Much of an agent’s code runs on something that just arrived: a CSV attached to an email, a PDF statement downloaded from a portal, a spreadsheet a supplier sent back. When the sandbox sits beside the inbox and the browser, the file moves from one to the other without another vendor, and every step lands in the same log.

A report arrives by email, code runs on it in a sandbox, and the rows that don’t match go out, before anyone starts work. Fenwick is an invented company.

Obsession is the toolkit for AI agents: phone numbers, inboxes, browsers and sandboxes on one API and one bill. Its code sandbox for AI agents is a Linux computer that starts when a task needs it and stops when the task ends. Python and Node are ready, pip, npm and apt work as they do on your own machine, and the internet stays off until you allow it. Each sandbox is set apart from the others and from your systems, and every run lands in the event log beside the emails, texts and pages that led to it.

  • obsession.sandboxes.create() starts a computer for one task. sandbox.run("python report.py") runs the agent’s code on it.
  • sandbox.finished reaches your webhook, an address in your app that receives each result as it lands.
  • obsession.personas.create({ inbox: true, phone: "US", browser: true }) gives the same agent an inbox, a number and a browser under one identity.

A sandbox is $0.12 an active vCPU hour, billed while the CPU works, and memory $0.015 a GiB hour. The Free plan includes 10 active vCPU hours (every rate). For training and evaluation, Train and test agents gives each run its own sandbox, browser, inbox and number, started when it needs them. Every step lands in the event log, ready to score and replay.

Which to choose, by job

Use Obsession when your agent runs code on what its inbox or browser brings in, or when each training run needs a real inbox, number and browser as well as a computer. For the sandbox alone:

  • MicroVM isolation for an agent product: E2B, with pause and resume that keeps memory.
  • The fastest stated start: Daytona, under 90 milliseconds from code to execution.
  • Snapshots of large repositories for coding agents: Runloop.
  • Agents that mostly wait on a model: Vercel or Cloudflare, which bill CPU by active time.
  • Sandboxes that run for weeks, or inside your own cloud account: Northflank.
  • Models and code on one account: Modal.

RL environments for LLMs explains how reinforcement learning (RL) training uses sandboxes, and how to test AI agents sets out evaluation runs step by step. An agent that also signs in to sites needs the best browser for AI agents, and the AI agent infrastructure stack maps every layer. AgentMail, Twilio, Browserbase and E2B in one API prices 4 bills against one.

Questions about sandboxes for AI agents

It depends on how much of each hour the agent waits. E2B and Northflank give microVM isolation, Daytona states the fastest start, and Vercel and Cloudflare bill CPU by active time. Obsession bills its sandbox by active CPU time and runs it beside the agent’s own inbox, number and browser, with every run in one event log.

It gives the agent a computer, set apart from your systems, to run the code it writes. The agent installs packages, works on files and returns the result, and the sandbox stops when the task ends.

A code sandbox for AI agents

As listed on 23 November 2026, Vercel bills Active CPU and Cloudflare bills vCPU on active use, with memory billed as provisioned at both. Obsession bills its sandbox by active CPU time. E2B, Daytona, Northflank and Runloop bill a running sandbox’s full size.

On their own pages, Daytona states under 90 milliseconds from code to execution and Northflank 0.8 seconds with a cached image. Runloop starts a 10 GB image in under 2 seconds. E2B says its sandboxes boot from a snapshot.

E2B runs 1 hour on Hobby and 24 on Pro, Modal up to 24 hours, and Vercel 45 minutes on Hobby and 24 hours on Pro. Northflank sets no time limit. E2B and Runloop can pause or suspend a sandbox and resume it later.

E2B publishes parts of its stack as open source, including a single-node package under Apache 2.0. Daytona’s repository stays free to fork, but it says core development moved to a private codebase in June 2026.

ShareLinkedInX

Sources

In the order the article cites them. Every link was checked on 23 Nov 2026.

  1. E2B home pageE2B
  2. E2B documentationE2B
  3. PricingE2B
  4. PricingDaytona
  5. BillingDaytona documentation
  6. daytonaGitHub
  7. Runloop home pageRunloop
  8. PricingRunloop
  9. SandboxesModal documentation
  10. PricingModal
  11. Reserving CPU and memoryModal documentation
  12. Vercel Sandbox pricing and quotasVercel documentation, 10 Sep 2026
  13. Sandboxes on CloudflareCloudflare documentation
  14. Containers pricingCloudflare documentation
  15. SandboxesNorthflank
  16. PricingNorthflank

What should your first AI agent do?