CCAR-F Prompt Engineering and Structured Output Practice Question
An engineering team is building a Claude-powered contract analyzer that must return a JSON object with a 'parties' array, an 'effective_date' string, and a 'governing_law' string. Legal reviewers report that for about one in twenty contracts, the model invents a governing law when the contract is silent. The team wants to stop fabricated values without losing valid extractions. Which approach best addresses this?
⚠ Common exam trap
The trap here is assuming the model will stay silent when a field is absent, when a schema that names the field effectively pressures it to produce a plausible value rather than admit the document is silent.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Instruct Claude to set 'governing_law' to null when the contract does not state one, and include a few-shot example of a silent contract returning null.
Fabricated values appear when the requested schema implies every field must be populated and the model has no sanctioned way to report absence. Explicitly allowing null for missing fields, paired with a few-shot example of a silent contract, gives the model a correct representation for gaps. Rejecting documents, raising temperature, or inferring from jurisdiction knowledge all either discard good data or amplify invention instead of eliminating it.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the model's temperature so it considers more possible governing laws and picks the most probable one.
Why it's wrong here
Higher temperature encourages the model to generate plausible alternatives, which is precisely how fabricated laws are produced. The problem is that a value is being invented at all, not that the wrong candidate is chosen. Raising temperature would likely increase the fabrication rate rather than reduce it, and it does nothing to signal that absence is acceptable.
- ✗
Ask Claude to search its training knowledge for the governing law typically used in the contract's jurisdiction and fill that in.
Why it's wrong here
Inferring a governing law from general jurisdiction knowledge substitutes an assumption for what the document actually says. Legal review requires the extracted value to reflect the contract text, so a plausible-but-unstated law is exactly the fabrication the team wants to eliminate. This approach makes the output look complete while being factually unsupported.
- ✓
Instruct Claude to set 'governing_law' to null when the contract does not state one, and include a few-shot example of a silent contract returning null.
Why this is correct
Fabrication occurs because the schema implies a value is always expected, so the model fills the gap. Explicitly permitting null for absent fields, plus an example showing a silent contract yielding null, gives the model a legitimate way to represent missing data and teaches it when to use that path. This preserves valid extractions while eliminating invented governing laws.
- ✗
Add a rule that any contract without a governing law clause should be rejected and returned to the legal team for manual review.
Why it's wrong here
Rejecting silent contracts removes the fabrication but also discards the parties and effective date that the model can still extract correctly. It shifts a large volume of routine work back to reviewers and does not improve the model's ability to represent absence. The goal is accurate extraction with honest gaps, not blanket rejection.
About these practice questions
Courseiva writes every CCAR-F question from scratch — 271 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCAR-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCAR-F exam.