CCAR-F practice › Prompt Engineering & Structured Output · Question 80 of 105

Prompt Engineering & Structured Output

An invoice extractor uses tool use with a strict schema, and every response passes schema validation. Accounting still finds invoices where the extracted line items don't add up to the extracted total. What is the most effective addition?

Show answer and explanation

Answer: B — Extract calculated_total next to stated_total and flag mismatches

Totals that don't sum are a semantic error, which schema enforcement can't catch. Having the model compute calculated_total next to the stated_total turns the discrepancy into a flag, whether it's an extraction error or a genuine inconsistency in the source. Stricter schemas (a) only govern shape. Agreement between runs (c) can confirm the same mistake. A prompt instruction (d) provides no check.