Courseiva
Claude API Mechanics →hardMultiple Choice

CCDV-F Claude API Mechanics Practice Question

An application needs to ensure that Claude never uses its pre-trained knowledge to answer questions, but only uses the provided context. After placing instructions in the system prompt, the developer still sees Claude occasionally using outside info. What is the most effective API-level mechanical adjustment to further constrain Claude?

⚠ Common exam trap

Candidates over-rely on system prompts for strict grounding, failing to realize that pre-filling the assistant response is a more effective mechanical constraint to prevent the model from hallucinating.

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

✓

Use pre-filling by ending the 'messages' array with an 'assistant' message like 'Based ONLY on the context provided, I will answer...'

While system prompts are the primary way to give instructions, pre-filling the assistant's response is a more forceful mechanical constraint. By starting the assistant's response with a specific phrase, you lock the model into a particular persona or logical path, making it much harder for the model to deviate into its default behaviors or general knowledge.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Set 'temperature' to 1.0 to encourage more creative following of the system instructions.

    Why it's wrong here

    Increasing temperature increases randomness and 'creativity', which is the opposite of what is needed here. Higher temperature makes it *more* likely that the model will hallucinate or pull in outside information, as it explores less probable token paths that might include its general training data.

  • ✓

    Use pre-filling by ending the 'messages' array with an 'assistant' message like 'Based ONLY on the context provided, I will answer...'

    Why this is correct

    Pre-filling the assistant response is the strongest way to guide Claude. By starting its response with a commitment to use only the provided context, the model's internal attention mechanism is heavily weighted towards that constraint for the remainder of the generation, significantly reducing the likelihood of outside knowledge leakage.

  • ✗

    Increase the 'top_p' value to 1.0 to ensure all possible valid answers are considered.

    Why it's wrong here

    Setting 'top_p' to 1.0 (the default) allows the model to consider all tokens that make up the cumulative probability. This does not help with constraint following; if anything, lowering 'top_p' might help by cutting off the 'long tail' of less likely (and potentially outside-knowledge) tokens.

  • ✗

    Add a 'stop_sequence' for the word 'I' to prevent the model from speaking in the first person.

    Why it's wrong here

    This is an arbitrary constraint that does not address the core issue of knowledge leakage. Stopping at the word 'I' would simply break the model's ability to form sentences, leading to truncated and useless responses without actually forcing the model to stick to the provided context or documents.

About these practice questions

Courseiva writes every CCDV-F question from scratch — 257 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 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.