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?
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.
Why this answer
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.
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.