We Tested 4 AI Code Review Tools on 24 Infrastructure Bugs. Here's What Happened.

2026-11-24来源 dev.toEnglish
We Tested 4 AI Code Review Tools on 24 Infrastructure Bugs. Here's What Happened.


Can AI code reviewers understand an entire system, or do they just detect suspicious lines of code?

we've been exploring this question through an ongoing AI code review benchmark.

For the 16th round, I decided to change the challenge.

Instead of reviewing application logic, Python functions, or SQL queries, I gave four AI code review tools something different:


A Dockerfile, a Docker Compose stack, and a deployment configuration.

Just 113 changed lines across 3 files.

But hidden inside those files were 24 deliberately introduced defects.

The results were interesting. One tool detected 23 of them. Another detected only 6 of the planted defects but discovered three additional issues that could prevent the entire deployment from working.

Let's break down what happened.

The experiment

I evaluated four AI code review tools:

  • Codzee
  • CodeRabbit
  • CodeAnt
  • Greptile

All four reviewed the same pull request: PR #17.

The pull request contained three files:

Dockerfile docker-compose.yml deploy/config.yaml 

I prepared an answer key containing 24 defects before pushing the branch.

The defects covered security, configuration, container permissions, networking, persistence, and interactions between infrastructure and existing application code.

I also included six deliberately correct settings to evaluate whether the tools would generate false positives.

Benchmark setup

Parameter Value
Round 16
Pull request #17
Changed lines 113
Files 3
Planted defects 24
AI review tools 4
Correct settings used as false-positive checks 6

The goal wasn't simply to see which tool produced the most comments.

I wanted to understand whether these tools could identify meaningful engineering problems.

The leaderboard

Here are the results:

Tool Defects detected Detection rate
Codzee 23/24 95.8%
CodeRabbit 14/24 58.3%
CodeAnt 12/24 50.0%
Greptile 6/24 25.0%

Codzee was the clear winner.

It detected 23 of the 24 planted defects.

But the overall score doesn't tell the entire story. The more interesting differences appeared when I examined each file separately.

1. Dockerfile: Small mistakes, serious consequences

The Dockerfile contained eight planted defects.

Some examples:

Defect Why it matters
Unpinned python:latest Builds can change unexpectedly
Secrets embedded in image layers Secrets may be exposed through image history
DEBUG=1 in production Can expose sensitive information
Running as root Increases the impact of container compromise
Missing .dockerignore Unnecessary or sensitive files may enter the build context
Build tools in final image Increases image size and attack surface
Unpinned pip dependencies Reduces build reproducibility
chmod -R 777 /app Grants unnecessarily broad permissions

Results:

Tool Detected
Codzee 7/8
CodeRabbit 3/8
CodeAnt 3/8
Greptile 1/8

Codzee performed best here.

However, it missed the missing .dockerignore.

This is worth remembering because the problem wasn't an incorrect line. It was the absence of a file that should have existed.

2. Docker Compose: The Docker socket problem

The Compose configuration contained six planted defects.

One of the most serious involved:

privileged: true 

combined with a mounted Docker socket.

Why is this dangerous?

A compromised container with access to the Docker daemon may be able to control other containers and potentially compromise the host.

Imagine an attacker achieving remote code execution inside a public-facing API container.

If that container has privileged access and Docker socket access, the consequences can extend beyond the application itself.

All four tools detected this issue.

Other defects included:

  • PostgreSQL exposed on 0.0.0.0:5432.
  • Credentials embedded directly in environment configuration.
  • Missing persistent storage for PostgreSQL.
  • Unpinned PostgreSQL and Nginx images.
  • Incorrect Nginx export-directory exposure.

Results:

Tool Detected
Codzee 6/6
CodeRabbit 5/6
Greptile 4/6
CodeAnt 3/6

Codzee achieved a clean sweep.

CodeRabbit also performed strongly, detecting five out of six defects.

3. Deployment configuration: Codzee found all eight

The final file was:

deploy/config.yaml 

It contained eight planted defects, including:

  • Debug mode enabled in production.
  • Wildcard allowed hosts.
  • Disabled TLS verification.
  • A committed payment gateway API key.
  • Insecure cookie settings.
  • Wildcard CORS with credentials.
  • Request-body logging without redaction.
  • statement_timeout_ms: 0.

Results:

Tool Detected
Codzee 8/8
CodeAnt 6/8
CodeRabbit 4/8
Greptile 0/8

Codzee detected every planted defect in this file.

CodeAnt also delivered a strong result.

However, something unexpected was happening with Greptile.

It had detected zero of the eight planted configuration defects.

But it had discovered something the other tools hadn't.

4. The unexpected result: Greptile found three additional bugs

This is where the experiment became particularly interesting.

Greptile detected six planted defects, but it also discovered three real defects that weren't included in my original answer key.

I verified these against the repository and recorded them separately.

Finding 1: The API entrypoint didn't exist

The deployment referenced:

booking.api:app 

But the referenced module did not exist in the repository.

The result?

The API container would fail to start.

Finding 2: The API and Nginx weren't sharing the expected directory

The API wrote exports to a container-local path.

Only Nginx mounted the corresponding host directory.

The two services were effectively looking at different locations.

