Blog

AI Code Review: Tools and How to Do It Right

What AI code review does well, where it's blind on security, and how to pair it with SAST and human review in a solid PR-gate workflow.

Bruno Baldo·Aug 31, 2026·9 min read·Reviewed by Rainforest Technologies

AI code review is the use of large language models to read a pull request and comment on it the way a colleague would — flagging bugs, suggesting cleaner phrasing, and explaining what a change does. It has moved from novelty to default in a remarkably short time. If your team uses an AI coding assistant to write code, you are probably already using AI code review tools to check it, whether through a dedicated bot on your pull requests or a review pass built into your editor.

That speed is real, and it is worth having. But speed is also where the trouble starts. An automated code review AI is confident, articulate, and fast — three qualities that make it very easy to trust more than you should. This article is an honest look at what AI code review does well, where it goes blind, and how to fit it into a workflow that actually keeps insecure code out of production. The short version: AI review makes review faster, but it does not make code safe. For that, you still need deterministic security testing and human judgment.

What AI code review does well

Start with the good news, because there is plenty of it.

AI review is excellent at the high-volume, low-stakes feedback that used to eat a senior engineer's afternoon. It catches typos in variable names, inconsistent formatting, dead code, and off-by-one mistakes. It notices when you forgot to handle a null case or left a loop that never terminates on an edge input. These are the "obvious once you see them" bugs, and a model sees them instantly across an entire diff without getting tired on the fortieth file.

It is also a strong readability partner. AI review will suggest clearer function names, flag a comment that no longer matches the code beneath it, and point out where a nested conditional could be flattened. For teams without a formal style guide — or without the bandwidth to enforce one — this raises the floor on code quality consistently and without ego.

Then there is the explanatory layer, which is genuinely new. A good AI reviewer can summarize what a pull request does in plain language, describe the intent behind an unfamiliar change, and help a reviewer who lacks context get oriented fast. For onboarding engineers and for cross-team reviews, that context is valuable on its own.

Finally, it is tireless and immediate. It reviews at 2 a.m., it reviews the hundredth PR of the sprint with the same attention as the first, and it never leaves a review sitting for two days because it was busy. Used well, AI review shortens the feedback loop and frees human reviewers to spend their limited attention on the things that actually require judgment.

None of this is trivial. The mistake is assuming that because AI review is good at all of the above, it is also good at security. It is not.

Where AI code review is blind

The security gap is not a rough edge that will be polished away in the next model release. It is structural, and it comes from how these systems work.

An AI reviewer reasons about the text of a diff. It sees the lines that changed and some surrounding context, and it predicts what a knowledgeable reviewer would say. What it does not have is a reliable model of your entire application — every trust boundary, every place user input enters, every authorization check that should exist, and the full path data takes from an HTTP request to a database query three services away. Security bugs live precisely in that whole-system picture, and that picture is mostly invisible in a single pull request.

So the categories AI review misses are the ones that matter most:

  • Broken authorization. A model looking at a new endpoint has no dependable way to know that this particular route must check whether the current user owns the record they are requesting. The code looks fine. The missing check is not in the diff — its absence is the bug, and absences are exactly what pattern-matching struggles to see.
  • Missing output encoding. Whether a value needs to be HTML-encoded, escaped for a shell, or parameterized in a query depends on where it ends up. The reviewer would have to trace the value across functions and files to know, and it usually does not.
  • Injection. SQL, command, and template injection depend on whether untrusted input reaches a sensitive sink without sanitization. That is a data-flow property spanning the codebase, not a local one visible in the changed lines.
  • Subtle data-flow issues. Sensitive data logged in the wrong place, a secret that flows into an error message, a validation that happens after the value is already used — these require following data through the system, which is not what a diff-scoped reviewer does.

On top of the blind spots sit two reliability problems. AI review produces false negatives — it stays silent on real vulnerabilities, which is the dangerous failure because silence reads as approval. It also produces false positives — confident warnings about problems that are not real, which train your team to dismiss its comments and, eventually, to skim past the one that mattered. Reported accuracy for AI security review varies widely depending on the model, the prompt, and the codebase; there is no stable number to lean on, which is itself the point.

The most insidious risk is human, not technical: automation bias. When a fluent, confident system says a change looks good, reviewers relax. The green checkmark becomes permission to stop looking. That is how an authorization bug an AI reviewer was never equipped to catch sails through review with everyone feeling that it was, in fact, reviewed.

AI review vs SAST vs human review — you need all three

It is tempting to frame these as competitors and pick a winner. They are not competitors. They fail differently, and that is the whole reason to run all three.

