Courseiva

CCAR-F Prompt Engineering and Structured Output Practice Question

An architect is designing a prompt that asks Claude to analyze a contract and return a risk rating plus supporting clauses. The response must be machine-readable and include a confidence score. Which design most reliably produces both a rating and a confidence score in a single response?

⚠ Common exam trap

The trap here is assuming that a well-crafted JSON instruction or example guarantees both fields, when only a schema with required properties enforces their presence.

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

✓

Define a tool with an 'input_schema' containing required 'rating' and 'confidence' properties and force tool use.

A tool definition with an 'input_schema' that marks 'rating' and 'confidence' as required, combined with forced tool use, guarantees both fields appear in a single structured tool call. This keeps the rating and its confidence score aligned and eliminates parsing ambiguity. Few-shot examples and prose instructions only influence behavior and cannot enforce required fields.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Include a few-shot example showing a JSON object with both keys and ask Claude to follow it exactly.

    Why it's wrong here

    Few-shot examples improve consistency but do not enforce that both keys are present in every response. Claude might still omit 'confidence' when it is uncertain. Examples are guidance, not a contract, so a parser relying on both fields could fail intermittently, making this less reliable than schema-enforced tool use.

  • ✓

    Define a tool with an 'input_schema' containing required 'rating' and 'confidence' properties and force tool use.

    Why this is correct

    A tool 'input_schema' with both properties marked required and tool use forced ensures Claude returns a tool call containing both values. The schema mechanically enforces presence and type, so the application receives a single structured object with rating and confidence together. This is the most reliable way to get both fields in one response.

  • ✗

    Ask for a JSON object with 'rating' and 'confidence' keys and parse the text response.

    Why it's wrong here

    Requesting JSON in prose does not guarantee that Claude will include both keys or valid JSON. The model might omit 'confidence' or add commentary. Without schema enforcement, the parser must handle missing fields and malformed output, making this approach fragile for a production contract analysis pipeline that depends on both values.

  • ✗

    Use two separate prompts: one for rating and one for confidence, then merge the results.

    Why it's wrong here

    Splitting into two prompts doubles latency and cost, and the confidence score may not correspond to the same analysis that produced the rating. It also introduces consistency issues if the contract is interpreted differently across calls. A single structured response keeps rating and confidence aligned and is more efficient than orchestrating two model calls.

About these practice questions

This CCAR-F question is part of Courseiva's 271-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 →

How Courseiva writes practice questions · Editorial policy

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.