Per-Task VM Isolation as a Harness Selection Criterion for Security-Conscious Engineering Orgs
Dedicated kernels contain agent execution, but injection and credential risks remain.

For a bring-your-own API key cloud coding agent runner, per-task VM isolation should be a primary selection criterion. Running Claude Code or Codex in the cloud without managing infrastructure means evaluating both the harness and the platform that executes it. The execution layer must give each task a dedicated kernel and provide ephemeral environments and default-deny network egress.
Why autonomous coding agents create a qualitatively different execution threat than assistants do
An assistant produces text that a human decides whether to use. An autonomous agent closes that loop itself. It generates a command, executes it, reads the output, and chooses the next action without a person approving each step. Package installation, file edits, and API calls become operations performed under the agent’s identity, with real permissions on real infrastructure. Security must therefore address execution as well as the quality of a suggestion.
That distinction changes what an attacker needs to influence. A README, issue comment, or tool result can contain instructions that redirect the agent through prompt injection. The attack targets the agent’s authority rather than a defect in application code, so commands derived from external content must be treated as potentially adversarial. Prompt filtering, output scanning, and approval gates still help, but they cannot replace containment that works regardless of how the model behaves. Mohammadreza Rashidi’s 2026 survey documents disclosed, patched CVEs affecting production agent harnesses, establishing that execution-layer failures are already a practical concern.
Why the execution boundary is the control that matters most, and what “holding” means for a VM versus a container
In-process and editor-level sandboxes depend on the harness enforcing its own rules correctly. Unauthorized operations can remain reachable through permitted tools. Such a bypass does not require escaping a container because the failure occurs before the container boundary is tested. Containers provide a separate layer, but their namespaces still share a kernel. Rashidi documents a runc container-escape vulnerability affecting the runtime on which many agent sandboxes are built, illustrating the structural risk of treating namespace separation as the final boundary.
A per-task microVM instead gives each workload a dedicated kernel. This removes the shared-kernel escape path through which a compromised container can threaten other tasks or the host. The distinction is architectural, not a claim that every system called a VM is invulnerable. The isolation primitive must be evaluated together with the environment’s lifetime and permitted connections.
Three properties define the containment requirement here, namely hardware isolation, ephemerality, and network egress control. Dedicated kernels separate workloads, while discarding the environment after a task prevents its files and processes from becoming a foothold for the next caller. Default-deny outbound access restricts where a compromised agent can send data during execution. Teardown cannot undo exfiltration that already occurred.
What the benchmark evidence shows about harness-level security mechanisms in production harnesses
HarnessSecurity-Bench evaluated nine security mechanisms across six production harnesses, including Claude Code, Codex CLI, Gemini CLI, gptme, Qwen Code, and GitHub Copilot. Its trials recorded tool calls across thousands of runs. Roughly half of confirmed mechanism implementations were opt-in, while closed-source harnesses presented substantial evidence gaps. Those findings distinguish the availability of a security setting from protection that is active and demonstrable. When auto-approve was turned on, roughly a third of tested attacks succeeding rose to nearly all.
The benchmark also found tradeoffs between protection and usefulness. Network isolation and read-only mode limited the effects of attacks but also made the harnesses much less useful. Command allowlisting and denylisting had smaller utility costs, yet unauthorized operations remained reachable through alternative execution paths. An allowed tool could deliver an arbitrary payload. The weakness therefore lies in treating a tool or command decision as if it fully described the effects of execution.
Rashidi describes the same allowlisted-command bypass pattern and reports policy-enforcement studies that found failures in most real denylists. The survey also identifies a research gap. These findings, including the absence of retesting of the isolation papers’ own defenses in that adversarial policy-enforcement setting, support layered controls. They show why harness policy should not be the last containment boundary.
How Cursor’s per-task Firecracker microVM architecture implements the isolation property in practice
Cursor’s Cloud Agents provide a concrete implementation of this architectural choice. The described production architecture assigns each task its own Firecracker microVM on its own physical host, without sharing memory, kernel, or storage between tasks. Isolation is not merely a command policy. A task’s execution environment is separated from other tasks at the machine level. This establishes per-task VM isolation as an implemented engineering choice rather than an abstract procurement aspiration.
That choice has an explicit density cost. A full machine is allocated to each task regardless of how much capacity the agent uses. Shared machines with Kubernetes resource limits, cgroups, and separate namespaces can fit more tasks at a lower cost, but those tasks still share a kernel. The security comparison therefore concerns which resources tasks share. Resource limits do not turn namespace separation into a dedicated-kernel boundary.
A hybrid deployment assigns routine work, such as lint fixes and documentation updates, to shared container infrastructure while reserving isolated machines for sensitive tasks. Its quality depends on the routing logic. Payment services, authentication changes, and credential handling must be classed separately from routine maintenance. Newer options extend that deployment calculus, including Devin Outposts for customer-owned hardware and E2B’s Sandbox.fork() for independent parallel copies of checkpointed filesystem and memory state. Neither option eliminates the need to establish which isolation properties the resulting task environment provides.
What per-task VM isolation does and does not contain — the remaining attack surface a VM boundary does not close
VM isolation constrains execution, but does not decide whether an instruction is legitimate. Prompt injection and rules-file poisoning work above that boundary. A hostile instruction in a repository file, issue comment, or Model Context Protocol tool description can influence the model before execution begins. The agent can therefore take the wrong action even when its environment is correctly isolated. Rashidi reports meaningful rates of benign but unrequested actions under realistic prompting.
Protocol behavior creates another distinct exposure. A time-of-check-to-time-of-use race occurs when a state check is valid when performed but the state changes before the action. That sequence can still occur with a dedicated kernel. Rashidi identifies MCP threats and these races as related validate-then-act problems studied in separate literatures, without isolation papers addressing them together. Identity delegation and execution provenance also sit outside the VM boundary because they concern which identity authorized an action and what evidence remains for audit.
Least-privilege credentials constrain authority, network egress rules restrict outbound access, MCP server vetting addresses tool trust, and audit logging supports accountability. A VM does not make broadly scoped credentials safe or reverse an authorized external API action. Its value is to limit the execution blast radius when another defense fails. That makes it the appropriate first layer alongside the controls around it.
How should engineering orgs evaluate a bring-your-own API key cloud coding agent runner?
“Sandboxed” is not a sufficient architectural answer. Establish whether every task receives its own VM and dedicated kernel or runs in a container on a shared kernel. The architecture description should be obtained in writing. Establish whether the environment is discarded after the task or persists with files, processes, and possible attacker footholds.
The default outbound network policy must be default-deny with explicit allowlisting. Default-allow access leaves a compromised task able to exfiltrate credentials before teardown. Establish whether the task receives host credentials or scoped, task-specific credentials that expire with the VM.
Verify whether protections are verifiable and enforced by default. Defaults are part of the deployed security posture. Governance requirements, including SOC 2 Type II, audit logs, SCIM, and self-hosting for regulated industries, should then form the second filter rather than precede the execution-boundary assessment. Teams using hybrid infrastructure should write down which types of tasks need full VM isolation and which may use shared containers. That routing logic is itself a security control because it determines which boundary protects each workload.
How the leading cloud-capable harnesses — Claude Code, Codex, Cursor, and OpenCode — compare on the isolation criterion
Cursor has the strongest documented isolation posture among these four in the architecture described here. Its Cloud Agents use per-task Firecracker microVMs on isolated physical hosts. Codex Cloud, by contrast, is described as running hosted sandboxed tasks. That description alone does not establish the isolation primitive. OpenAI’s current documentation must establish whether the boundary is a VM or container and what ephemerality guarantees apply, using the same evaluation framework.
Claude Code is a terminal-first harness with 33 hook events and Dynamic Workflows. Its execution boundary depends on deployment. On a developer machine, it operates with the developer’s credentials and filesystem access, while deployment through a cloud harness platform inherits that platform’s isolation properties. Hooks provide points for harness control, but their presence does not establish a dedicated kernel. For teams seeking managed cloud execution, the platform’s architecture is therefore a separate selection decision from the harness’s workflow features.
OpenCode is permissively licensed, model-agnostic across many providers, and suited to self-hosting. Infrastructure determines its isolation properties entirely. Self-hosting allows a team to implement VM isolation on its own terms and fits regulated organizations legally barred from transmitting proprietary code externally. More generally, a cloud agent platform providing per-task VM isolation can separate harness choice from the execution boundary for the harnesses it supports. This separation allows a team to change harnesses without redesigning containment, reducing architectural lock-in rather than merely increasing the number of available models.
Why treating VM isolation as a first-order criterion — not a later compliance checkbox — produces better security outcomes at agent scale
Parallel agents create concurrent execution contexts with their own permissions and network access. Shared boundaries create opportunities for failures to propagate. As task volume grows, review, approval gates, and scanning do not scale at the same rate as autonomous execution. As agents produce more pull requests, teams also have more work to do to find subtle security problems in each change. Isolation limits execution damage when those other controls miss a failure, although it does not establish that the resulting code is safe.
Event-driven work makes reliance on human intervention still less dependable. An agent may start when a production alert fires or run on a schedule without an operator watching its actions. Ephemerality and default-deny egress can operate unattended. Retrofitting them after harness selection is harder because credential scoping, network policy, and environment lifetime must then be fitted around an existing deployment.
The procurement order should therefore begin with per-task VM isolation, ephemerality, and default-deny egress. Harness and platform evaluation follows that requirement. Task performance, integrations, and cost can then be compared among options that meet the execution standard, while a documented hybrid policy can account for lower-sensitivity workloads. This preserves room to change harnesses without reopening the containment decision each time.


