Courseiva

CCAR-F Prompt Engineering and Structured Output Practice Question

When prompting Claude to process a large document and perform multiple tasks like summarization and sentiment analysis, what is the recommended way to separate the source text from the instructions?

⚠ Common exam trap

Candidates frequently rely on markdown headers or blank lines to separate text, missing the structural delimiters that the model is specifically trained to parse reliably.

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

✓

Enclosing the source text in XML tags like <document>.

Using XML tags is a core best practice for Claude as it provides clear structural boundaries that the model is specifically trained to recognize. This prevents instruction leakage, where the model might confuse the content of the source document with the prompt instructions, ensuring that the output remains focused on the requested tasks.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Using Markdown headers like #Source and #Task.

    Why it's wrong here

    While Claude understands Markdown, it is not as robust as XML for creating strict structural boundaries in complex prompts. Markdown headers can sometimes be misinterpreted as part of the document content, especially if the source text itself contains similar headers, leading to potential confusion during task execution.

  • ✓

    Enclosing the source text in XML tags like <document>.

    Why this is correct

    Anthropic models are highly optimized to parse and respect XML tags as delimiters. Using tags like <document> and <instructions> creates a clear hierarchy, allowing Claude to distinguish between the data it must process and the commands it must follow, which significantly improves overall task accuracy.

  • ✗

    Separating sections with several empty newline characters.

    Why it's wrong here

    Newlines provide visual separation for humans but are often insufficient for the model to reliably distinguish between different prompt components. In long-context scenarios, the model may fail to identify where the document ends and the next set of instructions begins, increasing the risk of instruction following errors.

  • ✗

    Indenting the source text by four spaces.

    Why it's wrong here

    Indentation is typically interpreted as a code block or a formatting style rather than a structural delimiter. Relying on indentation to separate inputs is unreliable and can interfere with how the model processes the text content, particularly if the source document is a technical or code-heavy file.

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.