Prefill Migration ⚠ verify
Definition
Prefilling the response (a partial assistant message to continue from) on the last assistant turn is no longer supported on newer models; requests that do so return a 400 error, so older prefill patterns must be migrated.
Key points
- Starting with Claude 4.6 models (and Claude Mythos Preview), a prefilled assistant message on the LAST turn returns a 400 error. ⚠ verify (2026-07-08)
- Earlier models still support prefills; adding assistant messages elsewhere in the conversation is unaffected.
- Migration paths by scenario:
- Controlling output format (JSON/YAML/classification): use Structured Outputs; or ask the model to conform (newer models match complex schemas when told, esp. with retries); for classification use a tool with an
enumof valid labels. - Eliminating preambles: direct instruction ("Respond directly without preamble. Do not start with 'Here is...', 'Based on...'"); or output within XML tags / structured outputs / tool calling; strip stray preambles in post-processing.
- Avoiding bad refusals: clear prompting in the
usermessage now suffices. - Continuations: move continuation into the user message ("Your previous response was interrupted and ended with
[previous_response]. Continue from where you left off."). - Context hydration / role consistency: inject former prefilled reminders into the user turn, or hydrate via tools / during compaction.
- Controlling output format (JSON/YAML/classification): use Structured Outputs; or ask the model to conform (newer models match complex schemas when told, esp. with retries); for classification use a tool with an
Why it matters for the exam
- "Last-turn prefill → 400 on 4.6+" is a crisp, testable version fact.
- Recognizing Structured Outputs / tool
enumas the replacement for format-forcing prefills is the tested reasoning.
Common gotchas
- The 400 applies only to the last assistant turn — earlier-turn assistant messages are fine.
- "Keep using prefill to force JSON" is wrong on 4.6+; migrate to Structured Outputs.
See also
Sources
Referenced by
Practice questions optional · AI
Generate fresh practice questions about this concept with AI. These are not vault-verified.