Skip to content
CertLabs

CCAR-F

Prompt design and structured output: define useful results

Key takeaways

  • Specify what a correct result must mean before choosing its format.
  • Distinguish schema conformance from factual correctness.
  • Test ambiguous, missing, and contradictory inputs.

Use structure for a defined purpose

Claude’s structured outputs documentation explains constrained JSON output and strict tool inputs. A result matching a schema can still contain an incorrect interpretation of the source. Define the required meaning as well as the data shape. Check the current documentation for supported models, schema features, and exceptional responses.

Exercise: extract an appointment request

Use three synthetic messages: one with a complete appointment request, one missing a date, and one containing conflicting dates. Define a result with separate fields for the requested details, missing information, and the evidence used. Decide which fields may be null and when the application should ask a follow-up question.

Write expected results before testing. A schema that requires every field may encourage an application to accept invented values if it has no explicit representation for missing information. Compare your output contract with the actual decisions the receiving application needs to make.

Build a small evaluation set

Anthropic’s evaluation guidance recommends defining success criteria and evaluating representative cases. For this exercise, score field correctness separately from valid JSON. Add near-matches, irrelevant text, and instructions embedded inside the input document. Keep the task instruction and source data distinct.

Change one part of your prompt, then rerun the same examples. Look for regressions as well as improvements. Save the failed cases and explain why the new wording changed behavior.

Put the concepts into practiceReview course access

Connect output to action

Before a downstream system acts on an extracted result, decide what it must validate independently. For an appointment, that might include whether the requested time exists in the service’s calendar and whether the caller may book it. Treat the model’s output as input to that process. Finish by explaining why a perfectly formatted answer can still be unsuitable for execution.

Sources and review

Source links checked 2026-10-10. These exercises are independent CertLabs preparation, not official exam questions or a prediction of passing.

Continue exploring