Two agent instances are running in parallel on the same repository. Agent A is refactoring the payment module, and Agent B is adding new features to the same module. What configuration is required to prevent them from interfering with each other?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Two surgeons can't operate on the same incision at the same time without chaos — they need separate operating theaters. Agent isolation means each agent gets its own branch, its own workspace, and its own PR. Merge policies then control when and how those changes come together.
Full explanation below image
Full Explanation
Agent isolation for parallel execution is achieved by scoping each agent to a separate Git branch, preventing interference at the file-system level.
Why B is correct: Configuring each agent to a separate branch (e.g., agent/payment-refactor and agent/payment-new-features) ensures that their file changes do not conflict during execution. Each agent can commit freely to its branch. Merge policies — such as requiring the refactoring PR to be reviewed and merged before the feature PR is rebased — enforce sequential integration of overlapping changes.
Why A is wrong: Running both agents on the same branch means their file writes will conflict in real time. One agent's changes can overwrite the other's, leading to corrupted, incomplete, or contradictory code.
Why C is wrong: Sharing a single context window does not prevent file-system conflicts. Context windows are read-only representations of state — they do not coordinate writes between agents. And two agents sharing one context window creates coordination complexity without solving the core isolation problem.
Why D is wrong: Assigning both agents to the same PR means their changes are combined in the same diff. The PR becomes difficult to review and conflicts between their changes are not isolated. Separate PRs allow each agent's work to be reviewed and integrated independently.