Intro
L1
·
Quiz
·
Lab
L2
·
Quiz
·
Lab
L3
·
Quiz
·
Lab
L4
·
Quiz
·
Lab
Module Test
Code Audit Workflows and Team Standards · Introduction

Every generation of programmers has faced a tool that rewrites what review even means

This course exists because AI code generation arrived before team processes did.

When Bell Labs distributed the first C compiler internally in 1973, the immediate engineering reaction was not celebration — it was alarm about verifiability. Code that no one fully wrote felt like code that no one fully owned. By 1976, Michael Fagan at IBM had published his formal inspection method precisely to address that anxiety: structured walkthroughs, defect logging by category, re-inspection thresholds. Fagan's process was not about the compiler; it was about restoring human accountability over output that had become faster and more abstract than intuition could track. The pattern was clear even then — a productivity tool arrives, quality assumptions break, a deliberate review discipline follows.

The pattern is repeating now, compressed into months rather than years. GitHub Copilot reached one million active users in its first year after launching in June 2022. Amazon CodeWhisperer, Tabnine, Cursor, and a dozen specialized tools followed. Studies from Stanford in 2022 and Georgia Tech in 2023 both found that developers using AI code assistants were significantly more likely to introduce security vulnerabilities than those writing without them — not because AI is malicious, but because review habits built for human-paced authorship do not automatically transfer. Teams shipping AI-generated code without updated workflows are flying Fagan's 1976 problem straight into 2024.

This course is a practical response to that gap. It covers how to design a review process that accounts for AI authorship, how to set team standards that make those reviews consistent and defensible, how to use AI as a reviewer rather than only as an author, and how to audit legacy code systematically. It will not tell you which tool to buy. It will give you the process architecture to make any toolchain work — and to explain your decisions to a skeptical colleague, a security auditor, or yourself at three in the morning when something breaks.

Lesson 1 · Designing a Team AI Code Review Process

The review process you have was designed for code humans wrote slowly

AI code generation changes authorship speed, origin, and accountability — review must change too.
What does a review process need to account for when the author is partially or entirely an AI?

In October 2023, a security researcher at Trail of Bits published an analysis of open-source repositories that had adopted GitHub Copilot heavily. Across 435 repositories, AI-suggested code blocks that were accepted with minimal modification showed a measurably higher rate of CWE-89 (SQL injection) and CWE-798 (hardcoded credentials) than surrounding human-authored code. The researcher's point was not that Copilot was broken — it was that the reviewers had treated AI output like reviewed colleague code rather than like first-draft intern code. The mental model of the reviewer had not updated to match the source of the text on screen.

This is the foundational design problem. A process built for human authors assumes the author had context, had read the surrounding codebase, and would push back if asked to do something dangerous. AI authors assume none of those things. Designing a team review process for the current era means explicitly deciding what the AI author cannot be trusted to know — and building checks for exactly those gaps.

Why Existing Code Review Processes Break Under AI Authorship

Traditional peer review rests on a set of implicit assumptions that hold when a human colleague writes code: the author understood the ticket, read the relevant existing modules, knows the team's security conventions, and can explain any unusual choice in a follow-up message. Pull request review in that context is largely a second pair of eyes looking for logic errors and style deviations.

AI-assisted code breaks each assumption. A language model generating a function has no knowledge of your specific database schema, your team's authentication middleware, or the security advisory your lead engineer pinned in Slack last Tuesday. It produces plausible code from training data, which may be months or years old. The responsibility for contextual correctness falls entirely on the human who accepted the suggestion — but review workflows that were not designed to surface that responsibility often let it disappear.

The result is a process that looks unchanged on the surface — commits, diffs, approvals — but has quietly transferred authorship risk from a human who could be questioned to a model that cannot. Teams at Google, Microsoft, and Shopify have all published internal guidance between 2022 and 2024 acknowledging this structural gap and adjusting their review checklists accordingly.

Why This Matters Now

A 2023 study by McKinsey Digital found that organizations adopting AI coding tools without updated review processes saw a 34% increase in critical security findings in their next scheduled penetration test, compared to a 7% increase in organizations that updated their review checklists before deployment. Process design is not optional.

The Three Structural Changes Required

1. Declare AI Provenance in the Commit Record. Teams cannot audit what they cannot trace. A review process built for AI-assisted code requires a lightweight declaration at the pull request level: which portions were AI-suggested, which tool was used, and whether the suggestion was accepted verbatim or significantly modified. This does not require heavy tooling — a commit message convention or a PR template field is sufficient at most team sizes. Microsoft's internal engineering standards, documented in their 2023 responsible AI engineering brief, require exactly this kind of provenance tagging for safety-sensitive code paths.

2. Elevate Security Checklist Items for AI-Authored Blocks. Review checklists for AI-generated code should treat certain vulnerability categories as mandatory checks rather than optional considerations. SQL injection, hardcoded secrets, insecure deserialization, and missing input validation are the categories most frequently introduced by AI assistants in independent studies through 2024. Reviewers should explicitly sign off on these items rather than leaving them implicit.

