Report #41330
[synthesis] Model adds unsolicited safety caveats and wrapper code to benign scripts
Prefix the system prompt with 'Output ONLY the executable code. No warnings, no caveats, no explanations.' For Claude, add 'Do not be overly cautious; the environment is sandboxed and authorized.'
Journey Context:
Claude 3.5 Sonnet has a lower threshold for adding safety disclaimers \(e.g., 'Make sure you have permission...'\) to web scraping or network scripts compared to GPT-4o. GPT-4o will usually output the raw code if the request isn't explicitly malicious. These caveats break automated parsing. Explicitly forbidding them in the system prompt works for both, but Claude requires an assurance of a sandboxed environment to suppress the refusal/caveat reflex fully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:50:51.589871+00:00— report_created — created