darius.wiki

Code Review Practices for Teams Where AI Writes Most of the First Draft

Darius·2026-08-13

Cover Image
ALT: Engineering team conducting AI-assisted code review practices for first-draft generated code

Building a Code Review Process When AI Writes the First Draft

Modern software teams are shipping faster than ever, and a large share of that acceleration comes from AI coding assistants that generate working first drafts of functions, modules, and even entire services. The shift is real and ongoing — but speed without discipline creates a compounding problem: AI-generated code that passes a superficial glance can carry subtle bugs, architectural drift, and security assumptions that only surface in production.

This guide is written for engineering leads, startup CTOs, and senior developers who have already adopted AI-assisted development and now need a review process that matches the new reality — one where the first draft is machine-authored, but the accountability remains entirely human.

Before You Start: Prerequisites and Preparation for AI-Era Code Review

Adapting your code review practices for an AI-first workflow is not a one-afternoon task. Before your team makes any process changes, a few foundational pieces need to be in place.

Understanding of your current review baseline. Know how reviews are being done today — what tools, what conventions, what turnaround expectations. Without a baseline, you cannot measure whether the new process is improving outcomes.

Clarity on which AI tools are in use. Different assistants (GitHub Copilot, Cursor, Claude, GPT-based integrations) have different generation patterns and failure modes. Your reviewers need to know what they are reviewing.

A shared definition of "AI-generated first draft." Not all AI-assisted code is the same. There is a difference between autocomplete on a single line and a full module generated from a prompt. Your team needs agreed terminology so reviewers know what level of scrutiny to apply.

Established coding standards and architecture guidelines. AI models optimize for plausibility, not for your specific system's constraints. If your standards are not documented, AI-generated code will drift toward generic patterns rather than your intended architecture.

Willingness to change review culture, not just process. The deepest shift is conceptual: reviewers move from "checking someone's work" to "taking ownership of code they did not author." That requires deliberate team alignment.

Checklist before starting:

Time and effort should be treated as a sustained investment. Expect an initial configuration and alignment phase before the new norms become habitual.

Step-by-Step Code Review Practices for AI-Generated Code

Step 1: Treat Every AI Output as a Proposal, Not a Contribution

The most consequential mindset shift your team can make is stopping the habit of treating AI-generated code the way you treat a pull request from a trusted colleague. As noted in the piece Treat AI-Generated Code as a Draft, the correct mental model is that AI output is a proposal — an informed starting point that must be interrogated before it earns a place in your codebase.

In practice, this means reviewers should approach an AI-authored module with the posture of a new hire's first PR: competent-looking, potentially correct, but requiring verification of intent and fit. Apply this at the PR description level first. Engineers who submit AI-generated code should be required to annotate the PR: what was prompted, what was accepted as-is, and what was modified. This annotation is not bureaucracy — it is the context a reviewer needs to understand what they are actually auditing.

Tip: Create a simple PR template that includes a field for "AI generation disclosure" — not as a penalty, but as a workflow norm that surfaces context automatically.

Step 2: Restructure What Reviewers Are Looking For

Traditional code review focuses on correctness, style, and intent. AI-generated code requires an expanded checklist because the failure modes are different. A human developer tends to make mistakes of complexity — they misunderstand a requirement or implement an edge case wrong. AI tends to make mistakes of plausibility — the code looks right, compiles, and even passes basic tests, but it models the wrong assumption or uses a deprecated pattern that was common in its training data.

Structure your review checklist around four areas specific to AI-authored code:

Tip: Add these four areas as explicit checklist items in your review tool (GitHub PR templates, GitLab MR descriptions, or equivalent). Do not rely on reviewers to remember them under time pressure.

Step 3: Apply Tiered Review Depth Based on Risk Surface

Not all AI-generated code carries equal risk. A utility function that formats a date string is a different proposition from a service that handles payments or user authentication. Applying the same review intensity to everything either burns your senior engineers out or trains the team to treat all reviews as superficial.

Define tiers explicitly:

Addy Osmani, in his analysis AI writes code faster. Your job is still to prove it works., makes the essential point: the reviewer's job is not just to catch bugs — it is to prove correctness, and that standard does not change because a machine generated the code. Tiered review operationalizes that standard without making every PR a bottleneck.

Tip: Document the tier definitions in your engineering handbook. When tier assignment is ambiguous, default to the higher tier — the cost of an unnecessary thorough review is much lower than the cost of a production incident.

Step 4: Make Test Coverage a Non-Negotiable Gate

AI coding assistants are capable of generating tests, and this is simultaneously useful and dangerous. The tests an AI writes are often structurally valid but semantically shallow — they test what the AI implemented, not what the system is supposed to guarantee. A generated test suite can show high coverage while missing the critical edge cases that matter.

