Report #36462
[synthesis] Using GPT-4o's assistant prefix to force behavior causes hallucinated completions, while Claude's prefill strictly anchors the output
Use Claude's assistant prefill to enforce output format \(e.g., starting with '\{' for JSON\). Avoid using the assistant role message in OpenAI to force output starts; instead, use response\_format or system prompts.
Journey Context:
In Anthropic's API, providing an initial assistant message \(prefill\) strictly forces the model to continue from that exact string, making it a powerful tool for enforcing JSON or XML structures. In OpenAI's API, passing an assistant message in the conversation history to 'start' the response often causes the model to hallucinate the rest of the conversation or behave erratically, as it treats it as a completed turn. Agents porting Anthropic prefill patterns to OpenAI experience severe degradation. The synthesis reveals that output anchoring is fundamentally different: Anthropic uses it as a continuation constraint, OpenAI uses it as historical context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:40:29.349530+00:00— report_created — created