跪拜 Guibai
← All articles
AI Programming · Frontend · Programmers

AI Reviewers Can't Be Bribed into Leniency: A 5-Bug Experiment with Four Personas

By kyriewen ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

AI code review catches planted defects reliably, but severity ratings shift from P0 to P2 across runs, so a single model's triage call is a lottery. Teams can use AI as a detection filter, then apply voting across multiple reviewers or human review for prioritization.

Summary

kyriewen set out to test the urban legend that AI-written code reviewed by AI is just plagiarists grading each other. They wrote a 50-line React search hook with five planted defects: an uncleaned timer causing race conditions, a never-reset loading flag, unescaped user input in RegExp, an innerHTML XSS, and a missing dependency. Four AI reviewers, each with a distinct persona—senior neutral, harsh nitpicker, security-focused, and a deliberately encouraging 'team vibe' reviewer—were asked to review. The 'nice' reviewer opened with praise and a tilde, then flagged all five issues without mercy.

The author then tried three tricks to force leniency: inserting the overly kind persona, hand-crafting a textbook water-down review (LGTM with nitpicks), and telling the AI that the code was written by a human newbie versus an AI. Every approach failed. The forged review was rejected by three fresh AI instances, which re-found all five bugs. The human-newbie attribution got a polite Block, the AI attribution got a stark stereotype-driven Block.

The most useful finding came from severity inconsistency: the same bug got P0, P1, and P2 from different instances. The author concludes that detection is reliable, but severity ranking should be decided by voting across multiple reviewers, not by trusting a single model.

Takeaways
— All four AI reviewers, regardless of persona, found all 5 planted bugs (20/20 catches).
— The 'lenient encouraging' reviewer found every bug while being polite; persona affects tone, not detection.
— A hand-crafted lenient review (LGTM with nitpicks) was rejected by three new AI instances, which re-found all 5 bugs.
— Attribution changed tone: code labeled 'human newbie' got a polite but still Block; code labeled 'AI draft' got a harsher Block.
— Severity ratings for the same bug varied: loading deadlock got P0, P1, P2 across three instances; XSS got P0 and P1.
— The author recommends running two reviewers, taking the union of found issues, and voting on severity rather than trusting one.
Conclusions

The persona prompt alters how an AI reviewer phrases feedback but not how thoroughly it checks, so softer wording should never be read as softer judgment.

Inconsistent severity levels for the same bug across instances mean an AI reviewer can serve as a detector but not as a reliable judge of impact.

The experiment's clean results on a 50-line snippet don't transfer automatically to a sprawling legacy module, where context loss and ambiguity would likely degrade recall.

Concepts & terms
Persona prompting
Adding a role or personality description to an AI prompt to shape tone, style, or behavior. In this experiment, persona changes how a reviewer speaks but not how strictly it checks.
P0/P1/P2 severity
Common triage labels for coding issues, where P0 is a blocking critical bug, P1 is high priority but not blocking, and P2 is lower priority such as code style or minor improvements.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