Courseiva

CCDV-F Prompt and Context Engineering Practice Question

A developer needs Claude to analyze a legal document and extract specific clauses into a structured format. To ensure the model focuses only on the provided text and ignores its general knowledge of law, which prompting strategy is most effective?

⚠ Common exam trap

Candidates often paste text directly into the prompt without delimiters, causing the model to conflate its general knowledge with the provided text, leading to high rates of hallucination.

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

✓

Wrapping the document in <document> tags and using a system prompt to define the extraction rules.

Isolating input data using XML tags like <document> allows Claude to clearly distinguish between the instructions and the content being processed. This structural separation reduces the likelihood of the model hallucinating external information or conflating instructions with the text body, which is critical for high-stakes document analysis where accuracy is more important than creative interpretation.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Placing the document content at the very end of the prompt after all instructions.

    Why it's wrong here

    While placing data at the end can help with recency bias, it does not provide the structural clarity needed for complex extraction. Without clear delimiters, Claude may struggle to identify exactly where the instructions stop and the data begins, potentially leading to the inclusion of instructional text in the extracted results.

  • ✓

    Wrapping the document in <document> tags and using a system prompt to define the extraction rules.

    Why this is correct

    This combination leverages the system prompt for foundational constraints and XML tags for data encapsulation. This architecture is the recommended best practice for Claude because it creates a clear hierarchy of information, ensuring the model treats the tagged content as an object to be acted upon rather than a source of truth.

  • ✗

    Increasing the temperature setting to 1.0 to ensure the model captures nuanced legal language.

    Why it's wrong here

    High temperature increases randomness and the likelihood of the model deviating from the provided text. For extraction tasks where grounding is required, a lower temperature near 0.0 is preferred to ensure deterministic and faithful output. Raising temperature would likely introduce hallucinations or external legal knowledge not present in the source.

  • ✗

    Using a few-shot approach with examples of general legal documents not related to the current task.

    Why it's wrong here

    Few-shot prompting is powerful, but using unrelated examples can confuse the model regarding the specific domain or format required. Examples should always be representative of the actual task at hand. Providing irrelevant legal context may actually encourage the model to hallucinate or apply incorrect patterns from those unrelated examples.

About these practice questions

This CCDV-F question is part of Courseiva's 257-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 CCDV-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 CCDV-F exam.