CCAR-F Prompt Engineering and Structured Output Practice Question
You are using the Anthropic Claude API in a customer-support application. Your prompt asks Claude to classify each incoming ticket into exactly one of four categories and return the result. Occasionally, Claude adds a friendly sentence before the category, which breaks your parser. Which change most directly prevents this extra text?
⚠ Common exam trap
The trap here is assuming that lowering temperature or adding a strict system prompt will guarantee a clean output format, when only controlling the assistant turn directly prevents leading text.
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
✓
Add a prefill to the assistant turn, such as an opening XML tag, so the response continues from that point.
Prefilling the assistant turn is the most direct control over the start of the response. By beginning the assistant message with the exact tag or token that should open the answer, the model is forced to continue from there, eliminating any preamble. Temperature and max_tokens affect randomness and length, not format, and a friendly system persona does not enforce structure.
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 max_tokens value so the model has room to output the category.
Why it's wrong here
max_tokens caps the length of the response; it does not shape what the model writes. Raising it may allow a longer answer, but the model could still include a greeting before the category. The problem here is instruction-following and output framing, not truncation. This parameter is irrelevant to preventing extra text in the response.
- ✗
Set the temperature parameter to 0.0 in the API request.
Why it's wrong here
Temperature controls randomness in token selection, not output format. Even at 0.0, Claude can still prepend a conversational sentence if the prompt permits it. The model follows the instructions it is given, so lowering temperature does not guarantee a bare category string. This setting is useful for consistency but does not by itself enforce a strict output shape in this scenario.
- ✗
Add a system prompt that says 'You are a helpful assistant for a support team.'
Why it's wrong here
A generic helpfulness persona does not constrain output format. In fact, it may encourage the model to be conversational and add pleasantries. The scenario needs a strict structural constraint, not a role description. This change would likely make the extra-text problem worse rather than solving it.
- ✓
Add a prefill to the assistant turn, such as an opening XML tag, so the response continues from that point.
Why this is correct
Prefilling the assistant turn with an opening tag or a fixed prefix forces the model to continue from that exact point, which suppresses conversational preamble. In this scenario, starting the assistant message with the tag that should wrap the category prevents any friendly sentence from appearing first. This is a direct, reliable way to control the beginning of the output.
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 →
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.