AI review is probabilistic and context-aware in a shallow way. It is broad, fast, and good at the readable surface of code — and unreliable and non-deterministic on security. Run it twice and you may get different comments. That is fine for suggestions and fatal for guarantees.

SAST and SCA are deterministic. Static analysis traces data flow through your code against a defined set of rules and finds the injection path, the tainted sink, the missing encoding — the same way every time, on every run, whether or not the relevant lines appear in today's diff. Software composition analysis does the equivalent for your dependencies, matching the libraries you pull in against known vulnerabilities. Their strength is exactly the structural, whole-system, repeatable coverage that AI review lacks. Their weakness is that they do not understand intent and can be noisy without tuning — which is where the other two come in.

Human review supplies what neither machine has: understanding of what the change is supposed to do and whether it should exist at all. A human knows this feature handles regulated data, that this refactor touches the payment path, that this "small" change alters who can see what. Humans are slow, inconsistent, and easy to fatigue — which is exactly why you want the machines handling volume so people can spend judgment where it counts.

Line them up and the logic is clear. AI review gives you speed and breadth. SAST and SCA give you deterministic, repeatable security coverage. Humans give you context and intent. Drop any one and you have a predictable hole: no AI review and reviews slow down; no SAST and structural vulnerabilities walk through; no humans and nobody is accountable for whether the change made sense. The goal is not to choose. It is to sequence them so each does what it is best at.

A PR-gate workflow that works

Here is a practical shape for putting all three in the right order, on the pull request, where the cost of catching a problem is lowest.

  1. AI review runs first, on every PR. Let it do what it is good at — style, readability, obvious bugs, and a plain-language summary of the change. Treat its output as helpful suggestions that speed the human reviewer up, not as a security gate. Nothing it says should be able to mark a change "safe."
  2. SAST and SCA run as required status checks. This is your deterministic security layer, and it should block the merge, not merely advise. Static analysis inspects the changed code for injection, broken authentication and authorization patterns, and unsafe data flows; composition analysis checks new and updated dependencies against known vulnerabilities. Because these are deterministic, they give you something AI review cannot: a result you can rely on and enforce. Tune them so the signal stays high and developers trust the gate.
  3. Human sign-off is required for merge. A person reviews the change with the AI summary and the security findings in front of them, and makes the call that needs context — is this the right change, does it belong in this part of the system, does the intent match the diff. The security checks having passed lets the human focus on judgment instead of hunting for tainted sinks by hand.
  4. Keep the AI's verdict advisory and the security gate blocking. This one rule prevents automation bias from quietly disarming the whole pipeline. AI review informs. SAST/SCA and humans decide.

This is the arrangement that lets you move fast without pretending fast is the same as safe. AI review compresses the time humans spend on the readable surface; deterministic testing guarantees the security floor; humans own the decision.

That deterministic security floor is where Rainforest fits. AI review is a fine first pass, but it was never built to be the layer that catches broken authorization, injection, or the data-flow bugs that turn into incidents. Rainforest is the security layer that sits over your AI-assisted workflow — deterministic testing that runs on the pull request and gives your reviewers something they can actually trust before they click merge. Pair the speed of AI review with a security gate that does not guess, and you get the best of both without betting production on a probability.

Frequently asked questions

What is AI code review?

AI code review uses large language models to read a pull request and comment on it — flagging bugs, suggesting clearer code, and summarizing what a change does. It works like a fast, tireless reviewer for the readable surface of code, and it is increasingly built into AI coding assistants and pull-request bots by default.

Is AI code review reliable?

It is reliable for what it is designed to do — style, readability, and obvious bugs — and unreliable as a security control. Its output is non-deterministic and its reported accuracy varies widely across models, prompts, and codebases, so treat its verdict as a helpful signal, never as proof that a change is safe.

Can AI code review replace SAST?

No. SAST is deterministic: it traces data flow against defined rules and returns the same result every time, covering the whole codebase rather than just the changed lines. AI review is probabilistic and diff-scoped. They cover different gaps, so AI review complements SAST rather than replacing it.

Does AI code review catch security bugs?

Sometimes, but not dependably, and not the ones that matter most. Broken authorization, missing output encoding, injection, and subtle data-flow issues are whole-system properties that rarely appear inside a single diff, which is exactly what an AI reviewer sees. For security coverage you can enforce, pair AI review with deterministic testing and human judgment.

How should AI code review fit into a workflow?

Run it first on every PR for speed and readability feedback, keep its verdict advisory, make SAST and SCA required blocking status checks, and require human sign-off for merge. AI review informs; deterministic testing and humans decide.

Bruno Baldo

Written by

Bruno Baldo

CMO

Um pouco de marketing e um pouco de curiosidade e temos a receita pra criar um apaixonado por cyber!

Keep reading