How do you review code that AI wrote?
34 posts
Playbook
Practitioners are shifting from line-by-line inspection to layered verification, formal specifications, and risk-based human oversight.
- Layered verification and adversarial review
Move beyond manual checking by using end-to-end tests, property tests, and adversarial multi-agent review . This allows developers to focus on risk assessment and product intent . 2
- Risk-tiered review processes
Apply different review depths based on sensitivity: use automated or hybrid agent review for non-sensitive code, while reserving human decision-making for sensitive changes . 4
- Formal specification verification
Review a short formal specification—such as a 93-line spec—and use tools like Lean 4 to guarantee that long AI implementations and proof code match that spec . 9
- Whiteboard-driven planning and constraints
Spend approximately two thirds of time on whiteboard planning to define domains and boundaries, leaving the remaining third for building tests, architecture checks, and delivery pipelines . 7
- Defining completion via AGENTS.md
Establish clear 'done' criteria in an AGENTS.md file, requiring that tests, linting, type checking, and builds pass before an agent submits a pull request with evidence . 10
- Verifiable agent prompting
Instruct agents to make changes fully verifiable by having them register real services and click through the frontend to confirm every modification . 1
Choosing between approaches
Using formal verification via Lean 4 provides high correctness guarantees but results in slower performance, such as 24 seconds to calculate the intersection of two 70k triangle meshes 9.
Not covered yet
The material does not address how to manage or resolve the issue of parallel agents overwriting each other's changes 7.
Posts
- Ask the agent how to make a change fully verifiable, then let it click through the frontendMatt Pocock uses the prompt "how can we make this change fully verifiable" in AI coding.
- Verify agent code in layers, with end-to-end tests, property tests and adversarial reviewAddy Osmani suggests building verification for coding agents: once code is generated faster than people can review it, the bottleneck is proving it works.
- Collapse AI-generated PR descriptions to reduce review fatigueSimon Willison hides the bulk of his AI-generated GitHub pull request descriptions behind a collapsed details and summary HTML tag.
- Review code by risk tier: agents handle routine changes, people decide on sensitive onesAddy Osmani argues for risk-tiered review in the age of AI coding: non-sensitive code goes to automated or hybrid agent review, sensitive changes need a human decision, and every change still needs someone accountable for shipping it.

- Whiteboard defense: explain how a shipped customer-facing system works and where it breaksMitchell Hashimoto proposes the whiteboard defense as a standard for using AI responsibly: at any moment someone can pull you aside and ask you to explain a customer-facing system you shipped, covering how it works, why trade-offs were made and where it could fail.
- Model 26 core harness functions as Lean 4 theorems and diff-test them against real codeThe Amazon Kiro team had Kiro CLI model 26 core functions of its agent framework as Lean 4 theorems, aligned them with the real code through differential testing, and confirmed bugs by reproducing them with counterexamples.

- Spend about two thirds of the time on whiteboard planning, the rest on constraintsMartin Fowler's article records a team experiment in which agents wrote all the code.

- After a 3-week agent refactor, read the code: Keiji Kanazawa found a workflow, not an agentKeiji Kanazawa let agents refactor his personal research assistant for 3 weeks, then read the code.

- Review only a 93-line spec and let Lean guarantee 1000+ lines of AI implementationThe author formally verified a 3D CSG mesh intersection algorithm in Lean 4.
- Define "done" in AGENTS.md: tests, lint, type check and build pass, with test evidenceLeon van Zyl addresses agents that claim to be finished without running tests.

- Use adversarial code review to catch the system design and UI bugs LLMs now produce
- Read the code and run a security review before running an AI-written PDF reader
- Verify features with agent-recorded video instead of local testing, using Amp's remote Orbs
24 more posts to see