Report #69279
[synthesis] Requesting JSON output often results in preamble leaking whereas XML tags are naturally isolated by the model
Use XML tags for extracting structured data from model responses when not using native tool calling, and parse the content between tags; if JSON is required, use the API native JSON mode or response\_format.
Journey Context:
Claude is heavily trained on XML and will reliably wrap answers in ... without preamble. GPT-4o and Gemini tend to add conversational preamble before JSON blocks, making regex/JSON parsing fragile. If you must use text-based structured output \(not tool calls\), XML is the cross-model standard for clean extraction. If using JSON, enforce it via API parameters \(response\_format: \{ type: 'json\_object' \}\) to suppress preamble.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:46:15.675438+00:00— report_created — created