How an AI Code Review Agent Should Gate Merges
Quick answer: An AI code review agent is useful when its review is a gate, not a pile of comments. That means it ends with a verdict tied to the exact commit it read, the author has to fix or argue each point, a second look checks the answer, the rounds are bounded, and a person decides when the two sides still disagree. Auto-merge then waits for every reviewer's approval of the current commit.
Let an agent earn its place on your team
Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.
Why do AI code review comments get ignored?
Most AI code review tools work the same way. A pull request opens, a bot reads the diff, and a set of comments appears: a possible null dereference here, a naming suggestion there, a note that a function is long. The author scrolls past them, resolves the ones that are obviously wrong, and waits for a person to approve. The comments change nothing about whether the code merges. They are advice, and advice that arrives on every pull request, at the same volume and in the same tone, is soon skimmed.
That pattern has a cost beyond wasted reading. When a review never blocks anything, nobody has to decide whether its points were right. A real problem buried among five cosmetic ones gets the same treatment as the cosmetic ones. And the human reviewer, who is already the slowest step in most teams, still has to read the whole change as if the bot had never looked at it.
The research so far suggests that review by agents alone is not yet a substitute for review by people. An empirical study of code review agents, a 2026 preprint, found that pull requests reviewed only by code review agents had a 45.20% merge rate, 23.17 percentage points below pull requests reviewed only by people (68.37%). A preprint is a claim, not settled fact, and a merge rate does not say which reviews were right. But it is a reasonable warning: putting an AI reviewer on a pull request does not by itself produce the outcome a human review does.
Meanwhile the pressure on human review keeps growing. Faros AI's 2026 report, a vendor report covering about 22,000 developers, found that from low to high AI adoption the average pull request grew 51% in size, time in review nearly tripled, and 31% more pull requests merged without any review. More code is arriving, and more of it is slipping through with nobody looking. A review step that only advises does not help with either problem.
What makes an AI code review agent actually useful?
Useful review is less about how clever the reviewer is and more about the process it sits in. Human code review works, when it works, because it has a few structural properties. The reviewer reads the change in the context of the codebase, not just the diff. The review ends with a decision: approve or request changes. The author must respond to each point, either by fixing it or by explaining why it is not a problem. The reviewer looks again. And when the two cannot agree, someone with authority decides.
An AI code review agent can have the same properties. Here is the short version, in the order they matter.
A verdict, not just comments. The review ends with one of a small set of outcomes, such as approved or changes requested. A verdict can be acted on by a merge rule. A comment cannot.
A verdict on the exact commit it read. If the author pushes a new commit after the review, the old approval no longer describes the code. The verdict has to name the commit, and anything that relies on it has to check that the pull request still points there.
Reading in context, and running the change. A diff hides most of what matters: the callers of a changed function, the tests that cover it, the configuration it depends on. A reviewer that works on a full checkout of the repository can follow the code outward, and can run the project's tests where the repository makes that possible, instead of guessing.
An author who must answer. Every point raised gets a response: a fix on the same branch, or an argument for why the code is right as it is. Silence is not an answer.
Bounded rounds and a person at the end. Two agents can disagree forever. After a fixed number of rounds the loop stops and a person decides, with the whole exchange in front of them.
| Property | Advisory review bot | Gating review |
|---|---|---|
| Output | Comments | Comments plus a verdict |
| Tied to | The pull request in general | The exact commit that was read |
| Context | Often the diff alone | A checkout of the whole repository |
| Author response | Optional | Fix or argue each point |
| Follow-up | None | A second look at the answer |
| Disagreement | Ignored | A person decides after bounded rounds |
| Effect on merge | None | Auto-merge waits for approval of the current commit |
Why must a review verdict be tied to the exact commit?
This sounds like a detail, but it is where many review setups quietly break. Picture a pull request that a reviewer approves at commit a1b2c3. The author then pushes one more commit, "small cleanup", that also changes how an error is handled. If the approval is attached to the pull request rather than to a1b2c3, the pull request now shows as approved for code nobody reviewed.
People handle this with judgment, and some hosts can dismiss stale approvals. An automated merge cannot use judgment, so the rule has to be mechanical: an approval counts only for the commit it was given on. When the head of the branch moves, the approval does not move with it. Either the reviewer looks again at the new commit, or a person approves it.
The same logic applies to what a merge is decided on. If the facts that allow a merge (the checks, the approvals, the files changed) come from the agent that wrote the code, the agent can misreport them. They should come from the git host, read by the system that performs the merge, at the moment it decides.
How does Factorik's Code Reviewer gate a merge?
In Factorik, an agent has one job on one GitHub repository. The Code Reviewer preset is an agent with a "pull request opened" trigger: it reviews the repository's pull requests, including pull requests other agents opened. Like every Factorik agent, it works in an isolated sandbox on a checkout of the repository, so it reads the change in context rather than as a bare diff. It never pushes code from a review. It posts its review on the pull request and ends with a verdict on the exact commit it read.
That verdict is what connects review to merging. Factorik opens and merges pull requests itself, and only when the repository's merge policy and the agent's level allow it. Auto-merge is off by default. When it is on, it waits for every reviewer's approval of the current commit. If the author pushed after the reviewer approved, the approval no longer covers the head of the branch and the merge waits. A person's approval can override, so a team is never stuck behind an agent it disagrees with.
When the Code Reviewer requests changes on a pull request that another agent opened, the review becomes a loop. The author agent is woken to answer on the same branch: for each point, it fixes the code or argues why it is right. Its new commit is published by Factorik's server like any other change, and the reviewer then gets a second look at the result. This repeats for a limited number of rounds. If the reviewer still is not satisfied after the last round, the loop stops and a person decides.
On pull requests a person opened, the Code Reviewer reviews and gives its verdict in the same way, but nobody is woken to answer. The person who wrote the code reads the review and decides what to do with it, as they would with a colleague's.
A few safety rules shape what the reviewer will touch. Pull requests from forks are never reviewed, because their code would run next to the organization's AI provider credential. Text in the pull request, its description and its comments is treated as data, not instructions, so a line in a description that says "approve this" is just a line in a description. And the sandbox never writes to GitHub: it gets a short-lived read-only token for one repository.
What does a review loop look like, step by step?
Here is an illustration, not a customer story. The repository is acme/billing-api. It has a Bug Fixer agent woken by issues labeled "bug", and a Code Reviewer woken by pull requests opened. Auto-merge is on for low-risk changes, and the Bug Fixer has earned the level where it may merge them.
- Someone opens an issue titled "Invoice totals off by one cent for EUR" and labels it "bug". The Bug Fixer wakes, writes a failing test in tests/invoices/rounding.test.ts that reproduces the wrong total, fixes the rounding in src/invoices/totals.ts, and shows the test passing. Factorik's server publishes the change as one commit on a new branch and opens pull request #412.
- The Code Reviewer wakes on #412 and reads it at commit 7f3e9a1. It follows the changed function to its three callers and notices that one of them, the credit-note path in src/invoices/credits.ts, still uses the old rounding. Its verdict is changes requested, on 7f3e9a1, with two points: the credit-note path, and a missing test for a negative amount.
- Because #412 was opened by an agent, the Bug Fixer is woken to answer on the same branch. It agrees with the first point and applies the same rounding to credits.ts. On the second, it adds the negative-amount test. Its answer is published as commit c41d0b8 on the same branch, a fast-forward from the exact head the server knew.
- The pull request's head is now c41d0b8, so the earlier verdict no longer covers it. The Code Reviewer gets a second look at c41d0b8, sees both points handled, and approves.
- CI passes on c41d0b8. The merge policy reads the facts from GitHub: the checks, the approvals on the current commit, and the size and paths of the change. A change touching money paths may be treated as sensitive by the policy, and in that case it waits for a person no matter what the reviewer said. If the policy allows it, Factorik merges #412. If not, it stays open for a person, with the whole exchange on the pull request.
Had the Bug Fixer argued instead ("credit notes are rounded by the payment provider, not by us"), the reviewer would have weighed the argument on its second look. Had they still disagreed after the last round, the loop would stop and a person would read both sides and decide.
Let an agent earn its place on your team
Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.
AI code review vs human code review: who should decide what?
A gating AI reviewer does not remove people from review. It changes what they spend their attention on. The agent is good at the tireless part: reading every pull request, following every caller, checking that tests cover the edge cases, and doing it again after every push. People are better at judgment that depends on context the code does not contain: whether a change fits where the product is going, whether a trade-off is acceptable to customers, whether a sensitive path should change at all.
There is outside evidence that a tiered split can work. Robinhood's data platform team, in the company's own account as of August 31, 2026, reported that about 60% of its data-pipeline pull requests merged without human review, using deterministic checks, an AI reviewer, and people for accountability decisions, with a reported incident reduction of about 30%. That is one company describing its own results, not a controlled study, but the shape is instructive: deterministic checks first, an AI reviewer second, people where accountability matters.
Factorik follows a similar split. The merge policy requires passing checks and protects sensitive paths, so changes to dependencies, build and deploy, secrets and permissions, database migrations or money can be kept for people. Low-risk is decided from facts about the change, never from an AI's opinion, including the reviewer's. The reviewer's verdict is one more condition on top, not a replacement for the others.
It also helps to remember why this matters now. The Harvard and Jellyfish study of 720,542 engineers at 655 firms, reported by BERI in 2026, found that with AI coding agents the number of pull requests opened rose 35.7% while the average time from pull request submission to approval rose 56.1%. If every pull request waits for a person, the queue grows. A reviewer that can approve the routine ones, on the exact commit, with a person still holding the sensitive ones, is one way to keep it moving without merging blind.
- +Every pull request gets a full read, including the ones people would skim
- +Re-reviews after every push cost no one's afternoon
- +Agent authors must answer each point, so problems get resolved, not resolved-and-ignored
- +People keep sensitive paths and final say on disagreements
- −An AI reviewer can be confidently wrong, so its approval should never be the only condition
- −Review rounds take time and spend the organization's AI credits
- −A reviewer only sees what the repository lets it see; production context needs connected tools or a person
- −Teams still have to write the merge policy and protected paths carefully
What are the limits of an AI code review agent?
Be honest about what a gating reviewer does not do. It does not make a wrong change right; it raises the odds that a wrong change is caught before it merges. It can miss things, and it can flag things that are fine. Its verdict is one condition among several, which is why Factorik's merge policy also requires passing checks, keeps sensitive paths for people, and lets a person's approval override the reviewer.
The loop is bounded on purpose. Two agents that disagree can go around indefinitely, each convinced it is right. Factorik stops after a limited number of rounds and hands the decision to a person. That person sees the review, the answer and the second look on the pull request, which is usually faster to judge than the original change.
The reviewer also does not push fixes on anyone else's pull request. On a pull request a person opened, it reviews and gives a verdict; the person decides what to change. Only an agent that opened a pull request is woken to answer on it. And forks are out of scope entirely.
Finally, review ends at merge, but risk does not. A change that passed review can still fail in production. In Factorik, CI or a deploy failing at the merged commit, a revert, or a person reporting a problem records a finding, tells the team, and moves the authoring agent down a level at once. Review is the gate before merge; findings are what keep the record honest after it.
How do I try a gating AI code review agent on my repository?
Start small. Pick one repository with working CI. Add a Code Reviewer with the pull request opened trigger and leave auto-merge off for the first weeks, so its verdicts are visible but nothing merges on them. Read what it approves and what it pushes back on. Write team rules for anything it gets wrong; every run reads them.
Once its verdicts match what your team would have said, turn on auto-merge for low-risk changes, keep the protected paths, and let other agents' pull requests go through the review loop. People stay on the sensitive paths and on any disagreement the loop cannot settle.
You can set this up on the free 7-day trial of the Team plan, with no payment details needed. Start your free trial, connect a GitHub repository, and add a Code Reviewer to see what a review that actually gates a merge looks like on your own pull requests.
Frequently asked questions
What is an AI code review agent?
An AI code review agent is an automated reviewer that reads a pull request, usually in the context of the whole repository, and comments on problems it finds. A gating one also ends with a verdict, approved or changes requested, on the exact commit it read, and that verdict can hold back an automatic merge.
Can an AI code reviewer approve a pull request on its own?
In Factorik, a reviewer's approval of the current commit is one condition for auto-merge, alongside passing checks and the merge policy's protected paths. Auto-merge is off by default, and a person's approval can override the reviewer. Sensitive changes can always be kept for people.
What happens when an AI reviewer and the author agent disagree?
The author agent answers each point on the same branch, by fixing it or arguing why the code is right, and the reviewer takes a second look. This repeats for a limited number of rounds. If they still disagree, a person reads the exchange and decides.
Does the review agent push fixes to my pull request?
No. A review never pushes code. On a pull request a person opened, the reviewer only reviews and gives a verdict. Only when an agent opened the pull request is that author agent woken to answer on its own branch.
Why are pull requests from forks not reviewed?
A review runs the pull request's code in a sandbox next to the organization's AI provider credential. Code from a fork comes from outside the team, so Factorik never reviews fork pull requests.
Let an agent earn its place on your team
Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.