Two approaches to AI code review are converging in 2026. One is the one-off review prompt: paste a diff, ask for security or readability feedback, act on it, close the tab. The other is the dedicated review agent: a persistent config that runs the same review logic against every PR, carries context between runs, and enforces team standards. Prompts are fast and cheap per use; agents are consistent and accumulate knowledge. The interesting answer, most of the time, is both.
Two Approaches, Briefly
A review prompt is a block of text you send to an AI once, scoped to the code in front of you — a security audit on this PR, a readability pass on that one, an architecture look at a third. Each invocation is tailorable; none share state. Five patterns for one-off reviews: 5 prompt patterns for AI-assisted code review.
A review agent, in the agentic AI sense, is longer-lived. It has a persistent rubric and runs against every PR, push, or merge queue entry. It typically has memory across runs — repo conventions, past reviews, prior decisions it flagged. When teams talk about "AI PR review" in CI, they usually mean an agent.
The pillar, The Complete Guide to Prompting AI Coding Agents, covers the broader shift from prompts to agentic workflows.
Prompts vs. Agents at a Glance
| Dimension | One-off prompt | Dedicated review agent |
|---|---|---|
| Setup cost | Seconds — paste and go | Hours to days — rubric, wiring, tuning |
| Per-review cost | Low (one model call) | Amortized low, but higher token usage per run |
| Consistency across PRs | Drifts with whoever wrote the prompt | Same rubric every time |
| Customization for this PR | Trivial — edit the prompt | Awkward — usually needs config change |
| Codebase awareness | Only what you paste in | Accumulates over runs |
| Team standardization | None — everyone prompts differently | Strong — one rubric for the team |
| Review blast radius | What you chose to paste | Every PR, unless filtered |
The rows tell the story. Prompts optimize for flexibility and low setup; agents optimize for consistency and scale. Most of the friction teams hit comes from picking one approach for every problem instead of picking per problem.
When Prompts Win
- Ad hoc scrutiny on a specific concern. You suspect this PR has an auth issue. You do not need the security audit running on every PR — you need it running on this one. A targeted prompt returns in a minute.
- Exploratory review. You are not sure what could be wrong. You want the AI to surface things you might not have thought to check. An agent with a fixed rubric looks at a fixed set of things; a prompt can open-endedly probe.
- Code outside the agent's rubric. The agent knows your backend. The review is on a one-off Bash script, a migration, a Terraform change. Editing the agent config for a one-off is wasted effort.
- When you need the review to match your own judgement, not the team's. You have an opinion the rubric does not encode — about taste, about a specific architectural direction. A prompt lets you ask the question your way.
The common thread: the review is not something you want repeated on every PR forever. It is a thing you want answered now and then forgotten.
When Agents Win
- Team-wide consistency. Six developers each writing their own review prompt produce six review styles. An agent produces one. For a shared codebase, one style is usually what you want — divergent reviews create inconsistent code.
- Cross-PR standards. "We always check for missing input validation." "We always flag new files that introduce a new dependency." These are rules that only pay off if they run every time. A prompt anyone might forget to run is not a rule.
- Accumulated codebase context. Over dozens of PRs, a well-designed agent builds context about the conventions you actually follow — error handling patterns, naming conventions, where prose docs are misleading. A prompt starts fresh every time.
- High-volume merge queues. When a team is merging thirty PRs a week, nobody has time to paste each one into a chat. The agent runs without a human prompting it, flags what needs attention, and lets the clean ones through.
- Enforcement of standards that need to be seen to be believed. A rubric in a CONTRIBUTING.md is aspirational. A rubric enforced by an agent that comments on every PR is lived.
Designing a Review Prompt
A useful one-off review prompt has four parts:
- Role and scope. "Security engineer reviewing this diff" beats "review this code." Narrower roles produce sharper feedback.
- A rubric. A short checklist of what counts as an issue. Five to seven items is the sweet spot. See prompt patterns for code review for starting points.
- A severity scheme. Critical / High / Medium / Low beats a flat list. Without severities, a typo reads the same as a SQL injection.
- A format. Line numbers, quoted code, suggested fix. The less the reviewer has to do to act on the feedback, the more feedback they act on.
Example review prompt (hypothetical)
You are reviewing a pull request for a TypeScript/Next.js app. The diff below
is a new API route handler under app/api/users/route.ts.
Review for:
1. Auth check — does the route verify the caller before mutating?
2. Input validation — are POST body fields validated against a schema?
3. Error handling — are thrown errors caught and mapped to clean responses?
4. Secret exposure — does the code log or return anything it should not?
5. Rate limiting — is there a limiter in front of this route?
For each finding:
- Severity: CRITICAL / HIGH / MEDIUM / LOW
- File and line
- Quote the problematic code
- One-paragraph fix with sample replacement code
If a category has no issues, omit it. Do not invent problems to fill
categories.
Diff:
[paste diff here]
Prompts of this shape, run before opening a PR, catch a meaningful fraction of issues that would otherwise cost a review round.
Designing a Review Agent
An agent is a long-lived thing with a configuration you maintain. Five elements matter:
- Trigger. What inputs fire the agent? Every PR? Only PRs that touch
src/? Broad triggers produce noise; narrow triggers produce coverage gaps. - Persistent rubric. The checklist that runs every time. Think of this as your team's CONTRIBUTING.md encoded as instructions the agent applies mechanically.
- Context sources. What the agent can read. Usually at minimum: the diff, changed files, current branch. Often also: PR description, adjacent files, past review comments, the style guide. More context helps; more context also costs tokens.
- Output format. Inline comments on the PR? A single summary comment? A CI log report? Inline scales; summary reads easier; CI logs get ignored. Pick one.
- Escalation rules. What does the agent do on a critical finding? Block the merge? Tag a human? Open a linked issue? Silent failure is the common accident — agent flags a critical issue in a tab nobody reads, PR merges anyway.
Example review agent spec (hypothetical)
Agent name: pr-review
Trigger: opened and updated PRs touching src/** or app/**
Scope: files changed in the PR; allowed to read adjacent source for context.
Persistent rubric (runs every time):
1. Auth check on new or changed API handlers
2. Input validation on new endpoints
3. No new secrets in code
4. Error handling consistent with lib/errors.ts
5. New dependencies justified in PR description
6. Public functions have tests in a matching _test file
7. Large diffs (>500 lines) prompt a request to split
Severity: CRITICAL / HIGH / MEDIUM / LOW, with CRITICAL blocking merge.
Output: one summary comment plus inline comments on HIGH and CRITICAL findings.
Escalation: CRITICAL findings @-mention the code owner listed in CODEOWNERS.
Memory: keeps a rolling log of review findings per repo to avoid re-raising
the same waived issue twice.
The shape is more elaborate than a prompt, and that is the point — the setup cost amortizes over hundreds of reviews. The agent is also a better target for autonomous testing of its own rubric: feed it synthetic diffs and assert it flags what you expect.
Cost Comparison
Prompts look cheap because the per-call cost is small — but the hidden cost is the developer time spent writing, running, and consuming each prompt manually. Agents look expensive because the initial build takes real time and each run uses more tokens — but they amortize over every PR they service.
A few rules of thumb:
- For a team merging fewer than five PRs a week, a prompt workflow is probably cheaper. The overhead of maintaining an agent config outpaces the runs.
- For a team merging dozens per week, an agent pays for itself within a couple of months. Developer time not spent writing or running review prompts is worth more than the extra tokens.
- Agents with memory or retrieval use more tokens per run than naive prompts. A retrieval-augmented review that reads adjacent source is noticeably more expensive than a "paste diff into chat" review.
- Prompt workflows are highly variable across individuals; agent workflows are flat. The prompt-only team has heroes who run thorough reviews and developers who skip them. The agent team has the same floor for everyone.
The Hybrid Approach
Teams that do this well end up with both. The split that works:
- The agent runs on every PR with a stable, narrow rubric: security checks, standard patterns, dependency changes, test coverage on new public functions. Things that are repeatable and team-wide.
- Developers reach for prompts on top of that for anything situational: an architecture review on a gnarly refactor, a perf dive on a hot path, a deeper readability pass before an important merge.
The agent guarantees the floor. Prompts raise the ceiling when it matters. Neither does the other's job.
The mental model is closer to static analysis plus human review than to "AI replaces reviewer." The agent is the linter — runs always, checks the same things. The prompt is the ad hoc tool — a pairing session with a reviewer focused on this PR's specific concern.
Common Anti-Patterns
- An agent doing everything and nothing well. The rubric grows to cover security, perf, readability, architecture, and taste. Each gets a cursory pass. Fix: narrow the rubric; use prompts for deeper passes.
- Prompts as a substitute for an agent. Team decides to "use prompts" and relies on developers to remember. Half do, half do not. Fix: agents for checks that need to run every time.
- Agent comments nobody reads. Twenty-bullet summary on every PR. Developers mute it. Fix: inline comments on HIGH and CRITICAL only.
- Agent blocks merge on false positives. Too many CRITICALs produces merge paralysis and workarounds. Fix: reserve CRITICAL for findings worth reverting a deploy for.
- No escape hatch. Developers cannot mark a finding as accepted risk. Agent re-raises it every push. Fix: an explicit "acknowledge" mechanism the agent respects.
- Duplicate work between agent and prompts. Developer runs a readability prompt; agent runs readability too. Output conflicts. Fix: split the rubric cleanly and document it.
FAQ
Do I need to replace human reviewers with either?
No, and teams that try regret it. Both agents and prompts reduce the volume of easy findings reviewers catch, which lets humans focus on what only humans are good at — design judgement, team context, knowing when a PR fixes the symptom instead of the cause. The target is fewer trivial comments, not fewer reviewers.
What if my agent's rubric drifts from what we care about?
Treat the rubric like any other codebase artifact: version it, review changes, have the team approve updates. It should mirror conventions the team already enforces in human review. When practices change, the rubric changes with them — on a schedule, not silently.
Can the same AI tool act as both?
In practice, the same model answers both uses. The difference is scaffolding. A prompt is a text box. An agent has a trigger, a persistent rubric, context plumbing, and output handling. Many teams use the same model for both and focus effort on the wrapping.
How do I stop the agent from commenting on things developers already know?
Two mechanisms. First, let developers mark findings as accepted — a label, a PR comment keyword — and have the agent respect that marker on re-runs. Second, record waived findings in the agent's memory so the same finding on a different PR does not pop up again without reason.
Where does spec-driven AI coding fit in?
The spec is the upstream artifact that feeds review. A review agent that knows the PR's originating spec can check the PR actually meets the acceptance criteria — not just that the code is syntactically fine. A spec-aware agent can say "this PR does not address criterion 3" rather than "this code looks fine."