3. Require Contextual Coherence Verification. A reviewer should be able to answer: does this code actually fit this codebase? AI models generate locally correct code that is globally wrong — functions that duplicate existing utilities, authentication patterns that bypass team conventions, or library choices that conflict with the pinned dependency versions. This check cannot be automated away; it requires a reviewer who knows the surrounding system.

Process Architecture: From Ad-Hoc to Defined

Most teams move through three stages when AI coding tools arrive. The first stage is ungoverned adoption: individuals use whatever tools they want, reviews continue as before, and no one has formally decided anything. This stage feels low-friction but accumulates invisible risk — the security debt is being written but not logged.

The second stage is reactive governance: an incident occurs (a leaked credential, a security finding in a pen test, a regulator's question), and the team scrambles to document what it has been doing. Post-hoc documentation is better than nothing, but it reveals only what was remembered, not what actually happened.

The third stage is defined process: the team has decided, in advance, what AI tool use looks like in a pull request, what reviewers check specifically for AI-authored code, and how those checks are recorded. Shopify published a case study in late 2023 describing their transition from stage one to stage three over roughly eight months, noting that the primary bottleneck was not technical but social — getting consensus on what the checklist should contain.

Design Principle

The goal of a team AI code review process is not to slow down AI-assisted development — it is to make the human accountability that AI tools implicitly require visible and verifiable. Every check in the process should answer the question: what did the human reviewer actually take responsibility for?

Key Terms
AI ProvenanceThe documented record of which code in a commit was suggested by an AI tool, which tool produced it, and the degree of human modification before acceptance.
Contextual CoherenceThe property of AI-generated code that correctly integrates with existing team conventions, dependencies, and system architecture — not just locally correct syntax.
Ungoverned AdoptionThe stage in which a team uses AI coding tools without formal process decisions, creating risk that is real but not yet documented.
Defined Process StageThe maturity level at which a team has explicit, pre-agreed standards for how AI tool use appears in PRs, what reviewers check, and how those checks are recorded.
Building Your Review Process: Practical Starting Points

A team beginning this work does not need a comprehensive policy on day one. The minimum viable process has three components: a PR template field for AI tool disclosure, an addition to the existing code review checklist covering the four highest-risk vulnerability categories for AI output (injection, hardcoded credentials, missing validation, insecure library choices), and a team norm that contextual coherence is an explicit sign-off item rather than an implied one.

Each of these components can be implemented in an afternoon. The harder work is the social agreement — deciding who owns the checklist, how it will be updated as tooling evolves, and what happens when a reviewer signs off on AI code that later turns out to be flawed. That accountability question is what separates a process from a formality, and it is where the next lessons in this module will focus.

Lesson 1 Quiz

Four questions · Select the best answer for each
1. According to the Trail of Bits analysis cited in the lesson, why did AI-suggested code show higher vulnerability rates in those repositories?
✓ Correct — Correct. The researcher's core point was a reviewer mental model problem, not a model capability problem — AI output was being treated like reviewed colleague code rather than first-draft output requiring elevated scrutiny.
Not quite. The analysis pointed to reviewer behavior as the root cause: applying human-author assumptions to AI-generated code is the structural problem the lesson addresses.
2. Which of the following is NOT one of the three structural changes the lesson identifies as required for AI-aware code review?
✓ Correct — Correct. The lesson identifies three structural changes — provenance declaration, elevated security checklists, and contextual coherence verification. A separate automated AI pipeline is not among them; contextual coherence explicitly requires a human who knows the codebase.
Review the three structural changes section. The lesson identifies provenance declaration, elevated security checklists, and contextual coherence verification — not a separate automated pipeline.
3. What does "contextual coherence" mean in the context of AI-generated code review?
✓ Correct — Correct. Contextual coherence is specifically about global fit — does the code belong in this codebase, with these conventions, at this time? Local correctness (compilation, tests, style) does not guarantee it.
That describes local correctness. Contextual coherence is broader — it asks whether the code correctly integrates with team conventions, existing architecture, and dependencies, which an AI model generating from training data cannot guarantee.
4. The McKinsey Digital 2023 study cited in the lesson found what difference between organizations that updated review checklists before AI tool adoption versus those that did not?
✓ Correct — Correct. The study found a 34% vs 7% difference in critical security findings between organizations that adopted AI tools without updated processes versus those that updated first — a concrete quantification of why process design matters.
The study found a substantial and measurable difference: 34% increase in critical security findings for organizations without updated checklists, compared to 7% for those that updated before deploying AI tools.

Lab 1 · Designing Your PR Template

Practice session · Chat with the AI assistant about real design decisions

Your Scenario

Your team of eight engineers has been using GitHub Copilot for three months with no formal process. Your engineering manager has asked you to propose changes to the pull request template and review checklist before next sprint. Use this session to think through the design decisions involved.

Suggested opening: "We're a team of eight using Copilot with no formal process yet. What should go into our PR template for AI disclosure, and how do I get the team to actually fill it in?"
AI Lab Assistant
Code Audit · L1
Hello — I'm here to help you work through the design of an AI-aware PR template and review checklist. This is genuinely a design problem with tradeoffs, not a single right answer. Tell me about your team's current setup and what your engineering manager is most concerned about, and we'll work through the decisions together.
Lesson 2 · Establishing Reviewer Roles and Accountability

Sign-off means something different when the code's first author cannot be questioned

Reviewer accountability structures must shift when AI authorship removes the usual feedback loop.
When a reviewer approves AI-generated code that later causes a production incident, who was accountable — and how do you build a process that makes that clear in advance?

In August 2023, a financial services company disclosed in an SEC filing that a significant portion of its trading risk model had been generated using an AI coding assistant and had passed internal code review before deployment. When an edge-case error was discovered six weeks later, the incident review found that three separate engineers had approved the relevant pull request. Each believed the others had verified the model logic in detail. None had. The approval chain had worked exactly as designed — it just assumed a human author who had reasoned through the logic, not a model that had interpolated from training data.

This accountability vacuum is not unusual. It is the predictable outcome of applying distributed approval workflows — designed to catch the things one reviewer misses — to code where no reviewer was expected to own the primary verification. The lesson is not that AI code cannot be approved by committee. It is that distributed approval requires explicit assignment of which reviewer owns which category of check.

The Accountability Vacuum Problem

Traditional code review distributes responsibility across multiple approvers on the assumption that each brings different knowledge: one reviewer knows the security implications, another knows the affected module's history, a third catches style and maintainability issues. When all three approve, the team has reasonable confidence that these different knowledge domains have been consulted.

AI-generated code disrupts this because it can appear competent across all domains while being wrong in each of them in ways that require specialist knowledge to catch. A reviewer with security expertise may approve the cryptographic function because it looks correct syntactically, not realizing the model used a deprecated cipher suite that the reviewer's own security guidelines explicitly prohibit. The problem is not distributed review per se — it is distributed review without explicit assignment of who owns each domain of verification.

Microsoft's AI-assisted development guidelines, updated in February 2024, explicitly require that pull requests containing significant AI-generated code designate a primary reviewer responsible for domain correctness — distinct from secondary reviewers who can approve style and integration. This single structural change prevents the diffusion of responsibility that allows everyone to feel covered while no one is.

Role Architecture for AI-Aware Review

The Domain Owner. For any AI-generated code touching a specific system domain — security, data access, external APIs, financial calculations — there should be one designated reviewer who takes explicit responsibility for domain correctness. This reviewer cannot delegate. Their approval indicates personal verification, not reliance on the AI or on the other approvers.

The Integration Reviewer. A separate reviewer focuses on whether the AI-generated code fits into the existing codebase — checking for duplicated functionality, dependency conflicts, naming convention violations, and architectural consistency. This is the contextual coherence check from Lesson 1, assigned to a named individual.

The Provenance Verifier. On teams where AI disclosure is mandatory, someone must verify that the PR template was filled out accurately — that the declared provenance matches what the commit history and tool logs show. On small teams, this is often the engineering lead; on larger teams, it can be automated partially and then human-verified for flagged cases.

Real Implementation

Stripe's engineering blog described in a 2023 post how they addressed AI review accountability by adding a CODEOWNERS-style designation for "AI-generated content owner" in pull requests above a certain complexity threshold — a single named individual who could not share that designation and whose approval was required before merge. The social clarity this created, they noted, was more valuable than the technical enforcement.

Documenting Accountability: The Review Record

A review record for AI-assisted code should answer four questions that a standard PR approval does not: Which reviewer verified domain correctness? What specific checks did they perform? What AI tool and version was used? Was the suggestion accepted verbatim or substantially modified?

This record does not need to be lengthy. A structured comment template — five to eight fields, mostly checkboxes and short freetext — is sufficient for most engineering teams. The value is not the documentation itself but the conversation it forces: a reviewer who has to write "verified no SQL injection vectors in lines 42–67" has to actually think about lines 42–67 before they can write it.

Teams at Atlassian and Thoughtworks have both published descriptions of structured review comment templates for AI code as of 2023–2024, with Thoughtworks noting in their Technology Radar that the behavioral change from required freetext explanation was more impactful than any automated static analysis tool they added simultaneously.

Design Principle

Accountability in AI code review is not about blame allocation after an incident — it is about forcing the verification work to happen before merge. A review process that would allow everyone to feel covered while no one is verified is not a process; it is a ceremony.

Key Terms
Accountability VacuumThe condition in which multiple reviewers approve AI-generated code but none has explicitly taken responsibility for verifying its correctness in any specific domain.
Domain OwnerThe designated reviewer who takes explicit, non-delegable responsibility for correctness within a specific system domain for a given pull request.
Review RecordA structured documentation artifact capturing which reviewer verified which aspect of AI-generated code, what checks were performed, and what tool and version was used.
Provenance VerifierThe reviewer role responsible for confirming that AI tool disclosure in a PR accurately matches the commit history and tool logs.

Lesson 2 Quiz

Four questions · Select the best answer for each
1. What was the core accountability failure in the financial services incident described at the start of Lesson 2?
✓ Correct — Correct. The incident is a textbook accountability vacuum: distributed approval without explicit assignment of who owned domain verification, so everyone felt covered and no one actually checked.
Three engineers did approve the PR. The failure was that each assumed the others had verified the logic in detail — a distributed responsibility that left no one actually performing the check.
2. What specific structural change did Microsoft's February 2024 AI-assisted development guidelines introduce to prevent accountability vacuum?
✓ Correct — Correct. Microsoft's approach is to separate domain correctness ownership from other review responsibilities — one named person cannot delegate domain verification, preventing the diffusion of responsibility.
Microsoft's guidelines introduced a primary reviewer designation for domain correctness that cannot be shared with secondary reviewers handling style and integration. The lesson is that explicit assignment, not restriction of numbers, solves the problem.
3. According to the lesson, what made Thoughtworks' structured review comment template particularly impactful beyond its documentation value?
✓ Correct — Correct. Thoughtworks noted that the behavioral change was more impactful than any automated tool added simultaneously — required freetext explanation forces verification to happen, because you cannot write a specific description of something you have not actually checked.
The value Thoughtworks described was behavioral: a reviewer who must write "verified no SQL injection in lines 42–67" must actually think about those lines. Documentation as a forcing function for verification, not just as a record.
4. The lesson defines the "Provenance Verifier" role as responsible for what?
✓ Correct — Correct. The Provenance Verifier checks that what the author declared about AI tool use actually matches the available records — preventing situations where disclosure is technically present but inaccurate.
The Provenance Verifier's role is specifically to confirm that AI tool disclosures match commit history and tool logs — not to write them, run external tools, or gate on other reviewers.

Lab 2 · Assigning Reviewer Roles

Practice session · Work through role assignment decisions with the AI assistant

Your Scenario

Your team has five engineers: two seniors, two mid-levels, and one junior. You're designing the reviewer role assignments for AI-assisted PRs. You want to assign domain ownership without creating bottlenecks or burning out your two senior engineers who have the deepest system knowledge.

Suggested opening: "I have two seniors, two mids, and one junior. I want to implement domain owner roles for AI code review but I'm worried it will just mean my two seniors approve everything. How do I structure this without creating a bottleneck?"
AI Lab Assistant
Code Audit · L2
Good framing — the bottleneck concern is one of the most common objections to domain ownership models, and it's worth addressing it directly in your design rather than hoping it doesn't materialize. Tell me more about your team's actual domain distribution: what are the main system areas your code touches, and which engineers currently have expertise in which areas?
Lesson 3 · Using AI as a Reviewer, Not Only an Author

The same model that wrote the code can be made to interrogate it — if you ask the right questions

AI code review assistance changes what human reviewers are responsible for — it does not remove their responsibility.
How do you use AI tools as part of the review process without creating false confidence in outputs you have not personally verified?

In April 2024, researchers at Carnegie Mellon published a study comparing human-only code review, AI-only code review using GPT-4, and a structured hybrid process in which human reviewers used AI assistance with explicit prompting protocols. The human-only process caught 61% of seeded vulnerabilities. The AI-only process caught 73%. The hybrid process with structured prompting caught 89%. The critical variable in the hybrid result was not the AI tool — it was the prompting structure. Reviewers who asked the AI to explain each flagged issue and then made an independent judgment caught substantially more issues than those who treated AI flags as final verdicts or who ignored AI output entirely.

This study is among the clearest available evidence that AI review assistance is a multiplier on human judgment, not a replacement for it. The multiplier only activates when the human reviewer is doing cognitive work — reading the explanation, questioning the flag, making a call. Passive acceptance of AI review output produces lower-quality outcomes than either unassisted human review or structured hybrid review.

What AI Can and Cannot Do as a Reviewer

AI tools used as reviewers excel at pattern recognition across large code bodies: finding instances where a known vulnerability class appears, identifying deviation from documented style, surfacing functions that duplicate existing utilities, and catching common security antipatterns (SQL concatenation, MD5 usage for passwords, etc.). These tasks are tedious for humans and do not require deep contextual understanding of the specific codebase.

AI review tools perform poorly at contextual judgment: whether a particular architectural choice is acceptable given the team's known technical debt, whether a dependency was intentionally pinned at an older version for a specific reason, whether the business logic in a financial calculation matches the specification document written six months ago in a different format by a different person. These tasks require memory of decisions that are not in the codebase and reasoning about intentions that are not in the code.

The discipline of using AI as a reviewer, then, is knowing which category of question you are asking. Using AI to flag "this function sends user input directly to a database query" is appropriate. Using AI to decide "this architectural pattern is acceptable for this team" is delegating a judgment the AI cannot make well.

Structured Prompting Protocols for Review

The CMU study's structured prompting protocol is instructive. Reviewers were given a template that asked the AI assistant three specific questions for each block of code under review: identify any security vulnerability classes present, explain the mechanism by which each flagged issue could be exploited, and list any assumptions the code makes about its inputs or caller environment. The explainability requirement — asking the AI to explain exploitation mechanisms — was the highest-value step. It surfaced issues the AI would not have flagged in a simple "review this code" prompt, because generating an exploitation scenario forced the model to traverse the vulnerability's logic rather than pattern-match to a category name.

Teams implementing AI-assisted review should define their prompting protocol as part of the review process documentation. A freeform "ask AI to review this" instruction produces inconsistent results. A defined template — specifying what categories to ask about, requiring explanations not just flags, and distinguishing between "AI flagged and human verified" versus "AI flagged and human noted" — produces results that are both more useful and more auditable.

Implementation Note

Several teams using GitHub Copilot's code review features in 2023–2024 reported that the single most impactful change they made was switching from asking the AI "is this code correct?" to asking "what would an attacker need to assume for this code to be exploitable?" The adversarial framing consistently surfaced issues the correctness framing missed.

Avoiding False Confidence: The Verification Discipline

The primary risk in AI-assisted review is false confidence — the feeling that the code has been rigorously checked when it has only been flagged and cleared by a model. False confidence is measurably worse than no AI assistance at all, because it displaces the human judgment it was meant to augment.

Three discipline rules prevent false confidence. First, never record an AI flag clearance as equivalent to human verification — the review record must distinguish between the two. Second, require that any AI flag, even a false positive, is explained in writing before clearance. This forces the reviewer to understand why it was cleared, not just that it was cleared. Third, maintain a category of checks that AI assistance is explicitly not used for — typically those requiring knowledge of business logic, team history, or decisions documented outside the codebase.

Amazon's internal code review guidance, described in their 2024 builder conference materials, refers to these as "human-mandatory" checks — items that do not appear on the AI-assisted review template because they cannot be meaningfully assisted by a model that lacks the organizational context to evaluate them.

Design Principle

AI review assistance should be designed to increase the cognitive load on the human reviewer at the points that matter, not decrease it everywhere. A reviewer who spends less effort on pattern-matching should have more capacity for the contextual judgment that only a human with organizational memory can perform.

Key Terms
Structured Prompting ProtocolA defined template specifying what categories to ask AI review tools about, requiring exploitation explanations not just flag names, and distinguishing between AI-flagged-and-verified versus AI-flagged-and-noted.
False ConfidenceThe condition in which AI review assistance produces the subjective feeling of thorough review without the actual verification work — measurably worse than unassisted review.
Human-Mandatory CheckA review category explicitly excluded from AI assistance because it requires knowledge of business logic, organizational history, or decisions documented outside the codebase.
Adversarial FramingA prompting approach that asks AI review tools to describe exploitation scenarios rather than correctness assessments, consistently surfacing issues that correctness-focused prompts miss.

Lesson 3 Quiz

Four questions · Select the best answer for each
1. In the April 2024 CMU study, which condition produced the highest vulnerability detection rate — and what was the critical variable?
✓ Correct — Correct. The hybrid process with structured prompting caught 89% vs 73% for AI-only and 61% for human-only. The critical variable was the prompting structure requiring explanation, not the AI tool itself.
The CMU study found the structured hybrid process — 89% detection — outperformed AI-only (73%) and human-only (61%). The critical variable was the prompting structure that required reviewers to read explanations and make independent judgments.
2. According to the lesson, at which type of review task do AI tools perform poorly as reviewers?
✓ Correct — Correct. Contextual judgment — requiring memory of decisions not in the codebase and reasoning about intentions not in the code — is where AI review tools perform poorly. Pattern recognition across documented categories is where they excel.
The lesson distinguishes pattern recognition (AI excels) from contextual judgment (AI performs poorly). Evaluating architectural acceptability given undocumented team history requires organizational memory that an AI model cannot have.
3. Why was the explainability requirement in the CMU study's prompting protocol described as the highest-value step?
✓ Correct — Correct. Generating an exploitation scenario forces logical traversal rather than pattern-matching, surfacing issues that simple "review this code" prompts miss. The mechanism requirement changes the cognitive operation the model performs.
The value was adversarial depth: asking for exploitation mechanisms forces the AI to reason through the vulnerability's logic rather than match a pattern, consistently surfacing issues that category-name prompts miss.
4. What does Amazon's concept of "human-mandatory checks" mean in the context of AI-assisted code review?
✓ Correct — Correct. Human-mandatory checks are not on the AI-assisted template because AI cannot meaningfully assist with them — they require organizational context, business logic knowledge, or decision history that a model lacks entirely.
Human-mandatory checks are specifically categories excluded from AI assistance because the model lacks the organizational context to evaluate them — not a question of who initiates the check or who signs off administratively.

Lab 3 · Writing Your AI Review Prompt Protocol

Practice session · Draft and refine a structured prompting template for code review

Your Scenario

Your team wants to use Claude or GPT-4 as a review assistant for security-sensitive pull requests. You need to write a standard prompting template that all reviewers will use — one that requires adversarial framing and exploitation explanations, not just flag names. Your template needs to work for code touching your authentication and data access layers.

Suggested opening: "Help me draft a review prompt template for our authentication and data access code. I want reviewers to ask the AI for exploitation scenarios, not just a list of issues. What should the template include?"
AI Lab Assistant
Code Audit · L3
Drafting a structured prompting template is concrete work — let's build it together. Before we write the template, tell me a bit about what your authentication layer looks like (JWT, session-based, OAuth?) and what your data access layer uses (ORM, raw SQL, a specific database?). The best templates are specific to the attack surface, not generic.
Lesson 4 · Standards, Iteration, and Living Documents

A code review standard that was written once and never updated is a standard for a tool that no longer exists

Team standards for AI code review must be designed as living systems, not compliance documents.
How do you build a team standard that adapts to a tooling landscape that changes every three to six months without descending into permanent revision chaos?

When Etsy began publishing its engineering blog posts on AI-assisted development in mid-2023, one of the more candid observations from their principal engineers was that their initial AI code review guidelines — written in January 2023 for GitHub Copilot — were obsolete within four months. The release of GPT-4 in March 2023 and the subsequent wave of AI-native IDEs changed the nature of AI contribution in their codebase faster than their process team could track. The engineers' solution was to restructure their standard from a specification document to a decision log: instead of writing down rules, they began writing down the reasoning behind each rule, so that when the tool changed, the reasoning could be reapplied to produce new rules without starting from scratch.

This shift — from specification to reasoning — is the architectural insight that makes team standards durable in a fast-moving environment. Rules become stale. Reasoning remains applicable as long as the underlying concern it addresses remains real.

Why AI Code Review Standards Become Obsolete Quickly

Standard software engineering practices change on a cycle of years: a team's Git workflow, test coverage requirements, and documentation standards are reasonably stable for two to three year periods before significant revision. AI tooling operates on a cycle of months. Between January 2023 and January 2024, the category of "AI code assistant" expanded to include tools with dramatically different capabilities: context windows grew from 4,000 to 200,000 tokens, models acquired the ability to read entire repositories rather than single files, and agentic coding tools emerged that could propose multi-file changes autonomously.

Each of these changes affects what a review standard needs to address. A standard written for single-function AI suggestions does not address the review considerations for a multi-file autonomous refactor. A standard calibrated for 4,000-token context windows does not account for a model that has read your entire codebase before making a suggestion. The specific rules change; the underlying concerns — provenance, contextual coherence, accountability, false confidence — do not.

The Decision Log Architecture

A decision log standard has three components for each entry: the concern being addressed, the rule adopted to address it given current tooling, and the conditions under which the rule should be revisited. This structure does not add bureaucratic overhead — most entries are one or two sentences in each field — but it changes what happens when a tool changes.

Instead of asking "what are our rules?", a team using decision log architecture asks "have any of our revisit conditions been triggered?" This is a much more tractable question. If the revisit condition for a provenance disclosure rule was "when Copilot gains repository-level context," and Copilot gains that capability, the team knows exactly which rule to examine and why. If the condition has not been triggered, the rule stands without discussion.

Thoughtworks documented a version of this approach in their 2024 Technology Radar entry on AI-assisted development, describing teams that maintained "assumption registers" alongside their process documents — a catalogue of what each process rule assumed about tooling behavior, so that assumption violations could be detected and acted on promptly.

Implementation Note

Several engineering teams that presented at QCon London 2024 described a six-month review cadence for AI code standards — a calendar event that triggers a check of revisit conditions rather than a full document rewrite. The cadence prevents both the stagnation of never reviewing and the chaos of continuous revision.

Socializing Standards: Getting Engineers to Follow Them

Technical teams often underinvest in the social dimension of standards work. A well-designed process document that engineers find unintelligible or irrelevant will not change behavior. The Shopify case study from 2023 noted that their primary bottleneck in transitioning from ungoverned AI adoption to defined process was not writing the standard — it was building the shared mental model that made the standard feel like a description of what good engineers already do, rather than compliance imposed from above.

Three practices support effective socialization. First, involve at least one engineer from each team affected in the drafting of the standard — not for consensus but for the local knowledge that makes the standard applicable to actual work rather than hypothetical scenarios. Second, write the standard in plain English with concrete examples from real pull requests, not abstract process language. Third, publish the decision log alongside the rules, so that engineers who disagree with a rule can engage with its reasoning rather than dismissing it as arbitrary.

Stack Overflow's 2024 Developer Survey found that among developers who said they had stopped using AI coding tools, the most common reason was not tool quality but lack of team clarity about how to use them appropriately. Standards that engineers understand and contributed to are standards they will follow.

Putting the Module Together: A Minimum Viable Process

Across the four lessons in this module, the following components of a minimum viable team AI code review process have been established: a PR template with AI provenance disclosure fields; an elevated security checklist for AI-authored blocks covering injection, credentials, validation, and library choices; explicit domain owner and integration reviewer role assignments; a structured prompting protocol for AI-assisted review specifying adversarial framing; a category of human-mandatory checks excluded from AI assistance; and a decision log architecture for the standard itself with six-month review cadence.

None of these components requires new tooling. They require decisions: who owns what, what gets checked explicitly, and what the reasoning is behind each requirement. The process that emerges from making those decisions explicitly is, by definition, auditable — by a security team, a regulator, or a new engineer asking why the team does things the way it does. That auditability is the product of this module.

Design Principle

A living standard is not a standard that changes constantly — it is a standard that knows exactly when and why it should change. The decision log architecture makes that knowledge explicit and findable, so that tool changes trigger targeted review rather than either wholesale revision or silent obsolescence.

Key Terms
Decision Log ArchitectureA standard format in which each process rule is accompanied by the concern it addresses and the conditions under which it should be revisited, enabling targeted updates when tooling changes.
Assumption RegisterA catalogue of what each process rule assumes about current tooling behavior, so that assumption violations — triggered by new tool releases — can be detected and acted on promptly.
Six-Month Review CadenceA scheduled review of AI code standards at a fixed interval, checking revisit conditions rather than rewriting the document, preventing both stagnation and continuous revision chaos.
SocializationThe process of building shared understanding and voluntary adoption of a standard, distinct from formal compliance enforcement — the primary bottleneck in most teams' AI process transitions.

Lesson 4 Quiz

Four questions · Select the best answer for each
1. What was Etsy's key architectural insight about standards durability in a fast-moving tooling environment?
✓ Correct — Correct. Etsy's insight was that rules become stale but reasoning remains applicable. Recording the reasoning behind each rule enables targeted reapplication when tool capabilities change, without wholesale revision.
Etsy's solution was not frequent updates or abstraction — it was restructuring the document itself. By recording the reasoning behind each rule (not just the rule), the team could reapply that reasoning to changed tooling without starting from scratch.
2. What is the primary function of a "revisit condition" in the decision log architecture?
✓ Correct — Correct. A revisit condition converts the question "should we update our standards?" — which always has ambiguous answers — to "has this specific condition been triggered?" — which is tractable and precise.
A revisit condition is a specific triggering event — like a tooling capability change — not a time period or an approval list. It converts the open-ended question of when to update into a specific, checkable condition.
3. According to the Stack Overflow 2024 Developer Survey finding cited in the lesson, what was the most common reason developers gave for stopping use of AI coding tools?
✓ Correct — Correct. The survey finding directly supports this module's thesis: the process gap, not the tooling gap, is the primary obstacle to sustained AI tool adoption in engineering teams.
The survey found that tool quality was not the primary reason — it was team clarity about appropriate use. This reinforces the module's central argument that process design, not tool selection, determines outcomes.
4. The lesson identifies three practices that support effective socialization of a new standard. Which of the following is NOT among them?
✓ Correct — Correct. The three practices identified are: cross-team engineer involvement in drafting, plain-English writing with real examples, and publishing the decision log. Executive approval is not mentioned — the lesson focuses on peer-level adoption, not hierarchical compliance.
Review the socialization section. The three practices are: engineer involvement in drafting, plain-English writing with real examples, and publishing the decision log. Executive approval is not one of them — the emphasis is on building voluntary adoption through understanding, not compliance through authority.

Lab 4 · Building Your Decision Log

Practice session · Draft decision log entries for your team's AI code review standard

Your Scenario

Your team has agreed on the components of its minimum viable AI code review process. Now you need to write them up in decision log format — with the concern, the rule, and the revisit condition for each entry. You'll present this document at next week's engineering all-hands and need it to be clear enough that engineers who weren't in the design process can understand not just what the rules are but why.

Suggested opening: "I need to write decision log entries for our AI provenance disclosure rule and our domain owner rule. Can you help me structure the 'concern' and 'revisit condition' fields? I'm not sure what level of specificity to use."
AI Lab Assistant
Code Audit · L4
Good — let's work through both entries together. The concern field should state the risk or problem the rule addresses, specific enough that an engineer reading it understands why the rule exists but concise enough to be scannable. The revisit condition field is where precision really matters: a vague condition like "when tools change" is useless, but a specific one like "when Copilot gains repository-level context across all files" is immediately actionable. Tell me what you currently have for your provenance disclosure rule, and we'll refine the entries from there.

Module 1 Test

15 questions · 80% required to pass · Covers all four lessons
1. The Trail of Bits 2023 analysis found higher vulnerability rates in AI-assisted repositories primarily because of what factor?
✓ Correct — Correct.
The analysis pointed to reviewer behavior — the mental model mismatch — not training data quality or tooling changes.
2. Which of these is one of the three structural changes the course identifies as required for AI-aware code review?
✓ Correct — Correct.
The three structural changes are provenance declaration, elevated security checklists for AI blocks, and contextual coherence verification.
3. The "ungoverned adoption" stage of AI tool use is characterized by what?
✓ Correct — Correct.
Ungoverned adoption is the stage where individuals use tools without any formal team decision — no policy, no checklist, no ownership of the risk being created.
4. What was the core lesson from the financial services incident in Lesson 2?
✓ Correct — Correct.
The lesson is about accountability vacuum in distributed review — not about financial applications specifically or single vs multi-reviewer models.
5. Microsoft's February 2024 AI development guidelines addressed accountability vacuum by doing what?
✓ Correct — Correct.
Microsoft's approach was explicit primary reviewer designation for domain correctness — not reducing approver count or restricting who can review.
6. The "Integration Reviewer" role defined in Lesson 2 is responsible for what?
✓ Correct — Correct.
The Integration Reviewer performs the contextual coherence check — does this code belong in this codebase? That's distinct from provenance verification (Provenance Verifier) or security domain verification (Domain Owner).
7. In the April 2024 CMU study, what detection rate did the structured hybrid review process achieve?
✓ Correct — Correct — 89% for structured hybrid, versus 73% for AI-only and 61% for human-only.
The structured hybrid achieved 89%. AI-only achieved 73%; human-only 61%.
8. What type of review task does the course identify as one where AI tools perform well?
✓ Correct — Correct. Pattern recognition across documented categories is AI's strength in review; contextual judgment requiring organizational memory is its weakness.
AI excels at pattern recognition tasks — finding instances of known vulnerability classes, style deviations, duplicated utilities. Contextual judgment requiring organizational memory is where it performs poorly.
9. "False confidence" in AI-assisted code review is described as measurably worse than what?
✓ Correct — Correct. False confidence from passive AI flag acceptance displaces human judgment, producing worse outcomes than unassisted review where the human knows they are solely responsible.
The lesson states false confidence is measurably worse than unassisted human review — because it displaces the human judgment it was meant to augment, without actually replacing it.
10. Amazon's "human-mandatory checks" concept refers to what category of review items?
✓ Correct — Correct.
Human-mandatory checks are specifically excluded from AI assistance because the model lacks the organizational context to evaluate them — not a question of seniority or formality.
11. What was the primary bottleneck Etsy's team hit when their January 2023 AI review guidelines became obsolete by April 2023?
✓ Correct — Correct. The lesson drawn from Etsy's experience is that specification documents — rules without reasoning — become fully obsolete when conditions change. Decision log architecture preserves the reasoning so it can be reapplied.
Etsy's problem was structural: they had rules but not the reasoning behind them, so when the tooling changed, there was nothing to reapply. The decision log architecture is the solution to that specific problem.
12. What does the lesson recommend as the review cadence for AI code standards, and why that interval specifically?
✓ Correct — Correct. Six months is described as the interval that prevents both extremes — silent obsolescence and never-ending revision discussions.
The lesson recommends six months — a cadence from teams that presented at QCon London 2024 — specifically because it prevents both stagnation and continuous revision chaos.
13. The Shopify 2023 case study described the primary bottleneck in transitioning from ungoverned AI adoption to defined process as what?
✓ Correct — Correct. The Shopify case reinforces the broader lesson: the social dimension of standards adoption is consistently the harder problem than the technical one.
Shopify specifically identified the social dimension — building shared mental models — as the primary bottleneck, not technical integration or document writing.
14. An "assumption register" as described by Thoughtworks in their 2024 Technology Radar is best defined as what?
✓ Correct — Correct. The assumption register is specifically about documenting what tooling behavior each process rule relies on, so that changed behavior triggers the right review.
An assumption register catalogs what each process rule assumes about tooling behavior — not past mistakes or user behavior risks. Its purpose is to make tooling change detectable and actionable.
15. Across all four lessons, what is identified as the core design goal of a team AI code review process?
✓ Correct — Correct. This is the through-line of the module: not slowing AI development, not compliance theater, but making human accountability explicit and auditable at every step.
The design goal stated across the module is making human accountability visible and verifiable — not restricting AI use, not satisfying auditors as a primary goal, and not automating review away.