The review process must treat test coverage as a gate, not a metric. Specifically:

This is an area where a pattern seen consistently across teams adopting AI-assisted development reveals itself: test suites that look complete but assert on implementation details rather than behavior guarantees. When the implementation changes (as AI-generated code often does during iteration), those tests become noise rather than safety.

Tip: Introduce a "behavior test" standard: for every PR, at least one test must express a business-level guarantee in plain language in the test description (e.g., test("returns 401 when session is expired, not 403")). This forces human reasoning about intent.

AI code review checklist and tiered review process diagram
ALT: Tiered code review checklist diagram for AI-generated first draft code showing risk-based review depth by category

Step 5: Build Architectural Oversight Into the Review Loop

Individual PR reviews catch local problems. Architectural drift is a systemic problem that accumulates across many individually approved PRs. This is especially pronounced with AI-generated code because each model output independently optimizes for the immediate task — it has no awareness of the decisions made three PRs ago.

Introduce a lightweight architectural review cycle alongside your regular PR process. This does not mean a formal committee for every change. It means:

For teams building AI-powered products in particular, this layer of oversight matters significantly. If you are interested in how architectural discipline applies at the system level — beyond the codebase — the guide on AI system architecture patterns every CTO should evaluate covers the structural decisions that underpin reliable AI systems.

Tip: Keep ADRs short and scannable — a long ADR that nobody reads provides no protection. If a decision takes more than a page to explain, break it into smaller, more focused records.

Step 6: Invest in Reviewer Calibration and Knowledge Sharing

Code review quality degrades when reviewers are not aligned on what they are optimizing for. With AI-generated code, this misalignment happens faster because the failure modes are less intuitive than those from human-authored code. A reviewer who has not seen an AI hallucinate a plausible-but-wrong API response format may not know to look for it.

Calibration happens through practice, not policy. Build it in with these mechanisms:

As explored in research on evolving review practices — including work documented by Michaela Greiler in Code Reviews: From team to individual practice — the social and knowledge-sharing functions of code review are as important as the defect-detection function. In an AI-assisted environment, that knowledge-sharing function becomes even more critical because the team is collectively building expertise about a new type of artifact.

Tip: Normalize the phrase "I learned this the hard way" in review retrospectives. Teams that can discuss failures without defensiveness calibrate faster and retain knowledge better.

Step 7: Automate the Mechanical, Reserve Human Attention for Judgment

The highest-value thing a human reviewer brings to AI-generated code is judgment — the ability to ask whether this is the right approach, not just whether it is correct. That judgment is diluted when reviewers spend mental energy on things a tool can do.

Automate aggressively at the mechanical layer:

What remains after automation is where human review time should concentrate: intent, architecture, security reasoning, and behavioral correctness. This division of labor is not just efficiency — it is also reviewer sustainability. Review fatigue is real, and teams that protect reviewers from mechanical work sustain higher review quality over time.

Tip: Track what kinds of comments your reviewers make. If a significant share of comments are style or formatting corrections, your automation layer is incomplete. Fix the tooling before blaming the reviewers.

Common Mistakes and Troubleshooting in AI-Code Review Workflows

Symptom Likely Cause How to Fix
AI-generated PRs getting approved quickly with minimal comments Reviewers are treating AI output with the same trust as senior-authored code Reinstate the "proposal mindset" through a team norm reset; add AI disclosure to PR templates
Test coverage is high but production bugs keep appearing Generated tests assert on implementation, not behavior Require at least one human-authored behavior test per PR; audit test assertions during review
Architectural inconsistencies accumulating across merged PRs Individual reviewers lack system-level context; no cross-PR architectural check Introduce biweekly architectural reviews and link ADRs to PRs
Reviewers are exhausted and review quality is declining Human reviewers are doing work that automation should handle Audit CI pipeline and eliminate manual style, lint, and dependency checks from the review step
AI-introduced dependencies slipping into the codebase unchecked Reviewers are not scanning import lists and package files Add explicit "dependency review" to the checklist; consider a dependency approval gate for new packages
Security issues in authentication and input handling found late Tier 3 code paths are not being escalated to senior review Enforce the tiered review policy; make senior reviewer approval a hard merge requirement for Tier 3

Pro Tips for Better Results with AI-First Review Workflows

Prompt engineering is part of the review artifact. When engineers disclose how they prompted the AI to generate code, reviewers gain context that changes what they look for. A module generated from a vague prompt ("write a caching layer") warrants far more scrutiny than one generated from a precise, constraint-rich prompt that matches your architecture docs. Consider making prompt sharing optional but encouraged — over time, it also builds collective knowledge about what makes a good prompt for your codebase.

