Human-in-the-loop AI code review: where the human should decide
Design advisory AI review so models gather evidence and prioritize findings while humans retain ownership of intent, risk, architecture, exceptions, and the final merge decision.
Design advisory AI review so models gather evidence and prioritize findings while humans retain ownership of intent, risk, architecture, exceptions, and the final merge decision.
“Human in the loop” can mean little more than placing an approval button after an automated decision. In code review, that is not enough. The useful boundary is epistemic: models can inspect a diff, retrieve context, propose failure modes, and organize evidence, while people decide what the software is meant to do, which tradeoffs are acceptable, and whether the evidence warrants a change. The interface should reinforce that division.
Post generative reviews as advisory comments by default. A COMMENT event lets the finding enter the pull-request conversation without changing merge state. This does not make the review casual. Findings should still be schema-valid, evidence-backed, filtered by confidence, and ordered by impact. Advisory describes authority, not quality. The bot earns influence through repeated usefulness rather than receiving it from branch protection on day one.
AI is well suited to tracing changed values through nearby functions, comparing a patch with explicit repository policy, enumerating failure cases, noticing a missing test branch, and summarizing several specialist outputs. Ask it to cite the changed line and explain the runtime or security path. Avoid asking it to make product-priority decisions, infer undocumented business rules as facts, or declare that an uncertain architectural preference must block release.
A maintainer should be able to dismiss a finding without arguing with a chatbot. Provide concise reasons such as incorrect, already handled, out of scope, duplicate, unclear, or accepted risk. Store the reason with model and prompt versions. This gives teams a feedback loop while preserving the right to disagree. Do not automatically regenerate a rebuttal after every dismissal; that turns review into a debate the human did not request.
Escalation should be narrow. A repository may choose to turn a proven pattern into a required deterministic check, or require human approval from a security owner for sensitive paths. That is different from allowing a general model verdict to block every pull request. Enforcement deserves a clear rule, an owner, a remediation path, and a way to handle tool failure. Generative uncertainty should not become invisible organizational policy.
Authors remain responsible for submitted code, including code generated by another model. Reviewers remain responsible for the merge decision. Product and security owners remain responsible for accepted risk. The AI service is responsible for accurately representing what it reviewed, which models and configuration it used, and whether the run was partial or stale. These ownership lines prevent automation from becoming a place where decisions disappear.
Evaluate whether findings help humans make better decisions with tolerable effort. Track accepted and dismissed outcomes, read comment threads, sample misses, and ask maintainers whether the review is worth attention. Do not set a target for replacing a percentage of human reviews. A healthy human-in-the-loop system becomes a dependable evidence-producing stage while leaving judgment visible, contestable, and owned by the people shipping the code.
The same principle applies when the AI reports no findings. A clean result means only that the configured reviewers found nothing above their evidence and confidence thresholds in the scope they examined. Display scope, head commit, and partial-review status so humans can interpret that silence. Absence of automated feedback should preserve, not cancel, the team’s normal review and testing responsibilities.
PR Quorum turns specialist reviewer output into one clean GitHub review, with noise controls and predictable usage caps.