CCAR-F prompting and structured output (20%)

Updated December 2, 2026

Domain 4 of CCAR-F, Prompt Engineering & Structured Output, is worth 20% of the exam. It is about getting precise, consistent, machine-readable output and judging the cost and quality trade-offs of different API patterns. Anthropic’s exam guide lists six task statements, summarised here in my own words.

The six task statements

TaskTopic
4.1Explicit criteria to improve precision and cut false positives
4.2Few-shot prompting for consistency
4.3Structured output with tool use and JSON schemas
4.4Validation, retry and feedback loops
4.5Efficient batch processing
4.6Multi-instance and multi-pass review

Explicit criteria

Vague instructions such as check that comments are accurate produce noisy output. The guide prefers specific categories: flag a comment only when the claimed behaviour contradicts the code. General cautions like be conservative, or report only high-confidence findings, do not improve precision as much as categorical criteria do. High false-positive categories undermine trust in the accurate ones, so you can temporarily disable a noisy category while you fix it. Define severity levels with concrete code examples so classification is consistent.

Few-shot examples

Few-shot examples are described as the most effective technique when instructions alone give inconsistent results. Use two to four targeted examples for ambiguous cases, showing why one action was chosen over plausible alternatives, and demonstrate the output format you want (location, issue, severity, fix). They help the model generalise judgement to new patterns, separate acceptable code from real problems, handle varied document structures, and reduce empty or fabricated extractions.

Structured output with tool use

Tool use with a JSON schema is the most reliable route to schema-compliant output; it removes syntax errors. It does not remove semantic errors, such as line items that do not add up to the total or a value in the wrong field. Design the schema carefully: make fields optional or nullable when the source may lack them, so the model is not pushed to invent values; add an unclear enum value for ambiguity; use an other value plus a detail string for extensible categories; and include format normalisation rules in the prompt. Use tool_choice any when the document type is unknown and several extraction tools exist, and a forced tool when one extraction must run first.

Validation and retry

Retry with error feedback: send the original document, the failed extraction and the specific validation error. This fixes format and structural mismatches. It does not help when the information is simply absent from the source, for example if it lives in an external document you did not supply. Extract both a calculated total and a stated total to flag discrepancies, add a conflict_detected flag for inconsistent sources, and record a detected_pattern field so you can analyse dismissed findings.

Batch processing

The Message Batches API gives a 50% cost saving and a processing window of up to 24 hours with no guaranteed latency SLA; Anthropic’s batch documentation describes the 50 percent cost reduction and says most batches finish in under an hour. It suits latency-tolerant work like overnight reports or weekly audits and is wrong for blocking checks such as pre-merge review. It does not support multi-turn tool calling within one request. Use custom_id to correlate results, resubmit only failed items (for example after chunking oversized documents), and refine prompts on a small sample before a big batch. Expect questions that ask you to compute submission frequency from an SLA.

Multi-pass review

A model that generated code keeps its reasoning context and is less likely to question itself, so an independent instance without that context catches more. Split big reviews into per-file local passes plus a cross-file integration pass to avoid attention dilution and contradictory findings. A verification pass where the model reports confidence per finding can route review effort.

Three sample questions

Question 1. Your extraction prompt returns dates in many formats and the model sometimes lists the field as missing when the date is written in words. What is the most effective improvement?

  • A. Add a few targeted examples showing extraction from differently formatted dates, plus a normalisation rule
  • B. Move the work to the Batches API
  • C. Retry every request three times
  • D. Remove the date field from the schema
Show answer

Answer: A

Few-shot examples of varied source formats show the model how to extract and normalise correctly, which addresses both the format variety and the missed fields. A larger batch, forcing a retry loop on every call or deleting the field does not teach the model the variety.

Want more questions like this? Full CCAR-F practice tests →

Question 2. A model wrote a code change in a session and is then asked in the same session to review it, but it approves everything. What design gives a better review?

  • A. Ask the same session to review more carefully
  • B. Enable extended thinking in the same session
  • C. Run the review in a separate Claude instance that has not seen the generation reasoning
  • D. Add a longer checklist to the same session
Show answer

Answer: C

An independent instance without the generator’s reasoning context is more effective at catching subtle issues. Asking the same session to think harder or enabling extended thinking keeps that context, and a longer prompt does not remove it.

Want more questions like this? Full CCAR-F practice tests →

Question 3. An invoice extraction fails validation because a date arrived as text instead of an ISO format. Another fails because the purchase order number is only in a separate attachment you did not send. Which statement is correct?

  • A. Both will be fixed by retrying
  • B. Neither can be fixed by retrying
  • C. Only the missing number will be fixed by retrying
  • D. The date failure is likely to be fixed by retry with the error; the missing number is not, unless the attachment is supplied
Show answer

Answer: D

Retry with specific error feedback can fix format mismatches, but retries cannot produce information that is absent from the supplied source. So the date failure is likely to succeed on retry and the missing number is not, unless you supply the attachment.

Want more questions like this? Full CCAR-F practice tests →

Practice

Do the guide’s Exercise 3 end to end, including a 100-document batch and a failed-item resubmission. Then read Context management and reliability and use the practice test.