Stop letting your AI coding agent review its own pull requests

a computer screen with a bunch of code on it

Your autonomous coding pipeline is merging dozens of pull requests a day. You don’t have time to review every diff. So you let the same model that wrote the code check its own work. That’s the mistake.

Models score their own outputs higher than a neutral judge would. Research on self-preference bias confirms it: judges built from the same model family consistently rate their own outputs more favorably. The builder and the verifier need to come from different vendors, not just different prompts on the same model.

The Dark Factory Pipeline

The pattern, which the author calls a dark factory pipeline, borrows from lights-out manufacturing: a spec goes in, production code comes out, and no human touches the happy path in between. Foxconn replaced over 60,000 workers at its Kunshan plant with robots running around the clock. The idea translates directly to an autonomous coding setup.

A dark room with a large machine in it

Three components make it work:

  1. Builder model: writes code from a spec, cannot approve its own diff.
  2. Adversarial verifier: a separate model from a different vendor whose only job is to find faults. It rejects the pull request and explains what’s wrong. It does not fix the issue itself.
  3. Sampling gate: a defined percentage of merged pull requests, chosen at random, goes to a human reviewer. Not the easiest ones. Not the newest ones. Random.

The Prompt Structure That Makes It Work

The difference between a useful setup and an expensive rubber stamp comes down to how you prompt each role. Here’s the contrast the author lays out:

Bad prompt:

Write the pull request for the new caching layer, then review
your own diff and tell me if it's ready to merge.

If it looks fine to you, merge it directly. I don't need to see
it unless you have doubts about your own work.

Good prompt:

Model A (builder): write the pull request for the new caching
layer from the attached spec. Don't approve your own diff.

Model B (verifier, different vendor than Model A): review the
diff looking only for defects. Reject it if you find any, and
explain exactly what's wrong. Don't fix it yourself.

Route 10% of every batch of merged pull requests, chosen at
random, to a human reviewer. Log every case where the human
overrides Model B's verdict, in either direction.

Keep track of the defects found by a human reviewer

⚠️ What to Watch Out For

  • Set the sampling rate too low and systemic drift compounds across dozens of merges before you notice. By then it’s an incident review, not a code review.
  • Two models agreeing isn’t the same as correctness. You still need a human in the loop for the sampled slice.
  • Adversarial review catches obvious defects but can still miss subtle domain logic errors that neither model was trained to recognize.
  • This setup requires running multiple distinct model APIs in sequence, which adds cost and latency compared to a single-model workflow.

Every case where a human overrides the adversarial verdict gets logged and fed back as a correction signal for the next run. That override log is also how you tune your sampling rate over time.

Stay on top of AI & Automation with BizStack Newsletter
BizStack  —  Entrepreneur’s Business Stack
Logo