Why Every Claude Code Task Deserves Its Own Ephemeral VM on a Managed Platform
Per-task VMs make cloud agents safe, parallel, and accountable.

To run Claude Code in the cloud, each task should execute in its own ephemeral VM on a managed platform. The VM contains the task’s actions, while its short lifetime prevents later tasks from inheriting its state. A managed platform makes that boundary practical by handling provisioning, credentials, audit records, and workflow connections, so safe execution, parallel work, and accountability become properties of the system rather than responsibilities left to individual developers.
Why shared and persistent environments create structural risk for Claude Code tasks
A team’s first Claude Code agent can feel manageable on a developer’s laptop. The second or third exposes the structural problem. Several tasks now depend on one machine, its filesystem, and the permissions available to the developer. If an agent executes a hallucinated command or follows a prompt-injected instruction, the task has no independent boundary separating it from everything that environment can reach. The risk grows as more work goes to agents, even when nobody changes the security settings on purpose.
AWS describes the underlying problem in its discussion of Lambda MicroVMs. Most agent-generated code executes with whatever permissions the developer has, leaving no boundary between an out-of-scope action and the rest of the environment. Existing credentials, SSH keys, and cloud permissions can give a task access to production systems or other tenants. Persistence adds a separate failure mode. A filesystem altered by earlier investigations can contaminate the next hypothesis, making it difficult to distinguish a fresh result from the residue of previous work.
Claude Code’s built-in /sandbox reduces permission prompts and wraps Bash, PowerShell, and Monitor commands and their child processes, with file tools, MCP servers, and hooks still running on the host. That leaves unattended execution dependent on controls outside the command sandbox. CVE-2026-39861 illustrates the class of risk through a symlink-based sandbox bypass in versions before 2.1.64 that was exploitable through prompt injection. A runtime sandbox inside a shared host is therefore insufficient as the task’s sole containment boundary.
What isolation actually means: the VM boundary as a containment primitive
A shared-kernel container separates processes but retains that common kernel, so it does not provide the VM boundary required for untrusted agent execution. The word “isolated” alone is not a technical specification. Evaluating it requires identifying what separates the agent from the host, other tenants, and other tasks, rather than counting the restrictions applied to a process.
AWS describes a Firecracker-based MicroVM as having its own kernel, filesystem, and network namespace. Those separations give generated code an environment whose local damage can be contained to that run. The boundary still needs scoped credentials and network controls, because isolation does not make deliberately granted external access harmless. Ephemerality addresses a different part of the problem. Destroying the environment after the task ends removes the persistent state that another task would otherwise inherit.
MicroVMs can be checkpointed and restored, allowing suspension and resumption while preserving inter-tenant isolation. A task can therefore retain its working state without giving that state to the next task. The distinction is between continuity within a boundary and reuse across boundaries. It also establishes the basis for governance, because credential scoping, egress controls, and audit records need a defined execution boundary to describe and constrain.
Why ephemeral-per-task is the design unit, not ephemeral-per-session or ephemeral-per-team
A session-level VM still allows one task to affect the next. If the first task corrupts the filesystem or leaves misleading state, the second begins from that altered environment. The VM contains the session’s blast radius. In a team-level environment, even more runs can affect one another.
The task is the correct unit because its lifetime matches the work being delegated. Each run can begin with the dependencies, tools, and secrets defined for it. That makes the starting conditions reproducible without claiming that every agent response will be identical. It also permits separate tasks to execute simultaneously without seeing one another’s filesystems, process tables, or network traffic. Parallelism follows from the boundary rather than requiring tasks to negotiate shared state.
This distinction separates environments built for people from environments built for programs. An environment optimized for a person with an editor serves a different purpose from one created repeatedly by a program spawning VMs. A useful design test is whether a for loop can create independent task environments, rather than merely open more work inside a shared workspace. The same granularity makes attribution possible. Every minute, credential use, and tool call can map to one task, its source, and the person who triggered it, instead of being entangled with other runs in a common environment.
Parallelism as the practical payoff of per-task isolation
An agent in a developer’s environment is still tied to that person’s machine and permissions. Moving execution to the cloud removes that attachment only if tasks also receive independent environments. A file written by task A is still visible to task B, and credentials loaded into shared execution state can still affect other tasks. Concurrency then expands the blast radius or requires serialization to avoid interference.
Per-task VMs make simultaneous delegation a structural capability. The infrastructure absorbs the concurrency while each agent works against its own state. That lets agents work through a backlog without each team having to run a large fleet already. What matters more than how many agents appear in an interface is whether each new task gets its own execution context or joins others in the same mutable environment.
Snapshot and fork capabilities make the distinction especially clear. An expensive environment state can be checkpointed and used to branch six hypotheses in parallel, but each branch needs its own isolated VM. Otherwise, the fourth hypothesis can inherit changes made by the first three. Independent branches preserve the value of the comparison.
As more tasks run in parallel, proving that changes work, reviewing them, and merging them become the bottleneck. Separate VMs give each run its own place to verify changes. That allows the required human review queue to become the pacing factor for delegated work.
How tasks enter the system and how outputs return: the integration surface that makes delegation usable
An independent VM has limited operational value if starting it requires a separate workflow. Delegation needs to begin where the work already lives, including Slack conversations, GitHub issues, Linear tickets, monitoring alerts, CI pipelines, schedules, and webhooks. The entry point supplies the context for the task. Its output must then return somewhere a human can act on it without reconstructing that context in another interface.
A Slack @agent mention works well for incident triage and ad-hoc investigation, and the findings come back as thread replies and draft pull request links. Assigning a GitHub issue works well for scoped feature work and bug fixes, and the result is a draft pull request. Monitoring alerts and CI webhooks can initiate nightly triage or flaky-test detection, returning channel summaries and proposed fixes. Schedules and API calls extend the same model to recurring or automated work without someone at the keyboard.
For a proposed code change, the actionable output is a reviewable pull request. A conversation or a diff in a chat window does not place the change inside the team’s established review process. A pull request does. Thread replies and summaries provide context, while the proposed change remains available for a human to comment on, send back, or merge.
The trigger and the VM enforce different controls. The trigger determines who can start a task and from where, while the VM boundary governs credentials, secrets, repository access, and network egress during execution. Neither substitutes for the other. Unattended work needs both an authorized entry point and a constrained execution environment so that automation does not become opaque access.
What automated PR review and production alert triage look like when isolation is the foundation
Continuous triage is viable only when each investigation has a contained blast radius. Otherwise, reducing engineer involvement can increase infrastructure risk. An agent looking into a production alert needs access to evidence without being able to disrupt production or another task. Per-task isolation sets the boundary for the run, while scoped access sets which external systems the investigation can reach.
When a new issue arrives, an agent can gather evidence from Sentry or Datadog, inspect the codebase, trace a possible root cause, and attempt a fix before an engineer takes over. Each step belongs inside a contained investigation. The same principle applies to custom AI code review agents that enforce team-specific rules written in plain English. They can run as GitHub check runs that block merges, but their execution still needs separation from other work. Reviewing a contained copy of repository state keeps the review out of a shared workspace.
Code execution alone does not show that a fix works. Outer-loop verification runs the proposed change against real services, databases, and message queues before the pull request opens. That requires a full ephemeral environment. Within it, the agent can address failures before a human sees the proposal. Inner-loop isolation keeps code execution within its boundary, and outer-loop isolation does the same for end-to-end verification, so both stages can run unattended.
Agents should investigate and propose changes, but they should not merge them. Draft pull requests only, required human review, and a protected main branch are non-negotiable constraints for this workflow. The VM limits the investigation, while branch protection keeps the final decision outside the agent’s authority.
How to run Claude Code in the cloud without managing raw VM infrastructure
Building per-task VM isolation means owning more than provisioning. The team also takes responsibility for teardown, task-scoped credentials, network egress, secrets, audit logging, idle timeouts, and cost management. It needs a harness connecting triggers to workspaces and workspaces to pull requests. That is a substantial platform engineering surface. A managed platform turns those connected responsibilities into an operable system without requiring a dedicated infrastructure team to assemble them.
Cost controls must match the rate at which agents create environments. Much of the cloud waste comes from non-production environments, and when machines handle provisioning, reminders to shut things down are not enough. Per-second or idle-based sandbox billing, hard TTLs, and automatic stopping build cost control into the system. Governance belongs in that foundation too. Requirements including SOC 2, SCIM, audit logs, SSO, role-based access, and self-hosting are reasons to prefer a platform that includes them in its product rather than adding them through a separate services engagement.
Startup latency is a real cost of isolation. Firecracker microVM sandboxes start in well under a second, with approximately 150ms for E2B and sub-90ms for Daytona, making startup acceptable for inner-loop agent work. For most Claude Code tasks, the frontier-model round trip takes more time than environment startup. Full application environments take longer to start because they need builds, database provisioning, and health checks. That delay belongs to the verification being performed within containment.
Teams should be able to run Claude Code, Codex, Cursor, or OpenCode against the same environment model without changing how tasks start or how outputs are reviewed. The harness should be a commodity. Bring-your-own model accounts and cloud commitments extend that independence to cost governance, allowing teams to pay for the compute agents use rather than model usage resold on top of existing subscriptions.


