CCAO-F Prompting and Context Engineering Practice Question
A team is designing a Claude prompt that must return a fixed JSON schema with fields "vendor", "amount", and "currency". They want the output to be reliably parseable by downstream code. Which TWO techniques best improve reliability of the structured output? (Choose two.)
⚠ Common exam trap
The trap here is treating natural-language explanation or dynamic field selection as helpful when both undermine the fixed, machine-parseable contract the scenario requires.
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
✓
Use a prefilled assistant turn that begins the JSON, so Claude continues from a known starting point.
Reliable structured output comes from constraining the response shape on two fronts: telling Claude exactly what schema to produce, and preventing it from starting with prose. An explicit schema or example JSON defines the contract, while prefilling the assistant turn with the opening of the JSON forces the model to continue in that format. Together they minimize drift and make downstream parsing dependable, unlike loosening sampling or inviting commentary.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use a prefilled assistant turn that begins the JSON, so Claude continues from a known starting point.
Why this is correct
Prefilling the assistant turn with the opening of the JSON, such as an opening brace or the first key, constrains Claude to continue in that format rather than starting with prose. It is a well-known technique for enforcing output shape in the Claude Messages API. Combined with an explicit schema, it makes the response reliably parseable.
- ✗
Set temperature to its maximum so Claude considers many possible JSON layouts.
Why it's wrong here
Maximum temperature increases variability, which is the opposite of what structured extraction needs. It raises the chance of inconsistent keys, extra fields, or malformed JSON. Reliability comes from constraining the output shape, not from encouraging creative variation. For fixed-schema extraction, low or zero temperature is generally preferable.
- ✓
Provide an explicit schema or example JSON in the prompt and instruct Claude to return only JSON matching it.
Why this is correct
Showing the exact target shape, whether as a schema description or a concrete example, gives Claude an unambiguous contract for field names, types, and nesting. Combined with an instruction to emit only that JSON, it sharply reduces stray prose and key drift. This is a core technique for reliable structured extraction in Claude prompts and directly supports downstream parsing.
- ✗
Precede the JSON with a short natural-language explanation so a human can verify the result.
Why it's wrong here
Adding prose before the JSON makes the response harder to parse automatically and can encourage Claude to include commentary inside or around the object. If human review is needed, it is better handled outside the machine-parsed payload. For reliable structured output, the goal is to minimize non-JSON content, not to invite it.
- ✗
Ask Claude to decide at runtime which fields are most relevant and include only those.
Why it's wrong here
Allowing Claude to choose fields breaks the fixed schema the downstream code expects. The scenario requires exactly "vendor", "amount", and "currency" every time. Making field selection dynamic introduces missing or renamed keys and defeats the purpose of a stable contract. The schema should be fixed by the prompt, not negotiated by the model per call.
About these practice questions
This CCAO-F question is part of Courseiva's 259-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 CCAO-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 CCAO-F exam.