CCAO-F Prompting and Context Engineering Practice Question
Exhibit
{
"model": "claude-3-5-sonnet-20240620",
"system": "You are a data analyst.",
"messages": [
{"role": "user", "content": "Summarize the following: <data>...</data>"}
],
"max_tokens": 1024,
"temperature": 0.7
}Refer to the exhibit. The developer notices the model often hallucinates data not present in the <data> tags. Which adjustment is most likely to mitigate this behavior?
⚠ Common exam trap
Candidates often select answers that rely solely on few-shot examples inside the user message, failing to recognize that system-level constraints are far more effective for enforcing strict source-grounding behavior.
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 an explicit instruction in the system prompt to only use information contained within the <data> tags.
Adding a strong negative constraint to the system prompt, such as 'If the information is not present in the provided <data>, state that you do not have sufficient information,' directly addresses hallucination. This forces the model to prioritize factual grounding over generative completion. In production systems, explicit constraints about the source material are essential for maintaining the integrity of data processing workflows and preventing the propagation of false information.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Reduce the temperature to 0.0 to make the model's output more deterministic.
Why it's wrong here
While reducing temperature makes the model more deterministic, it does not inherently prevent hallucinations if the model is still prone to filling in gaps. A lower temperature might result in the same wrong answer consistently rather than preventing the model from making up data in the first place.
- ✓
Add an explicit instruction in the system prompt to only use information contained within the <data> tags.
Why this is correct
Explicitly grounding the model's response within the provided XML tags creates a clear boundary for the model's knowledge. By setting a strict rule that it must only use the provided context, you significantly reduce the likelihood of the model pulling from its pre-training data during generation.
- ✗
Increase the max_tokens to ensure the model has enough room to explain its reasoning.
Why it's wrong here
Increasing the token limit provides more room for output but does not change the model's grounding behavior. If the model is already hallucinating, giving it more output space simply allows it to generate longer, more detailed hallucinations, which can be even more misleading in a production environment.
- ✗
Change the model to an older version that is less prone to creative generation.
Why it's wrong here
Modern Claude models are significantly more capable and better at following complex instructions than older versions. Attempting to use older models typically results in worse adherence to prompt constraints and weaker reasoning, making it harder to control the model's behavior rather than solving the hallucination problem effectively.
About these practice questions
One of 259 original CCAO-F practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.