Rent or Self-Host an AI Agent Sandbox? An Operator's Rubric (E2B, Modal, Daytona)
A neutral rubric for choosing an AI agent sandbox: isolation, cold start, cost, egress and the real self-host story for E2B, Modal and Daytona.
Rent an AI agent sandbox (E2B, Modal, Daytona, Vercel Sandbox) when you want speed and low ops; self-host when data residency, egress control, or steady volume justify running KVM nodes yourself. For isolation, microVMs (Firecracker) give each sandbox its own kernel; gVisor intercepts syscalls in user space. As of November 2026, E2B ships an Apache-2.0 self-host runtime; Modal's sandbox docs describe a hosted service and do not document a self-host path; Daytona's public open-source repo is no longer maintained.
That last sentence is the reason this page exists. Comparison pages still blur what "self-host" means for each vendor. For Daytona, its own public repository, re-read on 16 November 2026, settles the question.
Why agent code needs a sandbox at all
An agent that can write and run code is an untrusted program with your credentials nearby. If that program runs on the same kernel, filesystem, and network as the rest of the machine, a bad tool call can read secrets, reach production, or delete the workspace it was asked to fix. A sandbox gives the agent a place to execute that is isolated from the host and from other tenants, with its own filesystem, a tighter network, and a lifetime you can cap.
This page is the "where does the code run?" decision, not a full blast-radius playbook. For the permission boundary around tools and servers, see permission boundaries for cross-server commands and agent firewalls in production. For a reminder of what happens when a control-plane secret is in the wrong place, see the LiteLLM 1.107.0 compromise.
Isolation in one table: containers vs gVisor vs microVMs
The isolation model is the first rubric score because it decides what a breakout can still reach. The rows below follow how vendors describe these mechanisms in the primary docs cited in the vendor scan — not from a Tacavar benchmark.
| Model | Where the kernel lives | What the boundary is | What it stops, and what it doesn't |
|---|---|---|---|
| Ordinary containers | Shared host kernel | Namespaces and cgroups | Separates processes and filesystems from other containers on the same kernel. It does not give the workload its own kernel. Vercel's concepts page contrasts this with microVMs and notes that container escapes remain a concern for untrusted code. |
| gVisor | A kernel in user space | Intercepts system calls before they reach the host kernel | Stronger than a shared-kernel container for many workloads. Modal's sandbox docs describe gVisor as "a container runtime developed by Google" that "provides strong isolation and is suitable for most workloads." Northflank's product page describes it as "a user-space kernel that intercepts system calls," and uses it for GPU sandboxes. |
| microVMs (Firecracker, Kata, Cloud Hypervisor) | A dedicated guest kernel per sandbox | Hardware virtualization / hypervisor boundary | Each sandbox gets its own kernel and filesystem. Vercel's security model: "Each sandbox runs in its own Firecracker microVM with a dedicated kernel." E2B Embed describes the same Firecracker isolation as E2B Cloud. This is the stronger default for untrusted agent code. Sandboxes on the same host can still share physical hardware; Vercel documents hardware side channels as a residual property of that sharing. |
If a vendor offers more than one runtime, read which workloads land on which runtime — especially GPUs. Modal's docs, re-read on 16 November 2026, say "GPU Sandboxes are only supported with runtime=\"gvisor\"."
The rubric (score 1–5)
Score each option yourself. A "5" means the product, as documented, fits that criterion for your threat model; a "1" means it does not, or the docs do not say. Do not copy a vendor's own scorecard as if it were independent.
- Isolation model. Shared kernel, gVisor, or a dedicated guest kernel? Can you choose the runtime, and what happens for GPUs?
- Cold start. Use the vendor's claimed start time and label it as a claim. We did not independently measure latency for this page.
- Cost model. Per-second versus reserved, what counts as idle, and whether storage and egress are separate line items. Link the official pricing page and read it on the day you buy; this article does not quote prices.
- Egress and secret controls. Can you deny outbound network, allowlist CIDRs or domains, and inject secrets so the workload never sees a long-lived key? Modal documents
block_networkand outbound allowlists on its sandbox networking page; Vercel documents a sandbox firewall and network policies. Confirm the equivalent on any other vendor before you score it. - Session length cap. What is the default lifetime, what is the maximum, and what happens if you need longer — snapshot and restore, or a hard stop?
- Persistence and pause. Can you pause and resume, snapshot the filesystem, or attach a volume that survives the sandbox?
- GPU need. Is GPU available in the sandbox, and which isolation model does it actually run under?
- Self-host / BYOC reality. Does "run it in my cloud" mean the control plane stays with the vendor, or can you run the control plane yourself? These are different products.
- Licence and repo health. Is there a current public runtime, under what licence, and is the public repo still maintained?
Vendor scan (checked 16 November 2026)
The table is a point-in-time read of primary docs, not a benchmark and not a ranking. Third-party or vendor-authored comparisons are called out under the table, not used as the source of the claims in it.
This comparison is general information, not financial advice. The article does not quote vendor prices; hosted, BYOC, and self-host costs change, so confirm current pricing and terms with each vendor. Choosing a runtime does not remove operational, security, or compliance risk.
| Vendor | Isolation (as documented) | Hosted / BYOC / self-host | Session and other limits (as documented) | Primary sources, checked 16 Nov 2026 |
|---|---|---|---|---|
| E2B | Firecracker microVMs. E2B's "Introducing E2B Embed" post (30 September 2026) says every sandbox is a Firecracker microVM, "using the same VM isolation as E2B Cloud." | Three documented paths: E2B Cloud; BYOC (Enterprise only, on AWS, Google Cloud, and Azure — a managed deployment in your VPC, not self-hosting); and E2B Embed, an Apache-2.0 self-host runtime you install on one Linux machine with KVM (Docker Compose, Terraform on GCP/AWS/Azure, or Kubernetes). See E2B's BYOC page. | Embed is a single-machine product; E2B says if you need to scale across machines, or want E2B to operate the deployment in your account, that is BYOC. The Embed README documents sandboxes "paused and resumed on demand," the same as E2B Cloud. No prices quoted here — see E2B pricing. | e2b-dev/runtime (Apache-2.0); embed/README.md; docs.e2b.dev/byoc. The older e2b-dev/infra URL now returns Moved Permanently. |
| Modal | Two runtimes: gVisor, which Modal says "is suitable for most workloads" (leave the runtime unset and Modal chooses), and a VM runtime that "run[s] the Sandbox in a virtual machine with its own Linux kernel." GPU sandboxes are only supported with runtime="gvisor". |
The sandbox guide describes a hosted Modal service. It does not document a self-host or BYOC path. We did not find one on that page and are not inferring one from third-party comparisons. | "Sandboxes have a default maximum lifetime of 5 minutes. You can change this by passing a timeout of up to 24 hours." For work beyond 24 hours, Modal recommends filesystem snapshots and a subsequent sandbox. Idle timeouts are optional. See Modal pricing; no prices quoted here. |
modal.com/docs/guide/sandboxes, re-read 16 November 2026. |
| Daytona | Daytona's sandbox docs say each sandbox "runs in isolation, giving it a dedicated kernel, filesystem, network stack, and allocated vCPU, RAM, and disk." The docs we opened do not name the virtualization technology. | Managed service, plus Bring Your Own Compute: "run sandbox workloads on your own infrastructure while using Daytona's control plane to manage them." BYOC "must be enabled for your organization." The public GitHub repo is not a supported self-host of the current control plane. The README, re-read 16 November 2026, says the repository "is no longer maintained" and that "as of June 2026, Daytona's core development has moved to a private codebase." It remains "public and free to use, fork, and build on under the LICENSE, as is and without support or warranty." The repo was archived at check time. Last public tag: v0.190.0, GNU AGPL v3. |
See Daytona pricing; no prices quoted here. Do not treat the last public tag as a currently maintained self-host product. | github.com/daytonaio/daytona README and v0.190.0 LICENSE; BYOC docs. |
| Vercel Sandbox | Firecracker microVM with a dedicated kernel, private filesystem, and network namespace isolation, per Vercel's concepts and security model pages. | The security model page states: "Sandboxes run on Vercel's infrastructure." Those docs describe a managed Vercel service, including Secure Compute / VPC peering for network path, not a customer-cloud or self-host runtime. We did not find a self-host or customer-cloud install path in the Vercel Sandbox docs we opened. | Automatic timeouts are documented; persistence and snapshots are documented as a product feature. See Vercel Sandbox pricing; no prices quoted here. | vercel.com/docs/sandbox, concepts, and security model, re-read 16 November 2026. |
| Northflank | Product page: microVMs ("a dedicated guest kernel per sandbox, with hardware virtualisation") or gVisor; "gVisor for GPU workloads." In a customer's own cloud, Northflank's docs say you install both the microVM (Kata Containers) and gVisor runtimes and choose the runtime yourself. MicroVM isolation needs hardware support (bare metal or nested virtualization). | Northflank Cloud, or sandboxes in your own cloud account (AWS, GCP, Azure, or other). The customer-cloud docs say your data and compute stay inside your infrastructure and you pay your cloud provider for the underlying resources. | Pausing, resuming, volumes, and GPU node pools are documented for the customer-cloud path. See Northflank pricing; no prices quoted here. | northflank.com/product/sandboxes and the customer-cloud docs, re-read 16 November 2026. |
Where the comparisons disagree
Comparison pages that rank "best code execution sandboxes" are useful context, but most are written by a vendor in the list. Treat them as vendor-authored or third-party commentary, and prefer the primary sources above.
- E2B's "best code execution sandboxes" resource is vendor-authored.
- Northflank's Daytona-alternatives post and related Northflank comparison posts are vendor-authored.
- Bex's Daytona vs E2B self-hosted comparison is a third-party post. Its claim that a Daytona BYOC runner still uses Daytona's control plane is consistent with Daytona's own BYOC docs, which we verified on the primary page rather than taking Bex as the source.
- Clarion Street's Daytona archive note is a third-party post. The last public tag (
v0.190.0) and the AGPL-3.0 licence were verified on GitHub, not taken from that post.
The disagreement is usually a category error. "BYOC" is not the same as "self-host." E2B documents all three: Cloud, BYOC (E2B operates a cluster in your VPC), and Embed (you operate one machine). Daytona documents BYOC as your runners plus Daytona's control plane. Modal's sandbox docs, as of this check, document a hosted service only. If a comparison still lists the June 2026 Daytona public repo as a living self-host product, it is out of date.
When to rent
Rent a managed sandbox when you want to ship agent-executed code without standing up KVM nodes, on-call, and a control plane. That is the right default when volume is still low or bursty, you do not need GPUs on your own premises, and data residency does not force the workload into a VPC you operate. Pick the hosted option whose isolation model matches the risk, then read the session cap, snapshot story, and egress controls on the official docs the day you buy.
When to self-host
Self-host — in the narrow sense of running the runtime yourself, not merely attaching runners to a vendor control plane — when at least one of these is true:
- Data residency or a regulated boundary requires the templates, snapshots, logs, and sandbox traffic to stay on machines you operate.
- You need egress and secret policy you can enforce without sending sandbox traffic through a vendor network you do not control.
- Volume is high and steady enough that owning KVM capacity is cheaper than paying hosted premium, after you include people.
- You need the control plane itself in your infrastructure, not only the runner.
The real cost of self-hosting is not the licence. E2B Embed is Apache-2.0 and needs no E2B account. The cost is a Linux host with hardware virtualization, capacity planning, upgrades, and someone on-call when a node or a nested-virtualization flag misbehaves. E2B is explicit that Embed is one machine: its Embed post says that if you need to scale across machines, that is BYOC. Running the last public Daytona tag is possible under its licence, as-is and without support; it is not the same as running today's Daytona product.
Decision flow
Work through these five questions in order. Stop when the answer decides the path.
- Does untrusted agent code need a dedicated guest kernel? If yes, shortlist microVM options (E2B, Vercel Sandbox, Northflank microVMs, Modal's VM runtime for CPU, Daytona's managed/BYOC product as they document it). If you need a GPU, re-read that vendor's GPU isolation line — Modal's GPU sandboxes are gVisor-only; Northflank documents gVisor for GPU workloads and, in customer cloud, a choice of runtimes with hardware caveats.
- Must templates, snapshots, logs, and sandbox traffic stay inside infrastructure you operate? If no, rent. If yes, go to question 3.
- Is it enough for the workloads to run in your VPC while the vendor still operates the control plane? If yes, that is BYOC (E2B Enterprise BYOC; Daytona BYOC; Northflank customer cloud). If the control plane must also be yours, go to question 4.
- Is there a currently maintained self-host runtime you are willing to operate, including KVM nodes and on-call? As of 16 November 2026, E2B Embed is the documented, Apache-2.0, still-maintained path in this set. Modal's sandbox docs do not describe one. Daytona's public repo is no longer maintained.
- Can you live with the session cap, persistence model, and egress controls on the option that survived questions 1–4? If the official docs do not answer those points on the day you buy, do not invent the answer.
Where Tacavar fits
This page is a buyer's rubric, not a description of our own sandbox setup.
What we will say is the operator job around the sandbox: who can run untrusted code, which isolation model is required, which actions still need a human gate, and who is on the hook when a session, a node, or an egress rule fails. Current Tacavar plans are on the offer page. The shorter decision checklist is the Governed AI Ops buying guide. If you want a first external read on how visible your AI-facing surfaces are, start with the free GEO scan.
FAQ
Is Docker enough to sandbox an AI agent? Usually not, if the agent is writing and running untrusted code. A Docker container typically shares the host kernel and relies on namespaces and cgroups. That is fine for packaging trusted software. For agent-generated code, prefer a dedicated guest kernel (a Firecracker or other microVM) or, at minimum, a documented stronger boundary such as gVisor, and still restrict egress and secrets.
microVM vs gVisor? A microVM gives the sandbox its own guest kernel behind a hypervisor boundary. gVisor intercepts system calls in a user-space kernel and does not give the workload a full dedicated kernel. Vendors use both; the right question is which runtime your workload, including any GPU, actually lands on. Modal, for example, documents GPU sandboxes as gVisor-only as of 16 November 2026.
Can you self-host Daytona? Not as a currently maintained open-source product. Daytona's public GitHub repository, checked on 16 November 2026, states that it is no longer maintained and that as of June 2026 core development moved to a private codebase. The last public tag is v0.190.0, licensed under GNU AGPL v3, and remains usable as-is without support or warranty. Daytona's current "run it on my machines" path is Bring Your Own Compute, which uses Daytona's control plane to manage runners in your infrastructure and must be enabled for your organization.
Can you self-host E2B? Yes. E2B Embed is an Apache-2.0 runtime, documented in the public e2b-dev/runtime repository, that runs the E2B stack on one Linux machine with KVM — via Docker Compose, Terraform on GCP, AWS, or Azure, or Kubernetes. No E2B account or licence key is required. That is different from E2B BYOC, which is an Enterprise-only managed deployment in your VPC, operated by E2B, not self-hosting.