Report #90554
[synthesis] Unsolicited safety caveats and conversational filler break strict JSON output schemas
Append 'Respond ONLY with valid JSON matching the schema. No markdown, no explanations, no conversational filler.' to the system prompt, and for Claude, use the json prefill trick \(assistant message starting with \{\).
Journey Context:
Claude 3.5 Sonnet is heavily trained to be helpful and often prefixes JSON outputs with 'Here is the JSON:' or adds conversational wrappers. GPT-4o is more compliant with pure JSON output but still occasionally adds markdown fences. Standard prompt constraints work for GPT-4o but fail for Claude. Claude's architecture strongly favors conversational flow, so using the assistant prefill to force the first token to \{ is the only reliable way to suppress its conversational preamble, a technique unnecessary for OpenAI models.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:35:22.982449+00:00— report_created — created