How to review AI-generated code at scale
When coding agents write most of the code, line-by-line review stops working. People own the design and the merge rules. Automated review does the rest.
Published · 5 min read

You review AI-generated code at scale by putting human attention on the design, before any code exists, and on the rules for what may merge. Automated reviewers check every small change in between. A separate review asks whether each change belongs in the system at all.
AI-generated code here means code that a coding agent, such as Claude Code or OpenAI Codex, writes from a prompt or a plan. Google’s 2025 DORA report found 90% of respondents using AI at work, and a negative relationship between AI adoption and delivery stability. “AI doesn’t fix a team; it amplifies what’s already there,” the report says.
Why doesn’t line-by-line review scale?
Agents produce changes faster than people can read them. In AI-first teams we have worked with, a handful of engineers can merge hundreds of pull requests a week, far more than anyone reads carefully.
DORA’s 2025 report found that without strong automated testing and fast feedback loops, “an increase in change volume leads to instability”. The 2024 report estimated that as AI adoption increased, delivery stability fell by 7.2%. Stability still had a negative relationship with AI adoption in the 2025 report, although the relationship with throughput had turned positive.
Researchers examined AI-generated snippets in public GitHub projects for a study published in ACM TOSEM. They found security weaknesses in 29.5% of the Python snippets and 24.2% of the JavaScript snippets, spread over 43 CWE categories.
Where should people review AI-generated code?
At the design, and at the merge when a change carries real risk. People stay in charge of the architecture: service boundaries, data structures and how the parts fit together.
Those decisions go into a design proposal, which the people who own the architecture review and approve. The agent then writes the implementation plan from it, listing the files that will change and how the work splits into small units. Nobody needs to read that plan line by line. Automated review checks the code against both the plan and the proposal.
Risky changes get a person at the merge, who approves with the review findings in front of them. Routine changes can be approved automatically, under rules the team writes and reviews.
How small should each change be?
One commit. In the setups that have worked best for us, the agent takes a plan one unit at a time. Each unit gets tests first, then the code, then the gates (types, lint, tests), then review. Only a reviewed unit becomes a commit, and only then does the agent start on the next unit in the plan.
Google’s engineering practices gave this advice before coding agents: small changes are reviewed more quickly and more thoroughly, and are less likely to introduce bugs. The 2024 DORA report lists “small batch sizes and robust testing mechanisms” among the basics of successful software delivery.
What should automated review check?
Mechanical checks come first. GitHub’s guide to reviewing AI-generated code says to “always run automated tests and static analysis tools first”. It also warns that agents sometimes delete or skip a failing test instead of fixing it.
Then the reviewers. Two or three reviewer agents per unit are enough, picked for what the diff touches. A database change gets a database reviewer. Login code also gets a security reviewer. Each finding is fixed before the commit or logged as a decision, with a reason.
A finished branch gets one more pass. These reviewers start with a fresh context and read the whole branch against the plan, looking for what per-unit review misses. Typical finds are requirements nobody implemented, and units that work alone but break when combined.
What is an automated architecture review?
It checks placement. A change can pass every test and every code review and still call the wrong service.
An architecture reviewer should look for a short list of problems:
- a call that crosses the wrong service boundary
- coupling, or extra hops between services, that nothing needs
- slow work done while a user waits
- jobs with no upper limit on how much work they take on
- a new mechanism for something the codebase already has
It runs on work in progress before a push, on pull requests and on architecture proposals in CI.
Who is accountable for AI-written code?
The people who set the merge rules. An automated approver can pass routine changes. People decide what counts as routine and answer for that policy. A new service boundary or an authentication change still goes to a named person. Branch protection should require an approval on every merge, and any admin override should be logged and reviewed.
Regulated organisations get their audit trail from this setup. Every change traces back to a plan, a review and an approval under a written rule. Defence companies and government agencies have more questions before they start, such as which information an AI tool may see at all. Our AI development training for defence and government starts there.
Where should you start?
- Write down the conventions agents must follow, in rules files they read.
- Have people write and approve a design proposal for changes to architecture or data structures.
- Let the agent write the implementation plan, in units that fit one commit.
- Run tests, type checks and static analysis before any review.
- Review each unit automatically, with two or three reviewers chosen per diff.
- Review each finished branch against its plan with fresh-context reviewers.
- Add an architecture review for changes that add a table, a client or a cross-service call.
- Require an approval on every merge: a person for risky changes, written rules for the rest.
- Track how often changes fail after release.
Sensitive systems also need regular security assessments. Automated review lowers the number of flaws that ship, and an assessment looks for the ones it missed.
How we help
We teach the method in AI development training, a four-hour onsite course where your developers plan, execute and review a feature with coding agents. Our software development services draw on the same experience.