Courseiva

CCAO-F Prompting and Context Engineering Practice Question

Exhibit

{
  "model": "claude-3-5-sonnet-20240620",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "<documents>\n<doc index='1'>The fiscal year ends in June.</doc>\n<doc index='2'>The budget is $5M.</doc>\n</documents>\nAnswer the question using the docs: When does the year end?"
        }
      ]
    }
  ]
}

Refer to the exhibit. Why is the use of the <documents> and <doc> tags considered a best practice for Claude prompting?

⚠ Common exam trap

Candidates often treat XML tags merely as cosmetic styling rather than recognizing them as structural boundaries that prevent the model from confusing data with instructions.

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

✓

It improves the model's ability to distinguish context from instructions.

Claude is specifically trained to recognize and utilize XML tags for structural organization. These tags help the model delineate between instructions, metadata, and actual content. In complex prompts, this separation reduces the likelihood of the model misinterpreting data as instructions, thereby increasing the reliability and accuracy of the generated responses.

Answer analysis

Option-by-option breakdown

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

  • ✗

    It is a requirement of the JSON schema for the Messages API.

    Why it's wrong here

    The Messages API requires a specific JSON structure for the 'messages' array, but it does not mandate the use of XML tags within the text content itself. XML tags are a prompting technique for the model's benefit, not a strict schema requirement for the API transport layer.

  • ✗

    It enables Claude to parse the content as a valid XML object.

    Why it's wrong here

    While Claude can recognize the structure, it does not 'parse' it in the way a traditional XML parser would. Instead, it uses the tags as visual and semantic markers to understand the relationship between different blocks of text, helping it identify where one document ends and another begins.

  • ✓

    It improves the model's ability to distinguish context from instructions.

    Why this is correct

    Using XML tags creates a clear visual and logical boundary between the input data and the user's question. This allows Claude to focus its attention mechanism more effectively on the relevant sections of the prompt, reducing the chances of confusing the content of the documents with the task.

  • ✗

    It automatically bypasses the model's safety filters for large data.

    Why it's wrong here

    XML tags have no impact on the model's safety filters or content moderation systems. Safety filters operate independently of the prompt's formatting structure, and using tags will not allow a user to circumvent the core safety training or guardrails implemented by Anthropic.

About these practice questions

Courseiva writes every CCAO-F question from scratch — 259 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 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.