esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

What Is Prefilling the Response?

What prefilling the response is, what teams used it for, and why Claude 4.6 and newer models reject it, explained simply for your AI interview.

In short

Prefilling the response means writing the first words of the model's reply yourself, so the model carries on from them. Claude 4.6 and later models return an error for it, so use clear instructions or structured outputs instead.

9 min readIntermediateOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Prefilling means I write the first few words of the model's reply myself, in the last message marked as the assistant's, and the model carries on from there. Teams used it to force JSON, skip a friendly opening line or resume a cut-off reply. But Claude 4.6 and later models reject it with a 400 error now. So I ask for the format in plain instructions, or use structured outputs. Earlier models still accept it, so I check which model I'm calling.

What is prefilling the response, in plain words?

When you call an AI model through its API, you send it a list of messages. The last one is usually yours, and the model writes its reply from the start. Prefilling means you write the first words of that reply yourself, inside a last message marked as the assistant's. The model then carries on from those words.

Anthropic's docs describe it as "providing a partial assistant message for Claude to continue from". On this page, prefill means only the message you write.

Picture a claims clerk handed a form that already reads "Claim type:", with a line left to finish. The start is set, and the clerk writes only what follows. In an AI app, that start is often an opening brace, so the model writes JSON, a text format other software can read.

Key words

Assistant message
The message that holds the model's side of the chat. The prefill goes here.
Prefill
The first words you write into that message. The model continues them.
JSON
A plain text format for data, with named fields, that code can read.
Structured outputs
An Anthropic feature that makes the reply follow a schema you supply.
400 error
The API's answer to a request it rejects as invalid.

Why did teams use prefill, and how does it work?

A model writes one word after another, so the words it starts with shape everything after them. Anthropic's guide names five jobs that prefill was used for:

  • Forcing a format

    Such as JSON or YAML, which are plain text formats for data.

  • Skipping a preamble

    A friendly opening line, such as an introduction.

  • Avoiding needless refusals

    Steering around refusals the model did not need to make.

  • Resuming a cut-off reply

    Continuing a reply that was interrupted partway through.

  • Keeping context fresh

    Re-inserting refreshed context into a long chat.

Here is the classic case. An insurer's claims app reads an adjuster's note and must return one JSON object. The app ends the last message with an opening brace, and the model writes the rest.

  1. 1

    The app sends the note

    The adjuster's note goes in, and the last message starts with an opening brace.

  2. 2

    The model writes the rest

    It fills in the claim type, the estimated amount and whether a person must review it.

  3. 3

    Code checks the result

    Your code parses the JSON. Anything malformed goes to a person, not into the payment queue.

Two ways the reply can start

No prefill

Friendly first line

chatter before the data

Prefilled

Model continues from {

the start is set for the model

Parser breaks

the claims system rejects it

Claim is read

your code reads each field

  1. 1Without a prefill, a friendly first line can come before the JSON.
  2. 2With the reply continuing from an opening brace, the model writes JSON the parser can read.
The same request, with and without a prefilled opening brace. Without it, a friendly first line can break the parser. With it, the model continues from that opening brace and writes JSON your code can read.

Why do Claude 4.6 models reject it?

The prompting guide has a section on migrating away from prefilled responses. It says the change starts with Claude 4.6 models and Claude Mythos Preview. Here is the rule in the guide's words:

  • “prefilled responses (providing a partial assistant message for Claude to continue from) on the last assistant turn are no longer supported.”

    Anthropic, prompting best practices

The guide gives the reason too. Newer models follow instructions well enough that most prefill jobs no longer need it. The structured outputs page lists prefilling as a limit as well: "Prefilling is incompatible with JSON outputs."

The release notes say the same for Opus 4.6, in the February 5, 2026 entry: "Opus 4.6 does not support prefilling assistant messages." They also say that on Claude Fable 5 and Claude Mythos 5, "manual extended thinking budgets and assistant prefill are not supported (both return a 400 error)."

Earlier models still accept prefills, and assistant messages placed elsewhere in a conversation are not affected. So the honest answer depends on the model, and you should check which one you are calling.

One prefilled request, two model generations

Earlier models

Prefilled last message

the reply continues from {

Claude 4.6 and later

Same prefilled message

the same request, sent again

Reply continues

the prefill still steers it

400 error

the request is rejected

Structured outputs

a schema the reply must follow

  1. 1Earlier models accept the prefill and continue from it.
  2. 2Claude 4.6 and later models reject the same request with a 400 error.
  3. 3The fix moves the format rule into the request itself.
The same prefilled request gets a different result, depending on the model. Earlier models continue it. Claude 4.6 and later models reject it, so the format rule has to move into the request.

Each old job has a supported replacement. For the format, ask for the structure in plain instructions first, or use structured outputs. For labels, use tools with an enum field or structured outputs. For a preamble, use direct instructions in the system prompt. For refusals, use clear prompting in the user message without prefill. For a continuation, move it into the user message with the interrupted text. For long chats, put the refreshed context into the user turn.

Tip

Interviewers want the history and the fix. Say what prefill did, then name its replacement. Don't call it the easy way to force JSON on current Claude models.

What does the interviewer want to hear?

A strong answer covers

  • A plain definition: the words you write at the start of the model's reply.
  • What it was used for: forcing JSON, skipping preambles, resuming cut-off replies.
  • The current state: Claude 4.6 and later models reject it with a 400 error.
  • The replacement: clear instructions, tool enums or structured outputs.
  • Honest limits: the model still writes the rest, so check the reply in code.
  • Model check: which Claude model you call decides whether a prefill works.

Common traps

  • Trap"Prefill is the simplest way to force JSON."

    BetterIt worked on earlier models. Claude 4.6 and later models reject it, so ask for the format in plain instructions or use structured outputs.

  • Trap"Prefill works on every Claude model, so it is the safe default."

    BetterNo. Claude 4.6 and later models return a 400 error for a prefilled last message. Earlier models still accept it, so check the model first.

  • Trap"Once the reply starts right, the rest is guaranteed."

    BetterA prefill steers the start only. Check the whole reply in code before anything acts on it.

Can you spot the rejected request?

Spot the rejected request

Which request to a Claude 4.6 or later model will fail?

Quick check

An old script prefills the reply with an opening brace. The team moves it to Claude Opus 4.6. What is the best fix?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q085How do you get reliable JSON output?12 min
  2. Q086JSON mode vs strict schema structured outputs?10 min
  3. Q102Why do prompts break when you switch models?11 min
  4. Q080What goes in a system prompt?11 min
  5. Q478Parse and validate LLM JSON, retrying on failure.11 min

Last updated on 27 November 2026

Building an app that needs clean output from an AI model?

I design and build AI products and agents, including the checks around the model's output. Book a short call and tell me what your app needs to get back.