Hands Off Development

Per-Task VM Isolation Compared Across Cloud Agent Platforms Supporting Claude Code Codex Cursor and OpenCode

Compare cloud agent platforms by isolation tier, not labels.

· 8 min read
Cover illustration for “Per-Task VM Isolation Compared Across Cloud Agent Platforms Supporting Claude Code Codex Cursor and OpenCode”
Cloud Agent Environments · November 25, 2026 · 8 min read · 1,738 words

Isolated VM environments for cloud coding agents put each task behind its own guest kernel instead of relying on the agent’s built-in permissions or shell sandbox. For teams comparing platforms supporting Claude Code, Codex, Cursor, and OpenCode, the decisive differences are the isolation primitive, lifecycle, access controls, and deployment location. A safe production architecture combines that execution boundary with scoped credentials, egress controls, and a reviewable pull request.

Why the sandbox boundary inside a coding agent is not the same as VM isolation

An agent-side sandbox restricts particular actions, but its coverage need not include the whole agent runtime. Claude Code’s built-in /sandbox, for example, applies OS-level restrictions to shell commands, while its file tools, MCP servers, and hooks run directly on the host. OpenCode’s permission rules set which tool actions are allowed, denied, or sent for approval. Those rules do not establish process isolation.

Each task gets its own guest kernel behind a hardware virtualization boundary, so a guest-kernel vulnerability does not directly compromise the host. Choosing a platform therefore means choosing which layer does the containment work.

The isolation spectrum from OS primitives to microVMs, and where each primitive sits

Diagram: The Isolation Spectrum: From OS Primitives to MicroVMs. Visualizes: Show a ranked spectrum of four isolation tiers, ordered from weakest to strongest, with named examples at each tier.

Isolation strength follows a spectrum. At its lightest end, Landlock, seccomp-bpf, Bubblewrap, and macOS Seatbelt constrain a host process without supplying a separate kernel. Shared-kernel containers add process isolation, but a container escape reaches the host. Both approaches retain the host kernel as a shared point of exposure.

Application kernels add an intervening layer to that arrangement. gVisor is a user-space kernel written in Go that intercepts and handles syscalls. It has a stronger boundary than a plain container, though each workload still lacks its own hardware-virtualized guest kernel. Its overhead sits between a plain container and a full microVM.

MicroVMs occupy the strongest tier in this comparison. Firecracker, Cloud Hypervisor, and libkrun give each workload its own guest kernel, while Kata Containers presents this model through a runtime compatible with container standards. Unlike a shared-kernel container, a microVM separates the workload’s kernel from the host’s. Firecracker cuts attack surface by removing device emulation it does not need and is built to boot fast with as little memory overhead as possible. None of these execution primitives, however, determines which external APIs an agent may call.

How Claude Code, Codex, Cursor, and OpenCode each handle isolation when run natively

Claude Code’s local CLI uses Bubblewrap for namespace isolation, with Landlock as a legacy fallback. Its shell-only sandbox belongs to the OS-primitive tier. The claude.ai chat product has a different architecture, with code running in a gVisor container on isolated infrastructure and an ephemeral filesystem per session. That server-side environment must not be treated as a property of the local CLI.

Codex Cloud runs each task in an isolated container, caches setup for up to 12 hours, and runs the agent phase offline by default. The container is destroyed when the task ends. This is shared-kernel isolation with an ephemeral task lifecycle.

Cursor Cloud Agent reaches VM isolation for cloud tasks. Each task starts in a fresh VM, clones at HEAD, and works on an agent/<task-slug> branch. OpenCode, by contrast, supports terminal, desktop, and IDE workflows whose permission configuration does not itself establish process isolation. Its filesystem and network exposure depend on the host. Teams running more than one agent thus have different native boundaries, which gives them a reason to add a common hosting layer.

How do teams run coding agents without exposing shared infrastructure?

A VM-based cloud harness wraps the agent CLI in a dedicated environment. It provisions the repository, injects credentials at runtime, and manages the VM lifecycle. The agent still sees a normal Linux environment. The architectural change is outside the agent, where the platform supplies a boundary around its execution.

This separation lets a harness apply a consistent isolation tier to agents with different native protections. The environment layer can also provide egress filtering, credential proxying, and audit logging regardless of which agent runs inside it. Those controls are additions to the execution boundary. Their availability and configuration remain part of the platform comparison.

How the major cloud harness platforms implement per-task VM isolation

Northflank Cloud Harnesses runs each harness in its own Kata microVM, isolated from other workloads. It supports Claude Code, Codex, Cursor, OpenCode, Pi, and bring-your-own-agent. A home-directory volume of 5–100 GB persists across restarts by default, although persistence can be disabled at creation for throwaway environments. Billing is per-second, and paused harnesses use no compute.

Northflank offers managed hosting or BYOC inside a team’s AWS, Azure, GCP, Oracle, or CoreWeave account, with its control plane managing infrastructure inside the team’s VPC. Self-serve microVMs on BYOC launched in September 2026 for untrusted code and coding agent workloads. Work can start from Slack, Linear, GitHub, GitLab, the dashboard, the API, schedules, or webhooks. Agents can run at the same time and through scheduled or event-driven automation, then return pull requests, replies, and recordings for review. Governance is also part of the product, including SOC 2, SCIM, audit logs, and self-hosting.

