CCA Domain 4: Prompt Engineering & Structured Output Explained
What CCA domain 4 prompt engineering and structured output tests: specific criteria, few-shot, tool_use schemas, retries and Batch API.
Updated
Domain 4 of the CCA-F exam, Prompt Engineering & Structured Output, is 20% of the score and tests whether you know what a prompt can shape and what only a schema can guarantee. Specific criteria beat adjectives, a few well-chosen examples beat paragraphs of instruction, tool_use removes structural errors but not semantic ones, and retrying absent data produces fabrication rather than answers.
This post covers what the domain includes, why it is weighted at a fifth of the exam, the concepts to know cold, how questions are phrased, a worked scenario, and the traps. It is built on our 25-article Domain 4 study guide; each idea links to its source article.
What does CCA Domain 4 cover?
Six task areas, with an anchor article for each:
| Task | What it tests | Start here |
|---|---|---|
| 4.1 Specific criteria and rules | Replacing vague qualifiers with verifiable conditions; severity definitions | ”Be Conservative” Means Nothing — 47% Agreement. “Lacks Sample Size” Means Something — 94%. |
| 4.2 Few-shot calibration | Diverse examples, paired positive/negative cases, format consistency | Text Instructions Failed at 64%. Two Examples Reached 91%. |
| 4.3 Structured output via tool_use | Schema enforcement, tool_choice modes, nullable fields, closed enums | tool_use Eliminates Structural Errors. Semantic Errors Remain. |
| 4.4 Semantic validation and retry | Validation beyond schema, corrective feedback, absent-data classification | Blind Retry: 12% Fixed After 3 Attempts. Error Feedback: 87% Fixed After 1. |
| 4.5 Batch API | When to batch, custom_id, partial failures, result expiry | 50% Cost Savings — But Up to 24 Hours Wait |
| 4.6 Multi-pass review | Independent review instances, per-file and cross-file passes | Same-Session Review: 0.3 Findings. Independent Instance: 3.7. Human Baseline: 4.1. |
If the mechanics of tool_use as structured output are new, the Foundations article Virtual Tools: Hijacking tool_use for Guaranteed JSON explains the trick in a page.
Why is Domain 4 weighted at 20%?
Because most production Claude workloads are extraction, classification, or review, and all three live or die on two things: whether the criteria are specific enough to be applied consistently, and whether the output is structurally reliable enough to be parsed. The blueprint gives Domain 4 a fifth of the exam because these decisions are made on every project, and because the failure modes (hallucinated required fields, divergent retries, self-review that finds nothing) are expensive and common. On a 60-question form that is about 12 questions (confirm the current weights on the official Anthropic / Pearson VUE page before you register).
The concepts you must know cold
Vague words sample from many valid interpretations. “Be conservative” gets 47% inter-run agreement; “flag when methodology lacks a sample size or control group” gets 94%. Severity labels need text conditions plus code examples (Labels Alone: 41%. Text Conditions: 72%. Text + Code Examples: 94%.). And one noisy category can make developers ignore an otherwise accurate reviewer (One 60% False Positive Category Made Developers Ignore the 95% Accurate One).
Few-shot is calibration, not decoration. Three diverse examples beat eight similar ones (Three Diverse Examples Beat Eight Homogeneous Ones). If every example shows all fields populated, the model fabricates missing ones (Every Example Shows All Fields Populated — So the Model Fabricates Missing Ones). Pair REPORT and SKIP examples to teach the boundary (Paired REPORT + SKIP Examples: 67% → 94% Boundary Accuracy).
tool_use guarantees shape, not truth. A forced tool call always returns valid JSON against the schema; it can still be wrong. Know the three tool_choice guarantees (Forced, Any, Auto — Three Modes, Three Guarantees, Three Failure Patterns): forced for single-schema pipelines, any for multi-schema pipelines that must always produce structure, auto only when some inputs legitimately produce text.
Required fields on optional data cause hallucination. If warranty_expiry is required and the document has none, the model invents one. Make it ["string","null"] and drop it from required (Required Fields on Optional Data: The #1 Structural Cause of Hallucination). Closed enums stop the same date arriving three ways (Without Format Rules, the Same Date Comes Out Three Different Ways).
Classify errors before retrying. Format errors converge with corrective feedback; absent-data errors diverge (a different fabricated value each retry). Retry the first kind with the specific error message; accept null for the second (Retrying Absent Data Causes Hallucination). Add cross-field checks the schema cannot express, such as line items summing to the total (Schema Says Valid. Line Items Don’t Sum to Total. Both Are True.).
Batch is a cost lever with a latency price. Roughly half price, up to 24 hours, no multi-turn tool calling, results in arbitrary order so custom_id is the only correlation (Results Return in Arbitrary Order — custom_id Is Your Only Correlation). Resubmit only the failed items, and inspect why they failed first (940 Succeeded, 45 Errored, 15 Expired — Resubmit Only the 60).
Self-review in the same session barely reviews. The generation reasoning is still in context, so the model defends its own choices. Independent instances with only the artifact and the criteria approach human-level finding counts (Single-Pass Review at 13+ Files: 43% Detection. Multi-Pass: 86%.).
How does the exam test Domain 4?
Expect an extraction or review pipeline, a measured symptom, and four fixes. Common shapes:
- “The same document is rated high quality on one run and low on the next.” (Vague criteria; replace with verifiable conditions.)
- “The model returns text instead of calling the extraction tool about one time in eight.” (
tool_choice: auto; switch toanyor a forced tool.) - “PO numbers are present in output for documents that have no PO number.” (Required field on optional data; make it nullable, and stop retrying it.)
- “Retrying with ‘try again’ fixes 12% of failures.” (Feed back the specific validation error instead.)
- “Nightly classification of 50,000 documents is too expensive.” (Batch API, budget the full 24 hours, test on a sample first per Always Test on a Sample Before Full Batch.)
- “Asking Claude to review its own code strictly finds almost nothing.” (Independent review instance.)
Worked scenario: extracting warranty data from support emails
Setup. A pipeline extracts customer_name, order_id, issue_category, and warranty_expiry from inbound emails using a forced tool call. All four fields are required strings. About a third of emails never mention a warranty. Downstream, 82% of the warranty_expiry values for those emails are dates that appear nowhere in the source. An engineer proposes adding “if there is no warranty date, write N/A” to the prompt and retrying up to three times when validation fails.
Options.
A. Add the N/A instruction and the retry loop as proposed.
B. Add two few-shot examples showing warranty_expiry: null while keeping the schema unchanged.
C. Change warranty_expiry to ["string","null"], remove it from required, keep the forced tool call, and classify validation failures so absent-data cases are accepted as null rather than retried.
D. Switch to tool_choice: auto so the model can decline to answer when data is missing.
Reasoning. A and B both fight the schema with the prompt, and the schema wins: a required string field cannot hold null or N/A, so the model fabricates. D breaks the pipeline’s structural guarantee for every email to solve a problem in one field. C fixes the cause at the schema layer and stops the retry loop from turning missing data into invented data. C is the least bad option, and it is exactly the sequence in the nullable-fields article and the retry-classification article.
Common traps in Domain 4 questions
- Trusting emphasis. “You MUST return valid JSON” is still a prompt. If the option list includes a schema mechanism, that is usually the answer.
- Treating well-formed as correct. Passing the schema is step one; cross-field and business-rule validation is step two.
- Choosing many similar examples. Volume of examples is not the lever; diversity and boundary coverage are.
- Escalating retries on missing data. Each retry that says “the PO number MUST exist” increases fabrication.
- Assuming batch is drop-in. No multi-turn tool use, arbitrary result order, up to a day of latency, results expire (Poll, Download, Store Locally — Results Expire in 29 Days).
- Forcing minimum finding counts in review. The model invents issues to hit the quota. Fix the architecture (independent instance, per-file plus cross-file passes) instead (Even Design Goals from the Generation Prompt Suppress Review Findings).
- Confusing Domain 4 with Domain 5 confidence questions. Domain 4 uses confidence to route findings and add SKIP examples (Track Which Patterns Developers Dismiss — Then Add SKIP Examples); Domain 5 tests whether the number is calibrated at all.
Next step
Read the six anchor articles, then run the Domain 4 practice questions and pay attention to which layer each correct answer lives in: prompt, schema, or code. When your accuracy is steady, sit the free CCA-F mock exam. The full list of Domain 4 articles is on the Domain 4 study guide page, and the study-order companion is CCA Study Tips for Domain 4.
Frequently asked questions
How many CCA-F questions come from Domain 4?
expand_more
Domain 4 is weighted at 20%, about 12 questions on a 60-question form. Confirm the current blueprint on the official Anthropic / Pearson VUE page before you register.
Does Domain 4 test XML tags and chain-of-thought phrasing?
expand_more
Only lightly. The blueprint focuses on measurable outcomes: specific criteria, few-shot design, schema enforcement through tool_use, retry policy, and batch processing. Formatting tricks matter less than knowing what a prompt can and cannot guarantee.
Is the Batch API really part of a prompt engineering domain?
expand_more
Yes. Task 4.5 covers when to use the Message Batches API, custom_id correlation, and partial-failure handling, because it is the main cost lever for large structured-extraction workloads.
Put it into practice
Take the free 60-question Claude Certified Architect mock exam, or work through the CCA-F study guide domain by domain.
Certified Architect is an independent, community-built study site. Exam facts reflect public Anthropic / Pearson VUE information and can change — always confirm on the official pages before registering.