← CodeVetter

Verification field guide

AI code validation: requirements, tests, and evidence

AI code validation, verification, and review are three different jobs. Learn what validating agent-generated code actually requires and how to run a validation pass that produces evidence, not opinions.

Try an AI code validation check

Requirement: preserve an explicit false setting, the default, and the existing label. A truthiness fallback (input.enabled || true) breaks that requirement; a nullish fallback (input.enabled ?? true) preserves it.

The published synthetic task repeats the intended baseline failure twice and the known-good pass twice. Inspect the executed qualification receipt, then run the same failure-and-fix check locally.

The receipt qualifies this task and its checks; it does not measure an agent's success rate.

"AI code validation" is one of those search terms that covers three different jobs, and the method differs for each: review asks whether a change looks risky, validation asks whether it satisfies the stated requirements, and verification asks whether executed evidence proves the required behavior. Most tools and most searches conflate all three.

The three jobs, separated

Question What it checks What evidence it produces
AI code review Does the diff contain suspicious or risky code? Findings and comments on the patch
AI code validation Does the change satisfy what was requested? A pass/fail against declared acceptance criteria
Coding-agent verification Did the required behavior actually work when exercised? Executed checks, artifacts, and a reproducible verdict

Validation and verification overlap but are not interchangeable: a patch can satisfy its acceptance criteria on paper and still fail at runtime. The strongest answer comes from binding the requirement to a check that exercises it.

What validating agent-generated code requires

  1. A frozen statement of intent. The task the agent was given, verbatim — not a paraphrase reconstructed after the diff exists.
  2. Declared acceptance criteria. "The endpoint returns 404 for deleted records" is checkable; "make deletion work" is not. If the criteria are ambiguous, record the ambiguity rather than letting the validator pick a generous reading.
  3. Checks that exercise behavior. A review comment that a query "looks right" is not validation of the query. Running the endpoint, driving the browser flow, or executing the repository's own tests is.
  4. Failure classification. A red check can mean an agent regression, a pre-existing failure, an environment problem, or an unverified requirement. Collapsing them into "failed" loses exactly the information validation exists to produce.

Why a second model does not validate the first

The most common "AI code validation" workflow is asking another LLM to read the diff. That is review, not validation — the second model reasons about plausibility, not execution. It cannot confirm that the migration applies, the route responds, or the permission check denies what it should. A model reading code is a useful triage step; it is not evidence that the software works.

A practical validation pass

For an agent-produced change, run this sequence before trusting it:

  1. Write down the task and the exact revision being validated.
  2. Convert each acceptance criterion into the smallest check that exercises it — prefer repository-owned tests and commands.
  3. Run the checks in a bounded environment and record the command, exit state, and output.
  4. Classify each failure: regression, pre-existing, environment, or unverified.
  5. Re-run after the fix; keep both the failure and the later pass so the record shows closure.

Where CodeVetter fits

CodeVetter is built around the verification end of this spectrum: it binds a task and an exact agent change to executed checks and emits a portable evidence bundle with a pass, fail, or unverified verdict. Its public benchmark currently demonstrates a narrower recognition task — 27 synthetic cases with 29 labeled findings — and publishes its own limitations rather than claiming production-wide coverage.

What to inspect next

For the step-by-step workflow read the verification guide; for the conceptual boundary between review and verification see the comparison essay; for evidence shape see the bundle format; for measured results see the public benchmark.

CTA: Validate your next agent change with executable checks, or inspect how CodeVetter structures its evidence bundle.