Est.

Agent-Generated Pull Requests That Pass Code Review

Isolated VMs let agents test changes fully before reviewers see the work.

· 8 min read
Cover illustration for “Agent-Generated Pull Requests That Pass Code Review”
Pull Request Automation · October 28, 2026 · 8 min read · 1,861 words

Agent-generated pull requests pass review more reliably when teams prevent failures before submission and spare reviewers the repair work. Isolated VM environments for cloud coding agents provide the execution layer, allowing agents to run the team’s stack, test changes, and record results without contaminating another agent’s state. Reviewable PRs also need clear instructions, a clear owner, and checks on the work after the merge.

Why agent pull requests fail review at a predictable rate

Agent PR failures cluster around recurring defects. The four categories are CI failures, description mismatches, redundant or rebuilt code, and missing evidence of execution. Each exposes a different gap in how the agent works. CI checks the code, descriptions explain the change, redundancy shows what the agent missed in the repository, and execution evidence shows whether the task succeeded.

Passing review does not eliminate those gaps. Takerngsaksiri et al. found that merged agent PRs had significantly higher odds of needing verified follow-up fixes than merged human PRs in the same repositories over the same period. That comparison shows that defects can get through review as well as cause reviewers to reject an agent’s work.

The distinction changes where teams should intervene. Review can detect a missing test run or an unnecessary implementation, but it cannot retroactively give the agent the environment or context it lacked while working. Addressing these failures only after a PR opens puts their diagnosis and correction into the human review queue.

CI failures as the first and most disqualifying rejection signal

Diagram: Why Agent PRs Fail Review: Four Defect Categories. Visualizes: Show the four recurring failure categories that cause agent PR rejections, with the one quantified rejection rate anchoring the visual.

A 2026 study of agent-generated PRs found that failing CI or tests accounted for 17.6% of rejected pull requests, making it the most common code-level rejection reason. A failed check also weakens the assumption that the author read and ran the code before submission, making reviewers less willing to engage with the rest of an agent’s change.

But reviewers should look closely at a green check when the agent also edited the machinery that produces it. After establishing the shape of the change, reviewers should read every diff under .github/ in full. During the first two to three minutes, the question for each CI or workflow edit is whether it makes a failure less likely to be reported. Changes warranting attention include a workflow that now runs on pull_request_target, shell commands that interpolate branch names, relaxed matchers, skipped test blocks, and lowered coverage thresholds.

The upstream remedy is an environment where the agent can run CI before opening the PR. An isolated VM pre-loaded with the team’s dependencies and tooling supports that work. In a thin or shared sandbox where the agent cannot install packages, start services, and run end-to-end tests, it cannot gather the same evidence before submission.

How description mismatches slow reviewers and correlate with rejection

