Salar Saeedi

Product management · Analysis

What should happen when a valid AI response contains the wrong value?

Design AI document review around source evidence, explicit missing fields and consistent handling of refusals and incomplete output.

Salar Saeedi2 min read
Three-stage illustration — What should happen when a valid AI response contains the wrong value?

An invoice extractor returns a valid numeric amount. It picked the subtotal near the top of the page, while the balance due appears at the bottom. The API payload passes and a real accounting error is still possible.

Use a schema that leaves room for missing evidence

Structured Outputs can constrain supported results to a JSON Schema. Model a missing or unreadable value explicitly and allow an evidence pointer such as a page reference. A required number with no unknown state pressures the interface to treat a guess as a fact.

Source · OpenAI · Structured Outputs

Check the field against the business record

Validate currency and amount together, confirm that the cited line contains the balance due, and keep conflicting records in a review queue. Let reviewers see the extraction and the source value side by side. Save their correction with the original result for later evaluation.

Give incomplete results a destination

The API describes refusals and incomplete output as cases the caller needs to handle. Route those outcomes intentionally. An unreadable invoice should remain available to a reviewer and should carry the reason for its provisional status.

Source · OpenAI · Structured Outputs

What to take away

Include one valid response with a wrong value, one missing required field and one incomplete response in the acceptance set. Verify that each enters the expected workflow.

References

Related work in the portfolio