Courseiva

CCDV-F Prompt and Context Engineering Practice Question

You are building a support-triage assistant on the Anthropic API. Each request must return a JSON object with keys 'category' and 'priority'. During testing, Claude wraps its output in markdown fences and adds a friendly sentence before the JSON. You want the raw, parseable object every time without changing the model or adding a second call. What is the most reliable prompt-level change?

⚠ Common exam trap

The trap here is assuming a stronger wording in the system prompt reliably suppresses markdown fences and preamble, when only constraining the assistant turn guarantees the object starts immediately.

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

✓

Pre-fill the assistant turn with an opening brace so the response must continue as the JSON object.

Constraining the assistant turn with a leading brace forces continuation as the JSON object, since the model must complete the already-started structure. This removes markdown fences and conversational preamble in a single call, with no model change. Instruction-only or explanation-first approaches leave room for stray text, so prefilling is the most reliable prompt-level fix for guaranteed parseable output.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Ask Claude to explain its reasoning first, then append the JSON at the end of the response.

    Why it's wrong here

    Requesting reasoning before the object guarantees extra text precedes the JSON, which is the opposite of what the scenario needs. Even if the JSON is valid at the end, the parser must strip reasoning, and the model may still fence the block. This adds tokens and complexity without delivering the raw, immediately parseable object.

  • ✗

    Add the sentence 'Please output only JSON' to the system prompt and rely on that instruction alone.

    Why it's wrong here

    A polite instruction helps but is not deterministic; Claude may still add a friendly sentence or fences, especially across varied inputs. The scenario needs the raw object every time without a second call. Instruction-only steering leaves residual risk of unparseable output, so it does not meet the reliability requirement as strongly as constraining the assistant turn.

  • ✓

    Pre-fill the assistant turn with an opening brace so the response must continue as the JSON object.

    Why this is correct

    Prefilling the assistant turn with the opening brace constrains generation to continue the JSON object rather than emit prose or fences, because the model continues from the supplied text. This directly eliminates preamble and markdown wrappers, giving parseable output in one call. It is a prompt-level control with no model change, exactly matching the requirement.

  • ✗

    Increase the temperature setting so the model has more freedom to choose a clean format.

    Why it's wrong here

    Raising temperature increases randomness and makes formatting less consistent, not more. The model already understands JSON; the issue is that it chooses to add prose and fences. Higher temperature would make stray sentences and malformed structures more likely, worsening parsing failures rather than producing the raw object the scenario demands.

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.