# 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.

AI and LLM interview question Q103, Prompt and context engineering. Intermediate, occasional (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/what-is-prefilling-the-response

## Say it in 30 seconds

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.

## Say it in 2 minutes

Prefilling the response means I write the first words of the model's reply myself. In the API, the last message can be marked as the assistant's, and the model writes on from whatever words are there. If I start it with an opening brace, the model tends to write JSON, which other software can read. It's a simple way to steer the format, and teams used it a lot.

They used it for five jobs: forcing a format like JSON or YAML, skipping a friendly opening line, steering around refusals the model didn't need to make, resuming a reply that got cut off, and keeping refreshed context in a long chat. In a claims app, that brace stops the model adding chatter before the data, which would break the parser.

The catch is that Anthropic has changed this. From Claude 4.6 models, a prefilled last message gets a 400 error. Newer models follow instructions well enough that most prefill jobs don't need it. Earlier models still accept prefills, so the answer depends on the model.

So I move each job somewhere supported. I ask for the format clearly, use tool enums for labels, or use structured outputs for a schema. I still check the reply in code, because a schema makes the reply follow a shape, but my code decides what happens next.

## 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.

- **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. **The app sends the note:** The adjuster's note goes in, and the last message starts with an opening brace.
2. **The model writes the rest:** It fills in the claim type, the estimated amount and whether a person must review it.
3. **Code checks the result:** Your code parses the JSON. Anything malformed goes to a person, not into the payment queue.

*Diagram, Two ways the reply can start: 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.*
1. Without a prefill, a friendly first line can come before the JSON.
2. With the reply continuing from an opening brace, the model writes JSON the parser 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.

*Diagram, One prefilled request, two model generations: 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.*
1. Earlier models accept the prefill and continue from it.
2. Claude 4.6 and later models reject the same request with a 400 error.
3. The fix moves the format rule into the request itself.

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." Better: It 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." Better: No. 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." Better: A 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?

A. A system prompt that asks for JSON only, with no prefill.
B. A structured outputs request with a schema for the claim.
C. A final assistant message that starts with an opening brace to force JSON.
D. A user message asking for a plain-text summary of the claim.

**Answer:** C. The last assistant message is prefilled, and these models return a 400 error for that. The other three work without a prefill: an instruction, a schema, or a plain request.

**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?

A. Lower the temperature so the JSON comes out stricter
B. Raise max_tokens so the reply is never cut short
C. Put the JSON rule in the system prompt and use structured outputs
D. Keep the prefill and retry when the parser fails

**Answer:** C. Opus 4.6 does not support prefilling assistant messages, so the rule has to live in the request. Temperature and length limits don't change that, and retries against a rejected request fail the same way.

## Can you answer these from memory?

**Flash cards**

- **What is prefilling the response?** Writing the first words of the model's reply in the last assistant message.
- **What was it used for?** Forcing a format, skipping a preamble, resuming a cut-off reply, keeping context fresh.
- **Does Claude 4.6 accept it?** No. Claude 4.6 and later models return a 400 error for a prefilled last message.
- **What do earlier models do?** They still support prefills and continue from the words you wrote.
- **What replaces it?** Plain instructions, tool enums for labels, or structured outputs. Continuations move to the user message.
- **What should you check before using a prefill?** Which Claude model you call. Claude 4.6 and later models reject prefilled messages with a 400 error.

## Likely follow-up questions

- Q085 How do you get reliable JSON output? https://designervenkat.online/interview/ai/how-to-get-reliable-json-from-an-llm
- Q086 JSON mode vs strict schema structured outputs? https://designervenkat.online/interview/ai/json-mode-vs-strict-schema-structured-outputs
- Q102 Why do prompts break when you switch models? https://designervenkat.online/interview/ai/why-do-prompts-break-when-you-switch-models
- Q080 What goes in a system prompt? https://designervenkat.online/interview/ai/what-goes-in-a-system-prompt
- Q478 Parse and validate LLM JSON, retrying on failure. https://designervenkat.online/interview/ai/parse-and-validate-llm-json-retrying-on-failure
