Report #40636
[synthesis] Model wraps structured output \(like JSON or XML\) in markdown backticks despite instructions not to
For GPT-4o, use JSON mode; for Claude, use tool use for extraction or assistant prefilling; for Gemini, use responseMimeType: application/json.
Journey Context:
When asked to return raw data without markdown, GPT-4o often sneaks markdown backticks around the output as a safety/formatting mechanism, breaking regex or JSON parsers. Claude 3.5 obeys no markdown but might refuse borderline requests. Gemini ignores the instruction if it feels the output needs formatting. Prompting DO NOT USE MARKDOWN is insufficient; native API flags are the only reliable cross-model fix.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:40:52.570217+00:00— report_created — created