PRACTICE NOTE 01 · ENGINEERING WITH AI

How to verify AI-generated code without slowing to a halt

Verification is not a final test command. It is the process of turning an AI proposal into an engineering claim whose assumptions, boundaries, and behavior can be checked.

Reading time
7 minutes
Published
September 30, 2026
Updated
September 30, 2026
01

Generated code changes the speed, not the ownership

AI can produce a convincing patch before an engineer has finished building a model of the code around it. That speed is useful, but it also compresses the moment when assumptions usually become visible.

Treat the proposal as a candidate change. The engineer still has to explain what behavior should change, what must remain invariant, and what evidence would make the change safe to ship.

02

Climb a verification ladder from intent to operation

Five levels of evidenceEach level catches a different class of error. Passing a unit test does not establish the operational claim by itself.
  1. 01Intent
  2. 02Diff
  3. 03Narrow check
  4. 04System behavior
  5. 05Operational signal
  • Intent: restate the required behavior and the invariants before reviewing the patch.
  • Diff: inspect the actual changed paths, including error handling and state transitions.
  • Narrow check: run the smallest deterministic test that can falsify the proposed behavior.
  • System behavior: exercise the change across the boundary it affects, including a relevant failure case.
  • Operational signal: confirm that logs, metrics, or traces distinguish success from a silent regression.
03

Give the agent a verification contract

A prompt such as “fix this test” optimizes for a green test. A better instruction names the observed failure, the protected behavior, the files or boundaries worth inspecting, and the evidence required before the work is complete.

  • State what is known and what remains uncertain.
  • Name constraints that must not be traded away.
  • Ask for alternatives when the first proposal changes a public contract.
  • Require the agent to show which checks it ran and which it could not run.
  • Review the diff and evidence yourself before accepting the result.

This is not about writing a longer prompt. It is about making the assignment hard to satisfy through superficial code production.

04

Know when the evidence is not enough

QuestionFalse finishDefensible finish
TestsThe existing suite is greenA check tied to the changed risk is green
ReviewThe patch looks conventionalThe control flow and state effects are understood
ScopeOnly a few lines changedThe affected boundary and callers were inspected
OperationsNo error appeared locallyThe expected signal appears under a relevant condition

Stop and widen the investigation when the generated change alters data ownership, concurrency, authorization, billing, or an irreversible operation. Speed has less value when the cost of a wrong assumption is high.