Home / Claude Certified Architect – Foundations / Objective 4.4

Domain 4: Prompt Engineering & Structured Output · 20% of the exam · Full exam outline

4.4 Implement validation, retry, and feedback loops for extraction quality

What this objective covers

Retry-with-error-feedback: appending specific validation errors to the prompt on retry to guide the model toward correction. The limits of retry: retries are ineffective when the required information is simply absent from the source document (vs format or structural errors). Feedback loop design: tracking which code constructs trigger findings (detected_pattern field) to enable systematic analysis of dismissal patterns. The difference between semantic validation errors (values don't sum, wrong field placement) and schema syntax errors (eliminated by tool use). Implementing follow-up requests that include the original document, the failed extraction, and specific validation errors for model self-correction. Identifying when retries will be ineffective (e.g., information exists only in an external document not provided) versus when they will succeed (format mismatches, structural output errors). Adding detected_pattern fields to structured findings to enable analysis of false positive patterns when developers dismiss findings. Designing self-correction validation flows: extracting "calculated_total" alongside "stated_total" to flag discrepancies, adding "conflict_detected" booleans for inconsistent source data.

Practice questions

Question 1easy

A pipeline asks Claude to convert free-text shipping rules into a JSON config, then runs a static validator that checks field names against a known list. When the validator reports problems, what should the next turn to Claude contain?

Included in Master: master every domain.See plans
Question 2easy

A structured-output extraction job mostly parses cleanly, but a few responses are cut off mid-object and fail to parse. Their stop_reason is max_tokens. What should the pipeline do with these records?

Included in Master: master every domain.See plans