The API could generate files, but Nginx couldn't access them through the expected shared path.

Finding 3: The configuration file was never loaded

Greptile discovered that:

deploy/config.yaml 

was not loaded by any application code.

This was particularly interesting because the file contained several dangerous settings, including a committed payment key, wildcard CORS, and disabled TLS verification.

The other tools analysed the configuration values.

Greptile checked whether the application actually read the file.

It didn't.

This doesn't make those settings safe. They could become active when someone wires the configuration into the application later.

But it changes the immediate impact.

One reviewer examined what the configuration said. Another checked whether the configuration actually affected the application.

Both perspectives matter.

5. What did each tool do best?

Codzee — Best overall defect detection

Score: 23/24

Codzee performed consistently across all three files.

Its strongest areas were security configuration, Docker Compose, and cross-file reasoning.

It also explained the potential host-compromise risk associated with privileged containers and Docker socket access.

Its main miss was the missing .dockerignore, along with the broader system-level issues discovered by Greptile.

CodeRabbit — Strong security explanations

Score: 14/24

CodeRabbit stood out for its security classification and risk communication.

It used CWE classifications, reachability, and exploitability to explain findings.

For example:

  • CWE-798: Hardcoded credentials.
  • CWE-319: Cleartext data transport.

It also detected five of the six Docker Compose defects.

CodeAnt — Strong deployment configuration review

Score: 12/24

CodeAnt performed best in the deployment configuration category, detecting six of eight defects.

It identified issues involving cookie settings, TLS verification, request-body logging, and CORS.

Its weakest category was Docker Compose.

Greptile — Strong unexpected repository-level discoveries

Score: 6/24 planted defects

Greptile finished last on the predefined benchmark score.

However, its three additional findings revealed problems that could prevent the deployment from functioning.

This is why I wouldn't judge its performance using the leaderboard alone.

6. False positives: Did the tools flag correct configuration?

I also included six deliberately correct settings.

Two examples:

logging: destination: stdout 

Writing logs to standard output is a common and appropriate approach for containerized applications.

Another example:

ENV PYTHONUNBUFFERED=1 

This helps Python emit logs without unnecessary buffering.

Neither should automatically be treated as a defect.

All four tools avoided flagging the six deliberately correct settings.

False positives: 0

This was the third consecutive round in which the benchmark recorded zero false positives.

7. The bigger lesson: Security review is not system review

Looking at all the findings, I noticed two different review approaches.

Codzee, CodeRabbit, and CodeAnt were generally strongest at answering:

Is this configuration safe?

Greptile's unexpected discoveries focused on another question:

Does this system actually work?

These questions are not interchangeable.

A Dockerfile can contain dangerous settings.

A Compose stack can expose services.

A deployment configuration can contain insecure values.

But even if a reviewer identifies all those issues, the application may still fail to start because its entrypoint points to a nonexistent module.

This is the difference between reviewing individual components and understanding the complete system.

8. What about the previous benchmark rounds?

Round 16 is part of an ongoing benchmark covering 16 rounds of different engineering scenarios.

The recorded running tally shows:

Tool Rounds led or tied
Codzee 11
Greptile 6
CodeRabbit 1
CodeAnt 1

Codzee has led or tied in 11 rounds and recorded ten consecutive wins.

However, every round has revealed different strengths and weaknesses.

One recurring issue is the difficulty of detecting things that are missing rather than things that are incorrectly implemented.

In earlier rounds, this included deleted tests and missing transaction handling.

In Round 16, it was the missing .dockerignore.

Sometimes the biggest problem isn't the code you wrote.

It's the protection you forgot to add.

9. My takeaways for developers

After this round, I would add three checks to any AI-assisted infrastructure review workflow.

1. Verify the wiring.

Check whether application entrypoints exist, configuration files are actually loaded, and shared volumes point to the same locations.

2. Check for missing protections.

For Docker infrastructure, consider .dockerignore, non-root execution, health checks, resource limits, image pinning, and persistent volumes.

3. Don't depend on one score or one reviewer.

Different tools identified different categories of problems. A strong security review and a strong functional review are not necessarily the same thing.

Final thoughts

Codzee won Round 16 with 23 out of 24 planted defects detected.

That's an impressive result.

But Greptile reminded me why I keep running these experiments.

A tool can finish last on a predefined benchmark and still discover something that changes the entire engineering outcome.

The best AI code reviewer shouldn't just identify suspicious lines.

It should understand what those lines mean, how the components interact, and what happens when the application actually runs.

Because finding bugs is important. Understanding the system is even more important.

Benchmark summary

  • 4 AI code review tools
  • 113 changed lines
  • 3 infrastructure files
  • 24 planted defects
  • 3 additional valid discoveries
  • 0 false positives

This is Round 16 of my ongoing AI code review benchmark. Scores reflect one controlled pull request and should not be interpreted as universal performance rankings.

Discussion

What's your approach to AI code reviews?

Would you trust one tool with your pull requests, or would you combine multiple reviewers with different strengths?

I'd love to hear how other developers are approaching this.

原文:https://www.a8q9.cn/en/article/we-tested-4-ai-code-review-tools-on-24-infrastructure-bugs-here-s-what-happened-171dd4.html

相关文章