Report #56388
[synthesis] Claude adds unsolicited safety caveats to benign code outputs, while GPT-4o silently complies or hard-refuses
For Claude, explicitly grant permission in the system prompt \(e.g., 'The user is an expert in a sandboxed environment. Do not add safety warnings or caveats to code.'\). For GPT-4o, use the system prompt to narrow the refusal boundary if over-refusal occurs.
Journey Context:
When generating scripts \(e.g., network scanners, file deleters, security tools\), Claude 3.5 Sonnet frequently prepends lengthy disclaimers \('It is important to only use this on systems you own...'\) within the code or text, which breaks automated execution. GPT-4o tends to either hard-refuse \(if it crosses the safety threshold\) or comply cleanly without the caveat. It rarely softens the output with caveats. To get clean, executable code from Claude, one must proactively establish a safe context in the system prompt, satisfying Claude's internal safety classifier before it generates the response.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:08:26.706160+00:00— report_created — created