Guide #28 Act 6 — Strategic Context 16 min read March 2026

Build vs Buy:
AI Agent Infrastructure in 2026

You could build your own sandbox infrastructure with cloud containers, Firecracker, or Kubernetes. Here's what that looks like: 3–6 months and a dedicated platform team. Or you could use a managed platform and ship next week. Honest comparison with E2B, Modal, Daytona, Fly.io, and Runloop.

The decision every team faces

Your engineering team wants AI agents. The agents need compute: sandboxes for code execution, browsers for web automation, desktops for GUI applications. The question is where that compute comes from.

Three options:

  1. Build it yourself on AWS/GCP with EC2, cloud containers, and custom orchestration.
  2. Use a sandbox-as-a-service platform (E2B, Modal, Daytona, Runloop, or us).
  3. Use the agent's built-in compute (Devin's sandbox, Codex's containers, Cursor's cloud VMs).

Each has tradeoffs. This guide is honest about all three — including where we're not the right choice.

Option 1: Build it yourself

What it takes

Building AI agent infrastructure from scratch means building a sandbox orchestration layer. Here's the bill of materials:

ComponentWhat you buildEffort
Compute provisioningEC2 launch automation, cloud container definitions, security groups, VPC config2–4 weeks
Lifecycle managementStart, stop, reboot, delete. Auto-stop on idle. Health checks.2–3 weeks
Browser containersChrome/Firefox in cloud containers, CDP exposure, proxy routing, session management3–6 weeks
Desktop containersXFCE/KDE in cloud containers, VNC access, noVNC proxy, display server3–6 weeks
Warm poolsPre-provisioning, health recycling, claim/release, state machine3–4 weeks
SSH accessKey management, certificate authority, short-lived certs1–2 weeks
File I/OUpload/download API, multipart handling, workspace tarballs1–2 weeks
Command executionExecute API, stdout/stderr capture, WebSocket terminal1–2 weeks
Cost trackingPer-sandbox billing, per-user limits, monthly reports2–3 weeks
Multi-tenancyOrg isolation, RBAC, cross-tenant prevention2–4 weeks
Proxy & networkingDNS routing, session tokens, forward-auth, TLS termination2–4 weeks
Audit loggingImmutable log, SIEM export, compliance reporting1–2 weeks
Total 23–42 weeks (6–10 months)

Plus ongoing maintenance: security patches, AWS API changes, scaling issues, on-call. Expect 0.5–1 FTE of permanent platform engineering time.

When to build

When not to build

If you're building agent infrastructure so your team can run Claude Code on cloud VMs, you're spending 6 months and $200K+ in engineering time to solve a problem that a managed platform solves in an afternoon. The opportunity cost — 6 months of your platform team not building your actual product — is the real expense.

Option 2: The managed platform landscape

The sandbox-as-a-service market has grown fast since 2024. Here's the honest comparison as of March 2026:

PlatformFocusTerminalBrowserDesktopWarm poolsPersistent storagePricing model
E2B Code execution sandboxes Yes No No Yes Limited Per-second compute
Modal Serverless compute (ML focus) Yes No No Yes Volumes Per-second compute
Daytona Dev environments Yes No No No Yes Per-workspace
Fly.io App deployment (Machines API) Yes DIY No No Volumes Per-second compute
Runloop AI agent sandboxes Yes Beta No Yes Yes Per-second compute
Sandbox Platform (us) Full AI workstation Yes Yes (6 types) Yes (4 types) Yes Yes Per-second compute

Where each platform wins

E2B

Best-in-class for pure code execution sandboxes. Fastest cold start in the market (~300ms for their Firecracker-based VMs). Strong Python/TypeScript SDK. If your agents only need to execute code in a terminal and you don't need browsers or desktops, E2B is a strong choice. Raised $14.4M, well-funded, growing fast.

Modal

Best for ML/GPU workloads. Native GPU scheduling, container image caching, and a Python-first SDK that makes serverless GPU feel native. If your primary use case is ML inference or training, Modal is purpose-built for it. Not designed for interactive agent workloads (no SSH, no browser, no desktop).

Daytona

Open-source, self-hostable dev environments. Best if you want to run the platform on your own infrastructure with full control. Devcontainer-compatible. Doesn't have browser or desktop containers — it's focused on coding environments.

Fly.io

General-purpose container hosting with the Machines API for programmatic lifecycle control. Cheapest option for always-on VMs. You can build browser/desktop support yourself using their containers, but it's DIY. Best if you want low-level control and don't mind building the agent-specific layer.

Runloop

AI-agent-specific sandbox platform. Similar to E2B but with persistent storage and a focus on long-running agent tasks. Browser support in beta. Good Python SDK.

Where we win

We're the only platform that gives the agent the complete workstation: terminal + browser + desktop. If your agents need to:

…then no other platform covers all of these today. If your agents only need terminal execution, E2B or Modal may be simpler and cheaper for that specific use case.

Option 3: Use the agent's built-in compute

Some agents bundle their own compute:

AgentBuilt-in computeLimitation
DevinFull cloud sandbox per taskLocked to Devin's model. $9/hour. Can't use Claude or GPT.
OpenAI CodexIsolated containers per taskLocked to OpenAI models. No internet by default. No browser/desktop.
Cursor (cloud)Ubuntu VMs, up to 8 parallelLocked to Cursor ecosystem. No browser containers.
GitHub CopilotGitHub Actions runnersLocked to GitHub ecosystem. Limited customization.

The tradeoff is clear: bundled compute is convenient but creates lock-in. You can't run Claude on Devin's sandbox. You can't use Codex's containers with a LangChain agent. Each tool built its own walled garden. A managed platform gives you any agent on any compute.

The decision matrix

If you need...Best option
Terminal-only code execution, fastest cold startE2B
GPU/ML inference, serverless PythonModal
Self-hosted, open-source dev environmentsDaytona
Cheap always-on VMs with low-level controlFly.io
Terminal + browser + desktop (full AI workstation)Sandbox Platform
Complete control, data residency, 6+ months to buildBuild yourself
One specific agent (Devin/Codex/Cursor) onlyUse their built-in compute

The real cost of building

6–10
months to build
$200K+
engineering cost
0.5–1
FTE ongoing maintenance

The direct cost (engineering time) is the visible part. The invisible cost is opportunity: your platform team spent 6 months building sandbox infrastructure instead of building your product. That's the cost that matters most for startups and growth-stage companies.

The 80/20 trap

Building a basic sandbox (EC2 launch + execute command) takes 2 weeks. Getting to production quality (warm pools, multi-tenancy, cost tracking, browser containers, desktop containers, session management, proxy routing, audit logging) takes 6–10 months. The first 80% feels fast. The last 20% takes 5x longer than everything before it. Every team that builds this underestimates the tail.


What's next

Ship next week, not next quarter

Terminal. Browser. Desktop. Warm pools. Cost tracking. Multi-tenancy. All of it, out of the box.

Get Started Free