AI code review tools such as CodeRabbit, Greptile, GitHub Copilot code review and Cursor Bugbot read each pull request with the rest of the repository as context and comment the way a reviewer would. They flag likely bugs, unsafe patterns and departures from the codebase’s conventions within minutes, at little cost per review. Clearing those mechanical findings first lets people spend their review time on intent and design, which makes AI review one of the cheapest checks a team can add to every pull request.
What AI code review can’t catch are failures that depend on facts outside the diff: what other services accept and return, what the data holds, how dependencies fail, how the change behaves under load, and how it is configured and exposed. Those five classes cause most serious production incidents, and each one only shows up when the change runs.
That limit is structural, not a flaw in any one tool. A reviewer, human or model, judges code against what it assumes about the world, and the facts that decide whether those assumptions hold aren’t in the code. Review is one layer of the evidence a team needs before it merges agent-written code. How the layers fit together is laid out in the complete guide to AI code verification.
What AI code review catches well
AI code review is good at anything visible in the change itself. It flags a wrong condition, a missing null check, a query built from user input, a secret pasted into config, or a test that asserts nothing. With the repository in context, it also notices code that ignores the codebase’s conventions, duplicates a helper that already exists, or touches files outside the task.
Review also catches what no test will: a change that shouldn’t exist, a design that will hurt later, a fix in the wrong layer. Tests check behavior against expectations. Only a reader asks whether the expectations were right.
What it leaves uncovered is everything the diff doesn’t contain.
Five failures that live outside the diff
Most serious production failures aren’t a wrong line a careful reader would spot. When researchers classified 112 high-severity incidents that software bugs caused in Microsoft Azure, the largest groups were bugs in detecting and handling faults (31%), data-format conflicts between components or versions (21%) and timing bugs (13%) (Liu et al., HotOS 2019). Each sits at a boundary the diff doesn’t contain.
This is what a reviewer sees, and what it can’t.
Contracts with other services
A change assumes what the services it calls accept and return: field names, types, which fields can be null, what each status code means. Only the caller’s side is in the diff. The other side lives in another repository, at whatever version runs today, and includes behavior no schema documents, since every observable behavior of a widely used interface ends up depended on (Hyrum’s law).
A renamed field or a new enum value passes review on the calling side. Contract tests, and integration tests against the deployed versions, catch it.
Data
A change assumes the shape of stored data: a column with no nulls, a value that is unique, a table small enough to lock during a migration. Production data breaks assumptions nobody wrote down. In June 2025, Google Cloud’s Service Control crashed worldwide when a policy update with blank fields reached code shipped about two weeks earlier, on a path that had never run (Google Cloud incident report).
No reviewer could reason about data that didn’t exist yet. Tests on production-shaped data, and migrations run at realistic volume, catch this class.
Errors and failures
Review sees whether an error handler exists and whether it is obviously wrong. Whether it works depends on how a dependency fails: a timeout instead of an error, a partial write, a retry that charges a card twice. In a study of 198 failures in Cassandra, HBase, HDFS, MapReduce and Redis, 92% of the catastrophic ones came from mishandling errors the software had already reported (Yuan et al., OSDI 2014).
In 35% of those catastrophic failures the faulty handler followed a trivial pattern, such as an empty catch block, the kind of mistake AI review is good at flagging. The rest only show when the error happens. The remedy is fault injection: slowing, breaking or cutting off a dependency during a test.
Load and timing
Latency, throughput and memory use aren’t written in the code. They emerge from it together with data volume, concurrency and the infrastructure beneath. In a study of 109 performance bugs in Apache, Chrome, GCC, Mozilla and MySQL, about two thirds needed large inputs to show up (Jin et al., PLDI 2012).
A reviewer can spot a loop that calls another service once per item. It can’t tell whether ten database connections run dry at two hundred concurrent requests, or whether two requests both reserve the last item in stock. Load tests compared against the stable version, and tests through a real message broker, catch these.
Configuration and exposure
The same code behaves differently under different flags, secrets, timeouts, resource limits and permissions, and most of those live outside the diff. Many security weaknesses belong to the deployment rather than the code: an endpoint a gateway exposes without authentication, an overly broad IAM role, a debug route left on. OWASP’s 2025 Top 10 ranks broken access control first and found some form of it in every application tested. Security misconfiguration ranks second, and it too turned up in every application tested.
Scanners catch unsafe patterns in the code. Dynamic scans and authorization tests, run against the change under its real configuration, catch the rest.
Why more context won’t close the gap
More context narrows the gap. A reviewer that retrieves the consumer’s code will catch the renamed field, which is why review tools compete on what they can pull in: other services’ schemas, recent traces, past incidents. Two limits remain.
- Context is a snapshot. A schema or trace shows the system when someone captured it, while other teams and their agents keep changing it. Documentation describes intended behavior, not the behavior callers come to depend on.
- Some answers have to be computed. Latency under load, the interleavings of concurrent requests and the way a retry spreads through a call graph all need a simulation of the system. The cheapest faithful simulation of a system is the system.
Models are far from computing those answers by reading code. On SWE-Flux, a 2026 repository-level benchmark of runtime reasoning, the best model predicted runtime behavior correctly 37% of the time (SWE-Flux). Better models will raise that number. They won’t make another team’s deploy or tonight’s traffic visible in a diff.
AI code review vs testing: which check catches what
Review and tests answer different questions, so the useful comparison is by failure, not by tool. Each row below is a failure an agent-written change can carry. The columns are three kinds of check: AI code review, unit tests written with the change and its neighbors mocked, and tests that run the change in a production-like environment beside current versions of its dependencies.
| Failure | AI code review | Unit tests with mocks | Tests in a production-like environment |
|---|---|---|---|
| A change that solves the wrong problem | Catches: if the reviewer knows the intent | Misses: tests check what was built | Misses: tests check what was built |
| Logic error inside one function | Partly: the visible ones | Catches | Catches: on any path a test exercises |
| Query built from user input | Catches | Misses | Catches: dynamic security scans |
| Renamed field another service reads | Partly: only with the consumer in context | Misses: the mock agrees with the change | Catches: contract and integration tests |
| Checkout broken by a change two services away | Misses | Misses | Catches: end-to-end tests |
| Migration that locks a large table | Partly: may flag the risk | Misses: no real table | Catches: the migration run on production-shaped data |
| Timeout treated as success | Partly: sees the handler, not the failure | Partly: only if a test simulates that timeout | Catches: fault injection |
| Connection pool exhausted under load | Misses | Misses | Catches: load tests |
| Endpoint exposed without authentication | Misses: the route is set in deployment config | Misses | Catches: dynamic scans and authorization tests |
Review is the only check in the table that catches a change built to the wrong specification, and it catches visible code problems within minutes. Unit tests confirm logic inside one component. Every row from the renamed field down needs the change running beside current versions of the services, data and configuration it meets, and no amount of reading or mocking stands in for that.
Where AI code review fits in a verification stack
A verification stack layers checks by what they need and how much of the system they see. Checks that read the code are fastest and run first. The last layer runs the change in a production-like environment, where it meets current versions of the services, data and configuration it will meet in production.
AI code review belongs in the first layer, and it is one of the best-value checks a team can add. It comments within minutes of a pull request opening, costs little per review and is the only automated check that asks whether a change should exist. It clears mechanical findings before a person looks, so people can focus their review on intent, design and risk. Its findings vary from run to run, so it works best as a check that comments rather than one that blocks, as the merge checks for AI-generated pull requests set out.
What review can’t do is show that a change is ready to merge. A clean review means the code reads correctly given its assumptions about the system. Whether those assumptions hold only shows when the change runs beside the services, data and configuration it depends on. That evidence needs a realistic verification environment for each change, fast enough for an agent to run its checks there before it opens the pull request. Signadot provides those environments on Kubernetes, and coding agents create them through its MCP server and agent skills, covered in ephemeral environments for coding agents.
The two layers work best together. In the Signadot and CodeRabbit tutorial, a pull request changes the field names a service expects in a Kafka message while the deployed sender still writes the old ones. The build passes and the diff reads fine, the Playwright tests fail against the change’s environment, and CodeRabbit reads the failed check to explain the cause.
Start with the failure class behind your last few incidents, and add the check that catches it to every pull request before adding anything else.
Frequently asked questions
Can AI code review replace testing?
No. AI code review judges a change against what its code assumes, and testing checks those assumptions against the running system. Review is the cheaper first pass and belongs on every pull request, but contract, integration, load and fault-injection tests show whether the change works with the services, data and configuration it will meet. Keep both, let review comment, and let the tests decide the merge.
Can AI code review find security vulnerabilities?
It finds the ones written in the code: queries built from user input, hardcoded secrets, unsafe deserialization, missing input checks. It can't see weaknesses that belong to the deployment, such as an endpoint a gateway exposes without authentication or an overly broad IAM role. Those need dynamic scans and authorization tests run against the change under its real configuration, before it merges.
Does giving AI code review more context help it catch integration bugs?
Partly. A reviewer that can retrieve a consumer's code will flag a renamed field that consumer reads. Context stops helping where the facts change after capture, such as another team's deploy, or where the answer has to be computed, such as latency under load or the order concurrent messages arrive in. Those still need the change running beside its dependencies.
What is the difference between AI code review and static analysis?
Static analysis applies fixed rules, so it is deterministic, fast and narrow: the same diff always gets the same findings. AI code review reads a change the way a person would, so it can judge intent, naming and design, but its comments vary between runs. Both reason about code without running it, so neither sees contracts, data, failures, load or configuration outside the diff.