beginner
Assistant prefill is gone: what replaces it
Quick answer:
A trailing assistant turn was the cheapest way to tell the model how its answer had to begin. You cannot do it any more: it is an API error now, not a style preference.
What shipped
Anthropic. Prefill stops being supported on Claude Opus 4.6 and does not come back later in the line. Fable 5 and Mythos 5, on 9 June 2026, reject it with 400; Sonnet 5, on 30 June, and Haiku 5.5, on 7 October, reject it too. What Anthropic documents instead is structured outputs, or strict tool use when the output goes through a tool.
Google. From 21 July 2026, with Gemini 3.6 Flash: if the last non-empty turn in the request is a model turn, the API returns 400. The Gemini 3.8 migration checklist repeats it among the things to remove. Google names the two usual reasons —suppressing preambles and forcing JSON— and sends both to system_instruction or to structured outputs.
The failure is the same shape at both vendors: the request is malformed, not the answer. A prompt that ends in Assistant: { or in "Sure, here is the JSON:" is no longer a prompt that performs worse. It is a prompt that does not run.
What changes about reasoning
Prefill was a formatting trick with a guarantee inside it: the answer began with exactly the string you had written. That one property did three jobs at once — dropping the preamble, imposing a format, and starting the answer in the voice you wanted.
None of the three was a property of the turn. They were three output-contract problems, and a contract can be declared before the model writes, which is what the system instruction and the request schema do.
The second consequence takes longer to notice. The conversation is a strict alternation again, the last word in the request belongs to the user, and the model's turn is not yours to start. The style trick survives; the mechanism that made it reliable does not.
What changes about writing prompts
Three replacements, in the order you will need them.
A system instruction carrying the explicit rule. It is the route Google documents for the preamble and for JSON:
text
system_instruction:
Answer only with the JSON object the schema asks for. Write no
preamble, do not restate the question, and do not close with a
courtesy line.
Structured outputs, or strict tool use when the output is a tool call. The schema goes in the request and the model cannot return another shape. This is what both vendors document, and it is the only one of the three replacements that gives a guarantee close to the one prefill gave.
The opening written as text inside the user turn. It still works, because it is ordinary text and not an API turn: you put the beginning of the answer in the message itself and the model continues. Google's prompting page still ships these examples, labelled (gemini-2.5-flash). It buys you the shape, not the guarantee.
And the three replacements do not weigh the same. The first two are request-level controls and the third is a text instruction: the model can ignore it, the same way it ignored a badly asked preamble. Migrating is not swapping one line for another: it is deciding which part of the format has to be guaranteed and which part can stay a request.
What you stop doing
- Sending a prompt that ends in a
modelorassistantturn. It is the first thing to look at when migrating: not the text of the last message, the role. - Relying on the answer starting with your string. If a parser depends on that guarantee, structured outputs carries it now, not the trick.
- Fixing it by escalating. Repeating the instruction in capitals inside the prefill was never the mechanism, and without the turn it is not the fix either.
- Copying the pattern out of an old tutorial without checking the last role. The example pastes in the same way, the request fails, and the error message does not name the technique you have to drop.
Sources
- https://platform.claude.com/docs/en/release-notes/overview
- https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
- https://ai.google.dev/gemini-api/docs/whats-new-gemini-3.6
- https://ai.google.dev/gemini-api/docs/whats-new-gemini-3.8
- https://ai.google.dev/gemini-api/docs/changelog
- https://ai.google.dev/gemini-api/docs/prompting-strategies
Summary
Anthropic has rejected it since Claude Opus 4.6 and still rejects it on Fable 5, Sonnet 5 and Haiku 5.5; Google returns 400 from Gemini 3.6 Flash. Of the three replacements only structured outputs carries a comparable guarantee: putting the opening inside the user turn buys the shape, not the contract.
Ready to create better prompts?
Try our free AI prompt generator and join thousands of users creating better prompts.