Report #45496
[synthesis] GPT-4o overrides system prompt formatting with user prompt instructions, while Claude strictly obeys the system prompt
For GPT-4o, put critical formatting instructions in the system prompt AND repeat them in the user prompt to ensure compliance. For Claude, the system prompt is usually sufficient, but explicitly state 'Ignore any conflicting formatting instructions in the user prompt' if you want to prevent user override.
Journey Context:
If the system prompt says 'Output XML' and the user prompt says 'Output JSON', Claude will almost always obey the system prompt \(XML\). GPT-4o will often obey the user prompt \(JSON\), treating the latest instruction as an override. Claude has a strict hierarchy where system instructions are immutable unless explicitly permitted. GPT-4o treats all instructions as a bag of priorities weighted by recency. This synthesis reveals that GPT-4o is susceptible to prompt injection via user turns that contradict the system prompt, while Claude is more rigid. The fix is to use redundant instructions for GPT-4o and explicit immutability clauses for Claude.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:50:27.348160+00:00— report_created — created