26 October 2026
·6 min read
Delivery & CI/CDcode reviewAI generated codeCode Review for AI-Generated Code: The Reviewer of Record
When a model wrote the diff, the usual review habits stop working. A reviewer of record who neither wrote nor prompted the change, a recorded review scope and principal sampling keep validation honest.
Validation runs into a simple problem at code review: the person who would normally catch a mistake is often the person who prompted the model to make it. When a human writes a change, review works because a second set of eyes checks the first. When a model writes the change and an engineer accepts it, the two roles can collapse into one. Google's engineering practices guide, which sets out what a reviewer is responsible for, assumes those roles stay separate. Reviewing AI-generated code means rebuilding that separation on purpose.
This post covers code review for AI-generated code: who reviews it, what the review covers, how large a diff should be, and where the record of the review lives.
What the reviewer is actually responsible for
Google's guide, at google.github.io/eng-practices/review, describes the reviewer's job in concrete terms. The reviewer checks that the change is well-designed, that the functionality is good for the users of the code, that the code is as complex as it needs to be and no more, that tests exist and are correct, and that names and comments are clear. None of that changes because a model produced the diff. What changes is the risk that the reviewer leans on the author's understanding of the change, because with generated code there may be no author who understood it.
The guide is written for a world where a person wrote the code and can answer for it. Hold onto that assumption. The reviewer should be able to ask "why is this line here?" and get an answer that is not "the model put it there." If nobody can answer, the review has not happened yet.
Finding one: the reviewer of record should not be the person who prompted the change
The value of review comes from independence. If the same engineer prompts the model, skims the output, and approves it, you have one judgement doing two jobs. The approval records that a review happened; it does not record that a second person checked the first.
Action this week: write down a rule that for any change where a model produced the diff, the reviewer of record is someone who neither wrote the prompt nor accepted the model's output. Put the rule where your review guidelines already live. This takes no new tool. It is a line in your contributing guide and a habit your approvers can hold each other to.
Finding two: record the review scope on the change itself
Google's guide treats the approval as a statement that the reviewer looked at the change and stands behind it. With generated code, you want more than a thumbs-up. You want to know what the reviewer actually checked, because the failure modes of model output differ from the failure modes of a tired human. A model will produce code that compiles, passes the happy-path test, uses a plausible API that does not exist, and quietly drops an error case.
So record the scope. On the change, in a comment or a required field, the reviewer notes what they verified: did they run the tests, did they check the edge cases the spec called for, did they confirm the external calls are real, did they read the whole diff or sample it. This turns an opaque approval into an auditable record. Later, when something breaks, you can see what the review covered and what it did not.
Action this week: add one required field to your review template asking the reviewer to state what they checked. Keep it short. What counts is that the scope is written down and travels with the change, not that it is long.
Finding three: keep the batches small enough to review
Google's guide is blunt about size: small changes get reviewed faster and more thoroughly, and large ones get rubber-stamped. Models make this harder because they will happily emit a four-hundred-line change in one shot. A reviewer faced with that volume, who did not write any of it, will skim. A skimmed review of generated code is close to no review at all.
The fix is to cap the batch. Decide how large a generated diff a human can actually review line by line, and split anything bigger before it reaches a reviewer. If the model produced a sprawling change, that is a signal to break the task down, not to approve in bulk.
Action this week: look at the last ten changes your team merged that a model helped produce. Measure the diff size. If the large ones were approved in minutes, you have found where review is thinning out. Set a batch cap and hold to it.
Finding four: a principal engineer samples the record
Even with an independent reviewer and a recorded scope, review drifts over time. People get busy and the scope field gets filled in by reflex. The guard against that is sampling: a principal engineer periodically pulls a handful of recent changes, reads the recorded scope, and checks it against the actual diff. Did the review cover what it claimed to cover? This is not about catching an individual out. It keeps the review record honest, so that when you say "this change was reviewed," the statement means what it says.
Action this week: schedule a short recurring slot, every two weeks is enough, where a senior engineer samples five merged changes and reads the review record against the diff. Write down what you find. If the scope and the diff diverge, the review process needs attention before the code does.
Why this matters more when the diff was generated
These four moves are the same discipline Google's guide already assumes, applied to a case the guide did not anticipate. Human-written code arrives with a human who understood it. Generated code can arrive with nobody who did. The reviewer of record, the recorded scope, the batch cap and the sampling rebuild what made review work in the first place: a second independent judgement that can answer for the change. When you can name that person on every change, your merge history stops being a list of approvals and becomes a record of decisions someone will stand behind.
How Anystack works this way
Every change an Anystack pod lands starts as a written spec, passes machine checks before human review, and has a named reviewer of record. When a model assists the engineers, the reviewer of record is not the engineer who prompted it, the review scope is recorded on the change, and a principal engineer samples that record. The AI tools assist the pod and never occupy an engineer slot, so there is always a person who answers for the diff. You can see how the review and spec discipline fits the rest of the delivery method on how we work.
*Anystack Engineering runs three-person engineering pods that deliver inside your repositories with a written spec for every change, a named reviewer of record and delivery measured per engagement. Engagements from £18,000 per month. How the pod delivers.*
