DEV Community

Ashkan Rajaee
Ashkan Rajaee

Posted on

Code Review Standards When Half the Code Is AI-Assisted

A pull request lands on a Tuesday afternoon. It is tidy. The naming is consistent, the functions are short and the tests all pass. The reviewer reads it top to bottom, finds nothing to object to, and approves it in ten minutes. Two weeks later the change causes a problem in production, and the root cause turns out to be something the code never handled at all.

That pattern is getting more common as AI tools write more of the first draft. The code looks finished before anyone has thought hard about it, and a review process built for hand-typed code can wave it straight through.

Earlier in my career, as a partner, I helped grow a software consulting company from about $6M to $60M in under three years, and later I founded and ran a fully remote consultancy. On client work, a bug that slips past review is not just a technical problem. It is a conversation with the client about why the team that was paid to catch it did not. Here is how I think about reviewing AI-generated code: what reviewers should check differently, and how to keep review from becoming the new bottleneck.

Why AI-Assisted Code Needs a Different Review

Traditional code review leans on signals. Messy code hints at a rushed author. A missing test stands out because the rest of the file has them. Reviewers use those signals to decide where to look.

AI-assisted code removes many of those signals. It tends to look plausible whether or not it is correct, and it can confidently solve a slightly different problem than the one in the ticket. And because the author did not write every line, the author may not be able to explain every line either.

So the reviewer's job shifts. Less attention on style, which tools can enforce. More attention on four things a fluent draft can hide: intent, edge cases, security and tests.

Start With Intent: Does This Solve the Right Problem?

The first question for any AI-assisted change is not "is this code good?" It is "is this the change we asked for?"

Read the ticket before you read the diff. Then check whether the change does what the ticket needs, and only that. Generated code can quietly add behavior nobody requested, such as a retry loop or a broader query than the feature needs. Each extra piece is something the team now has to maintain.

A simple rule helps here: the author describes in their own words what the change does and why it is shaped this way. If the author cannot explain a section, that section is not ready for review. This is not about distrust. A person on the team has to own every line that ships, because the client will hold the team responsible regardless of who or what typed it.

Edge Cases Are Where Fluent Code Goes Quiet

Generated code is usually strongest on the happy path. The places to slow down are the inputs and states the prompt did not mention:

  • Empty, missing or null values
  • Very large inputs and unusual characters
  • Time zones and dates near boundaries
  • Concurrent requests touching the same record
  • Partial failures, such as a network call that times out halfway through a multi-step update
  • Behavior when a dependency returns an error the code did not expect

A useful habit is to ask, for each function that matters, "what is the worst realistic input this will see?" and then look for the line that handles it. If you cannot find it, ask the author.

Security: Check What the Code Trusts

Security review deserves extra care with AI-assisted changes, because plausible-looking code can still make unsafe assumptions. Focus on trust boundaries:

  • Where does outside input enter, and is it validated before use?
  • Are database queries parameterized, or is input concatenated into them?
  • Are permissions checked on the server for every action, not just hidden in the interface?
  • Are secrets, tokens or personal data ever logged, returned in errors or hardcoded?
  • Did the change add a new dependency, and does the team know what it is and who maintains it?

That last point is easy to miss. A suggested library can look reasonable and still be unmaintained or unnecessary. Treat a new dependency as a decision that needs a human reason, not a side effect of a suggestion.

Tests That Prove Something

AI tools are good at writing tests, and that is both helpful and risky. A generated test can pass while asserting very little, or it can mirror the implementation so closely that it would pass even if the logic were wrong.

When reviewing tests, ask whether each one would fail if the behavior broke. Look for tests of the edge cases above, not just the main path. Be wary of tests that were changed in the same pull request to match new behavior without a clear explanation of why the old behavior was wrong.

Keep Review From Becoming the New Bottleneck

If authors can produce code faster and reviewers have to look harder, review becomes the slowest step. A few practices keep it moving:

Smaller pull requests. It is now easy to generate a large change in one sitting. Ask for changes a reviewer can understand in one focused session, even if one ticket becomes several pull requests.

A short author checklist before review. Intent explained in plain words, edge cases listed, security questions answered, tests that would catch a regression. The author does this work first, so the reviewer is checking it rather than doing it from scratch.

Let tools handle style. Formatting, linting and basic static checks should run automatically, so human attention goes elsewhere.

Match review depth to risk. A copy change on a marketing page and a change to payment handling should not get the same review. Agree as a team which areas always need a second reviewer, such as authentication, billing, data deletion and anything that touches personal data.

A Hypothetical Example

Here is a made-up scenario to show the difference. A developer uses an AI tool to add an export feature that lets a client's users download their records as a file. The pull request is clean and the tests pass.

A style-focused review approves it quickly. Under the review described here, the reviewer reads the ticket first and notices it asked for exports of the user's own records. The query in the change filters by account, not by user, so any user on the account could export everyone's data. The tests only covered a single-user account, so they never caught it. The fix takes an hour. Finding it after release would have been a very different conversation with the client.

What This Will Not Fix

Better review does not replace good design, clear tickets or engineers who understand the system. It will not catch every bug, and it should not become a reason to distrust teammates who use AI tools well. The goal is narrower: make sure every change that ships has been understood by a person who is accountable for it.

It also takes time to adjust. An author checklist can feel slower at first, until reviewers stop asking the same questions on every pull request.

Start With Your Next Pull Request

You do not need a new policy document to start. On your next pull request, ask the author to explain the intent in their own words, list the edge cases they considered, answer the security questions and show one test that would fail if the logic broke. Review against those four things and see what you find.

Code review standards when half the code is AI-assisted come down to shifting attention from how the code looks to what it does, what it trusts and what proves it works. When the team makes that shift, AI tools speed up delivery without quietly moving risk onto the client.

If your team is using AI tools to write more of its code and you want help setting review standards that keep quality high without slowing delivery, visit https://tdzpro.com.

Ashkan Rajaee is the founder of TDZ Pro. He has spent years building and scaling software engineering teams, including a fully remote software consultancy.

Top comments (0)