Agentic Pattern Libraryby Vikas Goyal
← All patterns
53

AI First-Pass Review

Also known as: AI code review, pre-review, review triage

An AI reviewer checks every change before a person does, so human review time goes to the parts that need judgment.

TrackAI-native software delivery FamilyVerify Maturity Emerging ChangesVerification
01

Problem

Coding agents produce changes faster than people can review them. Reviewers either fall behind, so changes wait in a queue, or they skim, so problems reach production. Much of their time goes on issues a machine could catch: missing tests, unhandled errors, inconsistent naming, a forgotten migration.

  • Human review is the scarce resource once agents write most of the code.
  • Many review findings are mechanical and repeat across changes.
  • An AI reviewer that flags everything trains people to ignore it.
  • Judgment about design, intent and risk still needs a person.
02

Solution

Run an AI reviewer on every pull request as soon as it opens, after CI. It checks the change against the team’s review checklist and the linked spec or ticket, and posts numbered findings with a severity and a line reference. It also writes a short risk summary for the human reviewer: what changed, which parts carry the most risk, and what to look at first. The author, human or agent, fixes the mechanical findings before a person reviews. The human reviewer starts from the risk summary and decides; the AI reviewer never approves or merges. Track which AI findings people accept or dismiss, and tune the checklist from that.

03

Diagram

Pull requestCI passed AI reviewerchecklist + speccomments only Findingsseverity · line refs Risk summarylook here first Author fixesmechanical issues Human reviewjudgment · approves accepted / dismissed findings tune the checklist

The AI pass clears mechanical issues and points the human at the risky parts. Approval stays with a person.

04

When to use

Use it when

  • Review queues grow as agents open more pull requests
  • Reviewers spend much of their time on repeatable, mechanical issues
  • You have a written review checklist or can write one
  • Teams want faster review without lowering the bar

Avoid it when

  • Low change volume where human review keeps up easily
  • When it would replace human review instead of focusing it
  • Before CI exists; let tests catch what tests can catch first
05

Trade-offs

Latency Runs in minutes; shortens human review time
Cost One model pass per pull request
Complexity Checklist, CI integration, finding format
Reliability Catches mechanical issues consistently; humans keep judgment

Gains

  • Human reviewers spend their time on design and risk
  • Mechanical issues fixed before a person looks
  • Accepted and dismissed findings show what the team actually cares about

Costs

  • Noisy findings erode trust quickly
  • Risk of reviewers rubber-stamping what the AI passed
  • Another tool to tune and maintain
06

Worked example

Scenario
A 12-person payments team where agents now open more pull requests than reviewers can keep up with.
  1. Pull requestAn agent opens a PR that adds partial refunds: 9 files and about 350 lines. CI passes.
  2. AI reviewerPosts 6 findings. High: the refund amount isn’t checked against the original charge. Medium: no test for a currency with 3 decimal places. Four low: naming and docstrings.
  3. Risk summary“Riskiest part: refunds/service.py lines 40–88, where money moves. Ledger entries look correct. Check the rounding.”
  4. AgentFixes the high and medium findings and 3 of the low ones, and explains why it skipped the fourth. CI passes again.
  5. Human reviewerStarts from the risk summary, reviews the money-handling code closely and approves.
  6. Monthly tuningReviewers dismissed most docstring findings, so that check is turned off. Missing-test findings were almost always accepted, so they’re raised to medium.
07

Failure modes

FailureSymptomMitigation
NoiseDozens of low-value findings; people stop reading themSeverity levels and an effort setting (low shows only high-confidence findings); tune the checklist from accept and dismiss rates
Rubber-stampingHumans approve whatever the AI passedThe human reviews the risk summary's hot spots, not just the AI's verdict
AI approves or mergesChanges land with no human judgmentThe AI reviewer can comment only; branch protection requires a human
Same blind spots as the authorAI reviewer misses what the coding agent got wrongUse a different model or prompt for review than for writing code
Bot comments obeyedAgent changes code because another bot claimed a problemTreat bot comments as claims to verify against the code, citing file and line