Rotate who reviews AI-generated code. There is a tendency for AI-code review to fall to the most AI-familiar engineer on the team. This creates a single point of failure in review coverage and prevents the rest of the team from building the pattern recognition they need. Distribute AI-code reviews deliberately across the team.

Treat hallucinated library APIs as a first-class bug category. AI models occasionally generate calls to methods or parameters that do not exist in the version of a library your project uses — or that were removed in a past version. These compile-time or runtime errors are embarrassing and avoidable. Add API existence verification to your reviewer mental model, especially for generated code touching external libraries.

Do not use AI to review AI. A pattern gaining traction in some teams is piping AI-generated PRs through another AI reviewer. This can catch syntactic issues but it reinforces the same blind spots — if the generating model had a wrong assumption, the reviewing model is likely to share it. Human judgment remains the irreplaceable layer.

Misconception to clear up: Many teams assume that because AI generates code faster, the overall review time should decrease proportionally. In a well-run AI-assisted workflow, review time per PR often increases initially because reviewers are doing more verification work per unit of submitted code. The net productivity gain comes from volume — more features shipped through more PRs — not from shorter review cycles per PR.

Common Questions

Q1: How should we handle code that mixes AI-generated and human-authored sections in the same file?

Mixed files are common and not inherently problematic, but they do require explicit labeling. Engineers should use comments or commit messages to mark which sections were AI-generated, so reviewers know which portions warrant deeper scrutiny. The key principle is that once a human has reviewed, modified, and approved a section, it graduates from "AI-generated" to "team-owned" — the distinction matters for ongoing accountability and for setting appropriate review depth on future changes.

Q2: Are existing code review tools adequate for reviewing AI-generated code, or do we need specialized platforms?

Existing tools — GitHub, GitLab, Bitbucket — are adequate for the process, but the process itself must evolve. The review checklist, the tier system, the PR disclosure template, and the architectural review cadence are all process changes that run on top of existing tooling. Specialized AI review tools exist and can augment the workflow, but they should complement, not replace, the structured human review process outlined here.

Q3: How long does it take to see the benefits of a structured AI-code review process?

The mechanical improvements — better automation coverage, cleaner PRs, fewer style debates — typically show up within the first few weeks of implementation. The deeper benefits — fewer production incidents from AI-generated code, stronger architectural consistency, better reviewer calibration — tend to emerge over a longer horizon as the team builds shared pattern recognition. Treat it as a capability investment, not a quick fix, and measure outcomes at the team level rather than per-PR efficiency.

Wrapping Up

Adapting code review practices for a workflow where AI writes most of the first draft comes down to three durable principles.

First, preserve human accountability regardless of who — or what — authored the code. The reviewer who approves a PR owns what it does in production. That ownership must be taken seriously, and the review process must give reviewers the context and structure to exercise genuine judgment.

Second, distinguish between what automation can handle and what requires human reasoning. Automate lint, style, dependency scanning, and secret detection. Reserve human review cycles for intent, architecture, security reasoning, and behavioral correctness — the things that require understanding your specific system, your users, and your constraints.

Third, build calibration into the team continuously. AI-generated code introduces failure modes that teams are still learning to recognize. The teams that stay ahead of those failure modes are the ones that share what they discover, document patterns, and treat review as a learning process, not just a gate.

If your team is navigating the broader challenge of shipping AI-powered systems with discipline and architectural integrity — not just reviewing code but designing systems that hold up — exploring resources on how enterprise teams are governing AI systems is a useful next step.


If you are building an AI-powered product and need an experienced technical partner who can help architect, review, and ship with production-level rigor, visit the Darius website to explore shipped projects, case studies, and architectural insights — and get in touch to discuss what your product needs next.

Sources & Citations

  1. Addy Osmani. "AI writes code faster. Your job is still to prove it works."

    https://addyosmani.com/blog/code-review-ai/
  2. Michaela Greiler. "Code Reviews: From team to individual practice."

    https://www.michaelagreiler.com/code-reviews-from-team-to-individual/
  3. Addy Osmani via Elevate (addyo). "Treat AI-Generated code as a draft."

    https://addyo.substack.com/p/treat-ai-generated-code-as-a-draft
  4. IEEE. IEEE Standards for Software Engineering and AI Systems.

    https://www.ieee.org/
  5. OWASP. Open Web Application Security Project — Secure Code Review Guidance.

    https://owasp.org/

Note: Standards and guidance documents may be updated; please verify the latest official versions directly with the issuing organizations.