Dependency Drift and State Bleed the Cage Match Between Agent Isolation Strategies Teams Actually Bench
Git worktrees split branches, but only per-session VMs split runtime state.

A multi-harness cloud coding agent platform separates the choice of Claude Code, Codex, or another harness from the runtime boundary around each session. Git worktrees separate branches, but isolated cloud VMs separate the ports, databases, dependencies, and secrets that parallel agents otherwise share. Engineers must decide which state each agent may change as well as which agent writes the code.
Why git worktrees alone cannot contain parallel agents
Git worktrees are indispensable for code isolation. They let agents work on separate branches without mixing their edits into one checkout. That separation stops at the file tree. Worktrees do not, by themselves, separate ports, databases, caches, secrets, or test results, so clean branch histories can coexist with a shared runtime.
Two agents can therefore collide without editing the same file. If both bind to localhost on port 3000, the second fails for a reason unrelated to its branch. A migration can change a database another agent reads, while a warmed cache can hide a missing dependency and produce a false green. Stale Docker volumes and bind-mounted host paths create similar gaps between apparent checkout isolation and actual filesystem state.
When agents run in parallel, these gaps become common. One agent may review authentication code while another experiments with a migration and a third reproduces a failing test. When interference causes a failure, the affected agent can start repairing code that was never responsible. Teams must therefore choose a runtime control layer to accompany worktrees.
How dependency upgrades turn state bleed into an environment corruption problem
Dependency state is runtime state, even when its specification lives in version control. An agent resolving a major version bump can rewrite its lockfile and install new packages into a shared environment. Another agent then executes against those packages without changing its own branch. Its tests, type errors, and runtime behavior now depend on somebody else’s dependency resolution.
Git records the lockfile mutation in branch history, leaving another branch’s execution against the resulting installed environment unrecorded. Both branches can look clean. A local improvement can consequently alter the assumptions of neighboring work, with failures appearing far from the upgrade that caused them.
A later lockfile conflict does not undo those decisions. By the time review or CI exposes the mismatch, the agent may already have run tests, changed source code, and opened additional pull requests against the contaminated baseline. The error begins before the review gate. Review can reject a patch without showing all the decisions that led to it.
Rigorous dependency-upgrade evaluations control this baseline by running agents in isolated Docker containers built from images pinned to the repository’s base state. Each agent must update dependency specifications, resolve the upgraded state, and fix source-level incompatibilities in that environment. The controlled filesystem, caches, and tooling prevent a previous agent’s installation from becoming an accidental input. Reproducible execution is therefore needed for isolation as well as testing.
The isolation spectrum, from stateless subshells to microVMs
Stateless subshells provide process-level separation without a container boundary. They still share the network namespace, filesystem, and environment variables. Shadow git checkpoints solve a different problem. Cline records filesystem state in an isolated repository per workspace after tool execution, enabling rollback, and relies primarily on human approval for security.
Hardened containers also have network egress controls and limits on capabilities. They also retain exposure to container escapes through kernel vulnerabilities. Mohammadreza Rashidi’s execution-security survey identifies a runc container-escape CVE affecting a runtime used by agent sandboxes. The boundary is stronger, but it is not absolute.
MicroVMs such as Firecracker and Kata provide the recommended architecture in the notes’ security framework for untrusted or hostile LLM-generated code. Their cold-start latency is acceptable for most agent use cases, weakening the speed argument for containers in that threat model. Operational overhead remains part of the choice. Checkpoint and rollback can sit above VM isolation, allowing a long session to return to a known state after a bad tool call.
The evidence does not support a universal league table. Rashidi’s survey finds that isolation architectures and capability models are rarely evaluated against one another on a shared benchmark. It also reports studies of policy enforcement with real-denylist failure rates from 69% to 98%, but papers on isolation have not tested their defenses again under those conditions. A policy claim and an execution boundary are not interchangeable evidence.
Some threats also cross the entire spectrum. A time-of-check-to-time-of-use vulnerability arises when state changes between a check and the action that relies on it. Moving execution into a microVM does not erase that possibility. Execution isolation also leaves credentials at risk, because code can still read environment variables,.env files, or SSH keys placed inside its boundary.
How Claude Code, Codex, Cursor, and OpenCode each handle runtime isolation
Codex leans heavily on sandboxed execution by default. Its shell commands run in an OS-level sandbox, which may operate outside a container, with access beyond that boundary requiring explicit approval or --dangerously-bypass-approvals-and-sandbox. Worktree support, cloud runners, and headless execution support parallel development. These are distinct controls, however, and worktree support alone does not establish that each task has an independent database or dependency environment.
Claude Code documents a --worktree mode for parallel tasks and supports concurrent subagents and background agents. By default, its loop still has one lead session per repository. Rashidi’s survey describes two disclosed, patched Claude Code CVEs involving startup trust-dialog code injection and project-load data exfiltration, including API-key exposure before repository trust was approved. Those failures show why a trust prompt cannot take the place of a runtime and credential boundary.
Cursor’s Composer mode centers on interactive, human-in-the-loop editing. Cursor’s FastRender multi-agent browser project exposed a separate coordination problem at scale. Equal-status agents held locks too long and became risk-averse about difficult tasks because the system lacked hierarchy. The fix added Planners, Workers, and Judges and kept the isolation primitive, showing that teams need to design runtime containment and work coordination separately.
OpenCode leaves its isolation posture to the deployment environment. That gives teams control but also makes them responsible for supplying the boundary. Benjamin Rombaut’s scaffold taxonomy finds that execution isolation is a dimension where architectures converge under external constraints. For unattended parallel work, selecting a harness therefore includes an isolation decision unless the runtime is supplied independently.
How can teams run multiple coding agents in parallel without managing infrastructure?
Running each agent session in its own cloud Linux VM moves runtime separation outside the harness. With separate network namespaces, sessions can use the same local port without competing for it. Separate filesystems keep dependency installations within their originating sessions. When databases and caches are also scoped to those VMs, one agent’s migration does not silently become another agent’s working state.
The scope qualification is essential to the architecture. A VM boundary contains local state, while credentials must be injected per workspace and kept invisible across workspaces. This narrows the exposure illustrated by the Claude Code vulnerabilities without claiming that code cannot misuse a secret it legitimately receives. Central control replaces dependence on whatever happens to be in a developer’s.env file.
Cloud execution also changes how work is attributed. Audit logs can record what each agent did in its VM, while each session produces a pull request a human can merge, comment on, or send back. Agents can run on schedules or respond to Slack messages, Linear issues, GitHub webhooks, and production alerts without a developer at the keyboard.
Ramp’s internal agent Inspect provides a concrete deployment example. It runs in sandboxed virtual machines on Modal and connects to databases, Buildkite, Sentry, Datadog, LaunchDarkly, Slack, and GitHub. Adoption reached roughly three-quarters of merged pull requests in frontend and backend repositories without mandated use. Engineers chose it for tasks where it matched manual coding in quality, speed, or convenience, connecting the infrastructure choice to everyday workflow.
How agent isolation interacts with the tools where engineering work already happens
An issue, production alert, or Slack message can include text from someone outside the organization. That material can attempt to redirect the agent through prompt injection. An integration is therefore both a convenient trigger and an input boundary whose safety depends on what the agent can execute and access.
Linear Agent can write code using Claude Code and Codex, bringing coding sessions into the place where teams triage, plan, review, and ship. Linear’s changelog describes gathering evidence from Sentry or Datadog through MCP and inspecting the codebase to trace root causes before producing fixes. Linear uses the workflow internally to resolve roughly a third of incoming bug reports, mostly on the first pass.
CodeRabbit extends this chain into automated pull-request review. Its Skills system supports Claude Code, Cursor, Codex, Gemini CLI, and GitHub Copilot, allowing agents to fix and re-review output autonomously. Post-Merge Actions, as of August 2026, extend natural-language instructions to changelog entries, Linear or Jira tickets, GitHub issues, and Slack summaries. GitLab Triage entered beta in September 2026 for GitLab Cloud and self-managed organizations on Team plan and higher. These integrations expand both the places an agent can affect and the places it can receive work.
The practical safeguard is to establish containment before enabling triggers. Teams should treat external content as data rather than instructions, run agents in sandboxed environments without production credentials, redact secrets from logs, and retain human approvals. A Slack-to-pull-request workflow needs those controls just as much as a scheduled task does. A VM limits the reachable environment, while approval and credential policies govern what may leave it.
Choosing an isolation strategy based on what agents are actually doing
File-only edits on isolated branches can tolerate weaker runtime separation than migrations, database seeding, service startup, or package installation. Those runtime-changing tasks need VM-level separation for independent work. Attendance changes the requirement too, because a developer can intervene in an interactive session while a scheduled agent must not corrupt the next run.
An agent that can read shared environment variables or.env files presents a leakage risk even when its code edits are isolated. VM-scoped secrets remove cross-workspace exposure, while risks involving the secrets available within a workspace remain. Teams should check that scope separately from the harness’s approval interface.
Isolation granularity should also follow task coupling. Two or three agents can share one workspace when their tasks are closely tied, while fully isolated VMs are needed for truly independent tasks. A consistent cloud runtime lets teams make that distinction without rebuilding the boundary whenever they switch harnesses. The harness can change while the workflow and containment model remain stable.
Zhou et al.’s survey of self-evolving coding agents finds that 98% of shared assets in deployed collaboration networks are never reused, while a substantial fraction of approved assets bypass quality checks through vacuous tests. Agents that change shared reusable assets can add to execution interference by making changes that affect later sessions. Isolation is a prerequisite for governing those retained effects, while the soundness of retained assets still requires verification.
The actionable principle is to make isolation a first-class engineering decision and decouple it from harness choice. Each independent task should end in a discrete, attributable pull request that a human can merge, comment on, or send back. If its effects cannot be reviewed that way, the boundary has not fully contained the work.
Sources
- Self-Evolving Coding Agents
- The Balkanization of Execution-Security Research for AI Coding Agents: Isolation, Access Control, and Time-of-Check-to-Time-of-Use Vulnerabilities
- Inside the Scaffold: A Source-Code Taxonomy of Coding Agent Architectures
- Update from Hell: Can Coding Agents Survive Hidden Breakage in Dependency Upgrades?


