Learn · Prompt engineering & structured output · CCAR-F task 4.4

Validation, retry and feedback loops

Extract, validate in code, send back the specific errors, retry a bounded number of times, then route to a human.

Key ideas

Worked example: A useful feedback message

"Your previous output had these problems: line 3 qty x unit_price = 120 but total = 210; invoice_date 2026-02-30 is not a real date. Fix only these." Each error names the field, the expected value and the actual value.

Exam traps

Official docs

Practise CCAR-F questions · Next lesson: Batch processing, and when not to