Docker Sandboxes moved to one microVM per sandbox in its 2026 generation, with a standalone CLI called sbx. Its documented agent support includes Claude Code, Codex, Cursor, and OpenCode. That places this generation in the microVM comparison, rather than treating it as ordinary shared-kernel container execution. The stated support does not by itself establish a persistence policy or an outbound-access policy.

E2B provides a Firecracker microVM sandbox API with Python and JS SDKs and a self-hostable option. Session limits depend on the plan, while Enterprise adds BYOC deployment. It is built to run short-lived tasks. Vercel Sandbox also uses Firecracker microVMs and is generally available, with filesystem snapshots and integrations with AI SDK and OpenAI Agents SDK. Both are sandbox APIs, leaving teams to build the surrounding agent workflow and access controls.

AWS Lambda MicroVMs is purpose-built for code that is not fully trusted, providing an isolated environment per user or session with a separate kernel. Amazon Bedrock AgentCore Runtime represents the ephemeral lifecycle option in this comparison. Modal Sandboxes takes a different path, using gVisor on KVM and shutting down automatically when the agent finishes. It is GPU-friendly, but its sandbox boundary is the application-kernel tier rather than a dedicated hardware-virtualized microVM per task. The presence of KVM underneath does not make these task boundaries equivalent.

The four dimensions where these implementations diverge in ways that affect engineering teams

Diagram: Four Decision Dimensions for VM Isolation Platforms. Visualizes: Show four distinct decision dimensions that engineering teams must evaluate when choosing a cloud agent harness: (1) Execution boundary — microVM guest kernel vs.

Teams first choose the execution boundary the workload requires. MicroVMs provide a separate guest kernel, while Modal’s gVisor layer interposes on syscalls in user space. Codex Cloud’s native container tier retains a shared host kernel. Container isolation can be adequate for controlled inputs, but it is not equivalent to a microVM for untrusted or adversarial execution. Local OS-level restrictions suit trusted, constrained tasks on a team’s own machines.

Cursor uses a fresh VM for each task and keeps the work on a task branch. Ephemeral compute and persistent work are separate choices. A comparison must distinguish destruction of the execution environment from preservation of a branch, volume, or snapshot.

The third decision is where outbound access and credential policy will be enforced. An unfiltered VM can still call external APIs. E2B, Vercel Sandbox, and Modal leave egress control to the team building on top, which fits an application that already handles that responsibility. It leaves a gap when the application does not. Outbound filtering and a credential proxy address a different requirement from guest-kernel isolation, so neither can be inferred from a platform’s microVM claim.

The fourth decision is where the environment runs. Vendor-managed hosting is the simplest path, but code and credentials pass through the vendor’s infrastructure. Teams with SOC 2, data residency, or IP-sensitivity requirements should treat location as a first-class criterion. These four dimensions are decision points rather than a universal ranking, because no platform optimizes all four simultaneously.

What falls outside the VM sandbox and still needs to be addressed

A VM cannot prevent misuse of legitimate access. An agent that reads web pages or other external content can get malicious instructions through prompt injection, even when the code it then runs stays inside its sandbox. Those instructions can direct calls to APIs for which the agent already has credentials. Broadly injected secrets enlarge that authorized reach. Scoped credentials tied to allowlisted destinations address the identity problem that execution isolation leaves unresolved.

Outbound networking creates a related path beyond the sandbox. A microVM with unrestricted internet access can exfiltrate data or make unauthorized API calls without escaping its environment. Simon Willison’s lethal trifecta identifies the combination of private data access, exposure to untrusted content, and the ability to communicate externally. All three together require additional controls beyond the VM boundary. Egress allowlisting constrains the communication path rather than relying on the execution sandbox to do a job it does not perform.

Repository permissions also remain outside the execution boundary. An agent with write access to main can merge its own pull requests, and a separate guest kernel does not revoke that authority. Human review of the returned PR is the control before a change proceeds toward production. The layered architecture therefore assigns different jobs to the microVM, egress allowlisting, scoped credential injection, and review. The VM is one necessary layer for this architecture.

Matching isolation architecture to what an engineering team actually needs

The right architecture depends on the trust level of the agent’s input, the sensitivity of its code and credentials, and whether its tasks are short and stateless or long and stateful. For short, well-scoped tasks on non-sensitive repositories, E2B and Vercel Sandbox provide adequate isolation with low operational overhead. Container-tier isolation is also acceptable when the agent’s inputs are controlled.

A team that needs execution inside its own cloud account has a separate deployment requirement to weigh against those lifecycle choices. These are different needs that call for separate judgments of quality. A persistent workspace, a short-lived sandbox API, or another hosting model fits the work according to the team’s combined lifecycle and deployment needs.

The final requirement concerns what the agent returns. Regardless of platform or agent, the output should be a pull request that a human can merge, comment on, or send back, rather than a change applied directly to the codebase. That checkpoint connects isolated execution to an accountable engineering workflow. A strong guest-kernel boundary limits where code executes, while the reviewable PR keeps acceptance of its changes under human control.

Sources

  1. List of coding agent sandboxes 2026-05 · GitHub
  2. The Balkanization of Execution-Security Research for AI Coding Agents: Isolation, Access Control, and Time-of-Check-to-Time-of-Use Vulnerabilities

More in Cloud Agent Environments