Skip to main content
New aislop v0.13.1 patch — calibrates hidden-fallback detection and fixes regex comment-masker false positives. Read the changelog →
← Blog
Engineering · 4 min read

Agentic Code Review vs Deterministic Quality Gates: Use Each for the Work It Can Prove

A model can notice the bug your rulebook never imagined. A deterministic gate can enforce the same standard every run. Treating them as interchangeable weakens both.

Teams often ask whether an AI reviewer can replace static analysis. The inverse question appears too: if deterministic tools are reliable, why pay a model to review code?

Both questions assume a single review job. There are at least three: prove repeatable properties, search for contextual failures, and decide whether the change is right for the product and system. Different mechanisms are good at different parts.

Use deterministic gates for standards you can specify. Use agentic review to generate and test hypotheses. Use humans to own intent, tradeoffs, and the merge.

What deterministic gates are good at

A deterministic gate evaluates a pinned input with a known tool and configuration. It is ideal when the team wants the same answer regardless of reviewer, time of day, or model release.

  • Compilation, types, formatting, lint, tests, and coverage thresholds.
  • Known vulnerability, secret, dependency, and policy rules.
  • Stable code-quality patterns and complexity limits.
  • Generated-code residue such as empty catches, unsafe casts, debug output, unresolved stubs, and dead code.
  • Organization rules that require a clear pass, fail, suppression, and audit trail.

Its weakness is the boundary of the rule. A deterministic checker will not infer that a payment refund violates a product policy unless someone encoded that policy in a test, rule, or data contract.

What agentic review is good at

An agent can inspect related files, history, issue context, tests, and documentation, then reason about a change that has no single syntax signature. It can ask whether a migration misses a reader, whether a fallback hides an outage, or whether a new branch contradicts local behavior.

  • Cross-file logic and missing call-site updates.
  • Mismatch between the issue, implementation, and repository conventions.
  • Edge cases that require understanding a business workflow.
  • Test ideas for behavior not represented in the current suite.
  • Alternative explanations and adversarial scenarios a human can verify.

Its weakness is uncertainty. Findings can be plausible but wrong, sensitive to context selection, or inconsistent between runs. The output needs verification just like generated code does.

Current benchmarks argue for humility

CR-Bench highlights a frontier between resolving hidden issues and producing spurious findings: optimizing for exhaustive discovery can lower signal-to-noise. SWE-PRBench reports that the eight evaluated models detected 15% to 31% of human-flagged issues in its diff-only setup. The c-CRAB benchmark reports that the evaluated review agents collectively solved around 40% of its tasks.

These are different datasets, evaluation methods, and versions. Their percentages should not be combined into a universal accuracy claim. Together they support a narrower conclusion: agentic review can be useful, but no benchmark justifies treating its silence as proof that a change is safe.

The failure modes when you use the wrong layer

Using a model as a linter. The reviewer spends tokens and human attention rediscovering style, dead code, unsafe casts, and complexity rules that a deterministic engine can enforce faster and consistently.

Using static rules as architecture review. A green gate creates false confidence even though no rule understands the task, data flow, deployment sequence, or business invariant.

Letting both comment on everything. Developers receive duplicated findings with different wording and severity, then learn to dismiss the whole queue.

Blocking on unstable suggestions. A probabilistic reviewer becomes an unpredictable release gate with unclear appeal and reproduction.

A layered review pipeline

  1. Local deterministic feedback. Run format, types, focused tests, security checks, and generated-code rules while the author or agent still has context.
  2. CI evidence. Re-run the pinned full gate in a clean environment and publish artifacts.
  3. Agentic hypothesis review. Provide the diff, acceptance criteria, and selected repository context. Ask for consequential correctness and security issues, not style.
  4. Human decision review. Verify agentic findings, inspect risk boundaries, confirm intent, and accept or reject the change.
  5. Feedback into the right layer. Repeated objective findings become tests or deterministic rules. Contextual findings improve instructions and review prompts.

Decide what can block

FindingDefault treatmentReason
Compile, test, secret, or policy failureBlockReproducible with a known contract
Validated deterministic quality ruleBlock or ratchetStable rule, owner, and remediation
High-confidence contextual bugRequire human resolutionConsequential but needs verification
Refactor or style suggestionAdvisoryRisk of preference noise
Reviewer silenceNo safety claimAbsence of a finding is not proof

Where aislop fits

aislop is a deterministic first-pass gate for generated-code patterns. It is intentionally not a contextual bug-hunting agent. Run it before an agentic reviewer so the model and human do not spend their budget on repeatable residue.

npx aislop@latest scan --changes

If a pattern needs product intent to judge, it does not belong behind a universal deterministic rule. If a repeatable rule is being rediscovered by an LLM on every pull request, automate it. That boundary keeps both layers useful.

Sources

Frequently asked questions

What is agentic code review?

Agentic code review uses an AI agent to inspect a change, gather repository context, reason about possible bugs or design issues, and produce findings or fixes. Unlike a fixed rule, its path and output can vary with context, model, and configuration.

What is a deterministic quality gate?

A deterministic quality gate evaluates code against repeatable checks such as compilation, tests, static rules, dependency policy, complexity limits, and known generated-code patterns. The same pinned input and configuration should produce the same verdict.

Should AI review block a pull request?

Use caution. Deterministic findings with validated low noise are suitable merge gates. Agentic findings are often better as prioritized review hypotheses unless your own evidence shows a specific category is reliable enough to enforce. Humans remain responsible for intent and risk acceptance.