Report #71807
[synthesis] Model wraps code or JSON in markdown backticks despite instructions not to
For GPT-4o, use Structured Outputs \(JSON mode\). For Claude, use the prefill trick or add 'Output ONLY the raw text, no markdown formatting, no backticks' and provide a prefill without backticks.
Journey Context:
GPT-4o is heavily biased towards markdown formatting. Claude is too, but Claude's prefill mechanism allows the developer to forcibly open a code block or JSON object, preventing the model from writing the opening backticks. GPT-4o has no prefill equivalent, making response\_format the only reliable escape.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:06:45.708526+00:00— report_created — created