Why Git Pull Requests Are the Right Audit Boundary for Agent Behavior Changes
Pull requests are where human judgment can still stop agent changes.

Agents-as-code means setting out how an agent behaves in version-controlled configuration files and reviewing changes through pull requests. The PR is the right audit boundary because it holds a complete proposed change before merge, where human judgment can still prevent it from reaching the main branch. That boundary must govern both agent outputs and agent definitions, with independent approval and infrastructure that prevents unreviewed side effects.
How coding agents went from suggesting lines to authoring and merging their own pull requests
Coding agents now read tickets, inspect repositories, call tools, edit files, run tests, and open pull requests. In some configurations, they can also approve and merge those requests. Their role extends beyond suggesting code for someone else to apply. They work across the development workflow, taking steps that used to be split between an author and a reviewer. The resulting unit of work is a proposed repository change.
Takerngsaksiri et al. tracked thousands of merged agent PRs across hundreds of repositories spanning five AI coding agents, documenting agent authorship at scale in open-source software. The same study found that more than three-fifths of agent PRs receive no recorded human review. Agent PRs complete within minutes to hours. These findings place autonomous contribution and limited recorded oversight in the same operational setting, where the interval available for human intervention is already short.
Why the PR is structurally different from every other point in the development workflow
The PR is distinct because the proposed change is both complete and held. Before that point, local edits, tool calls, and test runs take place in the agent’s working environment and have yet to form a single proposal that waits for approval. After merge, a correction is remediation. The PR occupies the intervening position where a reviewer can inspect what will change and withhold approval. That position makes it the natural checkpoint for human judgment.
The record has limits, however, because the proposal remains mutable. An agent can push new commits or force-push to the head branch after a reviewer has examined it. For example, a human might approve one revision, after which the agent changes the implementation while the earlier approval remains valid. The approved and merged changes would then differ. A PR can serve as a review boundary only if the approval is for the exact revision that passes through it.
Within that constraint, the PR creates an identity-attributed, timestamped record of what was proposed and who authorized it. The PR’s value comes from joining the proposed change to a decision before integration. If an agent’s repository permissions allow it to open, review, approve, and merge its own work, that decision is no longer independent. Policy enforced by the platform or repository architecture must preserve the separation.
Why agents fixing their own merged work does not substitute for pre-merge human review
Takerngsaksiri et al. found that merged agent PRs attract verified follow-up fixes at a markedly higher rate than merged human PRs. Those fixes also arrive early, with half of the 30-day incidence accumulating in the first week. Most fixing work stays within the agent population, often with the same agent correcting the issue it introduced. The loop closes, but it closes after merge.
An agent can bring the same blind spots to remediation that shaped the original implementation. Its ability to produce another patch does not establish that the first change was acceptable when authorized, nor does it supply an independent judgment of the repair. A self-correcting loop can improve an output while leaving the question of human accountability unanswered.
The same study found that PRs requiring many commits to reach completion had substantially higher odds of a verified follow-up fix. That is a pre-merge risk signal. A human reviewer could use it to scrutinize a proposed change before accepting it, rather than waiting for another agent-authored correction. Formal governance strengthens this distinction because it asks who authorized an action at the time.
What compliance frameworks require from an audit boundary, and how the PR satisfies them
Accountable agent deployments require unique agent identity, task-scoped authorization, runtime policy enforcement, human accountability, immutable audit trails, and scope isolation. A PR meets several of those requirements by tying who made the proposal and what it covers to a named reviewer’s decision. It does not satisfy every requirement by itself. In particular, its mutable head branch cannot stand in for an immutable history, and its approval controls cannot isolate an agent’s runtime environment.
The EU AI Act’s high-risk provisions sharpen the need for reconstructable decisions. The Digital Omnibus deferred the original August 2, 2026 deadline to December 2, 2027 for Annex III systems and August 2, 2028 for Annex I embedded-product systems. Organizations facing scrutiny of an AI-involved incident will need to reconstruct what their agents did, why, and with whose authorization. A record of activity alone does not establish who authorized it. The PR supplies the proposed change around which that evidence can be organized.
This is why static IAM, prompt rules, and after-the-fact logs are insufficient once an agent can execute actions. Permission to access a repository does not show that a human approved a given change, and a log of what happened may leave out whether anyone made a decision beforehand. The PR is the evidence artifact around that decision. “Approve this agent” grants broad confidence without identifying the accepted change. “Approve this exact commit with this rollback command” ties the decision to something an auditor or incident investigator can examine.
Why agents cannot reliably self-govern through the review step, and what independent review actually requires
Independent approval requires more than a second review pass. When the same model implements and reviews a change, shared training can cause it to accept the same faulty pattern twice. When the review also uses the implementation session, context bleed brings the original design assumptions into the assessment. The reviewer may defend a choice without challenging it. The separation needed here resembles the exclusion of an author from reviewing their own academic paper or an issuer from approving their own purchase order.
Yang et al. tested four frontier models against explicit repository contribution rules using 106 issues curated into RepoComplianceBench. Their study found that agents almost never proactively retrieved those rules. Reminder prompts, rule quotations, and verifier feedback improved some forms of compliance, but the agents never refused to contribute in AI-banned repositories under any tested condition. Written rules were not reliable enforcement on their own. A governance file therefore cannot guarantee that an agent will stop at a mandatory review gate.
The architectural consequence is a separate source of judgment. A reviewer must not simply reuse the implementer’s session context and learned assumptions as the basis for approval. Cross-vendor review, using a different model family, is one structural approach to reducing shared blind spots rather than a recommendation for a particular product. A human reviewer provides another independent perspective. Where the boundary requires human accountability, however, automated review can support a decision that remains the named human’s responsibility.
What must be true for the PR boundary to hold under autonomous agent workflows
For a team to rely on this boundary, four conditions must hold together. The agent cannot self-merge, new pushes revoke stale approvals, review covers cross-file effects, and the PR includes the agent’s session trace. Each closes a different gap in authorization. Branch protection or platform architecture must stop the agent from approving its own work, because a written rule still leaves it able to do so.
Approval must also end when the proposal changes. Otherwise, the stale-approval scenario permits an unreviewed revision to inherit authority granted to an earlier one. Approval of a named commit hash, with a specified rollback command, makes the accepted revision explicit. This gives the human decision a precise object. The agent remains free to revise its proposal, but revision cannot preserve authorization for content the reviewer has not seen.
A renamed field in a shared client can break consumers in files absent from the diff. A reviewer without those consumers in its indexed scope cannot assess that cross-file impact, so approval authority must stay within the dependencies the reviewer can examine. The PR body must also have the agent’s reasoning trace, tool calls, and prompt version. Those records let the human examine the session behind the output.
CODEOWNERS entries should assign those files to a designated reviewer group so that behavior changes receive the same gate as production-code changes. This review step follows from the boundary’s purpose, because changing the instructions that shape future work changes what the agent is authorized to attempt.
How do agent definitions stored in Git change what the PR audits?
Version-controlled agent configuration makes behavior itself a reviewable change. A PR can then alter either what an agent produces or the instructions under which it produces future work. The distinction changes the reviewer’s task. An implementation diff asks whether a given output is acceptable, while a configuration diff asks whether the behavior that guides future outputs is acceptable. For both, a named human must decide before the change takes effect.
Yang et al. found that context files were the main way to configure agents across the 2,923 GitHub repositories they studied, with AGENTS.md becoming an interoperable standard that works across tools and projects. These files make behavioral instructions visible in the repository. They do not, by themselves, establish that an entire agent can be declared in a configuration language without general-purpose programming code. The evidence supports the agents-as-code principle of versioned configuration under normal review, but does not show that a platform can run an agent strictly through configuration-only operation.
A silently modified AGENTS.md or a prompt injection hidden in a document can redirect behavior unless the relevant change encounters an enforced gate. File ownership helps send configuration changes to reviewers who are accountable for them, but it cannot stop every instruction an agent comes across. Rules that an agent must never break need to be enforced in a sandbox, CI hook, or branch protection, beyond what a markdown file can do. This connects configuration review back to governance, because the PR must govern the instructions that govern the agent without mistaking those instructions for enforcement.
How session-scoped credentials and sandbox isolation make the PR boundary meaningful rather than ceremonial
A PR records what the agent proposes to merge, but an agent with production access may already have acted outside that proposal. In that case, the checkpoint is too late. For it to serve as an audit boundary, pre-merge work must stay in an environment that cannot affect production systems without the required authorization. Repository governance and runtime containment therefore have to reinforce each other.
As the number of agents grows, isolation keeps their work within limits that repeated approval prompts cannot enforce. The agent runs in a container or VM that mounts only the relevant project, uses a throwaway worktree, and cannot reach external systems unless the task explicitly requires it. Session-scoped credentials, which a managed platform for running Claude Code and Codex in production such as Ellipsis mints per session inside isolated cloud sandboxes rather than just handing a VM an API key, then limit how long that access lasts. Revocation on completion prevents a compromised or misbehaving agent from accumulating usable access across sessions. The PR consequently represents the output of a bounded session rather than the visible residue of unrestricted activity.
Resource limits complete that containment by bounding execution as well as access. Idle VM shutdown, turn caps, and token budgets per session constrain runaway work before a reviewer sees its output. Budgets per session, developer, team, and time period also set layers of cost limits that can be enforced before the work is done. Cost becomes part of the auditable record. With those controls in place, the human approval at the PR boundary authorizes a contained change, rather than documenting a decision after its consequences have already escaped.
Sources
- Who Finishes the Job? A Study of Follow-Up Fixes and Commit Authorship on AI Coding Agent Pull Requests
- A First Look at Coding Agents' Compliance with AI Contribution Rules in Open-Source Communities
- How AI Coding Agents Modify Code: A Large-Scale Study of GitHub Pull Requests
- AI-to-AI Code Reviews of GitHub Pull Requests
- From Traceability to Justifiability: Accountability Structures in Agentic Software Engineering