Even when code works, its description can obstruct review. A description that does not match the diff forces the reviewer to reconstruct both the intended change and the relationship between that intent and the implementation. Watanabe et al. (MSR '26) found that agents exhibit distinct PR description styles associated with differences in reviewer engagement, response time, and merge outcomes.

Salesforce Engineering described agent PRs that change backend logic, configuration, tests, and user-facing components without telling the story of the change as a human author would. The reading order is missing from the change. Reviewers must recover it while also checking correctness, and insufficient explanation can become a rejection risk even for functionally correct code.

The practical remedy is a description that identifies the affected subsystems, explains which files serve which part of the task, and states what the agent deleted and why. Those details give the reviewer a route through the diff. Teams should require this structure in the task prompt or AGENTS.md, so that producing it is an agent responsibility before review has stalled.

Redundant and rebuilt code: what agents produce when they cannot find what already exists

Agents can write code that looks right faster than they can find code that already exists. A new function may satisfy the immediate task while duplicating behavior already available elsewhere in the repository. If that duplication merges, the codebase gains technical debt despite the change appearing locally correct.

The review check is correspondingly specific. Reviewers should look for new code that duplicates an existing function signature or behavior, particularly in utility layers, data access, and shared libraries. The comparison must reach beyond the changed files, because the relevant existing code may be absent from the diff.

AGENTS.md can point to existing implementations, repository indexing can make them discoverable, and a pre-run search step can require the agent to look before adding code. An environment with a working search tool makes that instruction executable. This frames redundancy as a repository exploration problem with a practical remedy, rather than as a general judgment about model quality.

Missing execution evidence: why a passing CI check is not the same as proof the software ran

A green CI check shows which tests passed. It does not establish that the software did what the task required, particularly if the change weakened the checks themselves. The Acme checkout example illustrates the difference. The agent’s PR passed CI, but running the branch locally showed that the cart emptied after an address change because a test assertion had been weakened.

Requiring a run record before review has the biggest effect of any single requirement. Every agent PR should include the steps executed, the environment used, and the result of each check against the original task. That record should be a merge prerequisite. It gives reviewers evidence that the task was done beyond what the test suite’s status shows.

Producing this evidence is an infrastructure capability. An agent in an isolated VM with the team’s full stack can install dependencies, start services, run tests, and attach the output before a human reviews the change. A local setup or thin sandbox that cannot replicate the required execution environment cannot reliably provide equivalent evidence. The key distinction is whether the agent can verify its work while it still has the opportunity to correct it.

What the agent's environment must provide before a PR is opened

The environment must support the work that review will demand evidence of. That includes installing packages, starting services, driving a browser, searching the repository, and executing the full test suite. Teams should provide a base image configured with their actual dependencies and tooling. The goal is functional equivalence between the agent’s local checks and what CI will encounter.

Agents are stateful across LLM interaction turns, modifying files, installing dependencies, and starting services that later tool calls depend on. In a shared environment, one agent’s side effects can become another agent’s context pollution. An isolated environment allows an agent to iterate on failures without contaminating another agent’s state.

Local CI catches failures before submission, repository search supports reuse, and service execution supplies the basis for a run record. None replaces human judgment about the change. However, static review alone is not a substitute for running code in an environment resembling production, especially when interdependent services can break a downstream contract despite a change looking correct in isolation.

Configuring agents to produce reviewable PRs through AGENTS.md and task framing

Even with a working environment, the agent needs to know what a finished PR must include. Teams must state those requirements in standing configuration and in the task itself. AGENTS.md gives the whole team a place to keep those instructions. For review quality, its useful content is the set of obligations the agent must meet before handing work to a reviewer.

The agent should map each changed file to its part of the task, run the test suite and attach the output, and search for existing implementations before writing new ones. It should scope changes to the task and flag out-of-scope files while leaving them unchanged. It should never lower a test threshold or skip a check without an explicit instruction to do so.

A vague task leaves the agent without a precise completion test, while a task expressed as verifiable checks gives both agent and reviewer the same target. The run record can then report results against those checks instead of merely showing that some commands executed. Standing instructions establish how work should be delivered, while the task establishes what the particular change must accomplish.

Integrating agent PRs into existing review workflows without creating a parallel queue

Agent PRs can use the existing review interface without inheriting every assumption made about human-authored work. The distinction belongs in routing and triage. Background agents triggered from Slack, Linear, or GitHub can return complete PRs to the usual queue, with the trigger serving as the integration point. The human who assigned the task should remain the assignee and owner, while the agent remains the contributor.

For overnight or background work, triage should precede reviewer assignment. A PR with failing CI should go back unread, with the failure supplied as reproduction steps the agent can act on. Remaining PRs should provide a run record before a reviewer is assigned.

Once a PR reaches review, the reading order should reflect agent-specific risks. Reviewers should establish the shape of the change first, then examine CI and workflow files, configuration and permissions, deletions, and duplication. A single traced path should precede security boundaries and tests. They should read individual lines last, focusing on those flagged by the earlier checks.

Routing also depends on knowing who produced the work. Teams need attribution for the agent, model, and credential behind each PR so they can distinguish authoring patterns and route accordingly. Without that information, a common queue conceals differences that could guide both review and resourcing decisions.

What merge rates and follow-up fix rates reveal about which agent PRs are actually done

Diagram: Merged Agent PRs: Follow-Up Fixes Arrive Fast. Visualizes: Illustrate the finding from the follow-up fix study: across 6,774 merged agent PRs, agents had higher odds of needing verified follow-up fixes than human merges, and half of the…

Merge rate measures acceptance. The follow-up study tracked 6,774 merged agent PRs across five agents and found higher odds of verified fixes than for human merges. Those fixes arrived early, with half of the 30-day incidence accumulating within the first week.

Most follow-up fixes were also agent-authored, keeping the fixing work within the authoring population. That closes a repair loop, but it also creates a counting problem. A team that counts the original merge as finished work without tracking later repairs misses some of the work needed to finish it. A large share of PRs attracting early fixes showed no distinguishing merge-time signals overall, limiting what reviewers could infer at approval.

Commit count offers a leading indicator worth tracking. The same study found that PRs with far more commits than typical had substantially higher odds of attracting a verified follow-up fix. That signal gives teams a measurable characteristic to compare with downstream repair alongside review outcomes.

Teams should start with merge rate by agent and model, CI failure rate on submission, and reviewer time per agent PR, then track verified follow-up fixes after merge. Attribution down to source, harness, model, and credential makes those comparisons actionable. Fewer failures on submission can show that the environment has improved, while less time spent on review can show whether descriptions and execution evidence are helping. The decisive outcome is not simply more merged PRs, but more merged work that does not promptly require repair.

Sources

  1. Who Finishes the Job? A Study of Follow-Up Fixes and Commit Authorship on AI Coding Agent Pull Requests
  2. How AI Coding Agents Communicate: A Study of Pull Request Description Characteristics and Human Review Responses
  3. From Industry Claims to Empirical Reality: An Empirical Study of Code Review Agents in Pull Requests

More in Pull Request Automation