Generated code often looks finished before it has earned trust: it has imports, comments, types, tests, and a tidy diff. The right response is neither blanket rejection nor blanket acceptance. I treat it as a proposal and ask what evidence would let me accept it.
Readability is not proof
Models are good at matching local style and anticipated control flow. That helps review, but it says nothing about whether the code has the right security boundary, database behavior, failure semantics, or operational fit.
Take a background worker that ingests records. It can look entirely reasonable and still fail to scope each record to the correct tenant, fail to separate poison messages from retryable errors, mishandle duplicate deliveries, or leave no audit trail. An API route can look right and still need to prove authorization, tenant isolation, pagination limits, and error behavior.
The code is the hypothesis. Evidence decides whether it holds.
Match evidence to risk
| Change type | Evidence to require |
|---|---|
| Data model | Migration upgrade and downgrade behavior, indexes, constraints, backfill plan |
| API route | Contract tests, authorization tests, tenant-isolation tests, bounded input and output |
| Background worker | Retry, idempotency, poison-message, concurrency, and observability tests |
| External integration | Sandbox or fixture contract tests, timeout behavior, reconciliation path, secret boundary |
| UI workflow | Loading, error, permission, empty-state, and high-volume rendering tests |
| Infrastructure | Plan validation, least-privilege review, alarms, rollback and local harness evidence |
The table is intentionally broader than unit tests. A function can be correct while the system around it is incomplete.
Keep the reviewer’s judgment
AI should reduce mechanical work, not technical judgment. A reviewer still decides whether the model has the right concept of ownership, whether a failure should be retried, whether a new permission is justified, and whether a migration is safe for real data.
One technique I recommend is requiring an implementation note with every substantial generated change:
- What behavior changed?
- What assumptions were made?
- What evidence was run?
- What was not verified?
- What approvals or environment checks remain?
The note makes unknowns reviewable instead of burying them under confident prose. “What was not verified” is the line I would read first.
Takeaway
Generated code is an accelerant; evidence is what makes it engineering. Teams that ask for the right evidence can accept AI-assisted changes quickly and safely. Teams that mistake polished output for proof inherit the uncertainty without knowing where it lives.