Report #36877
[synthesis] Claude injects unsolicited safety/ethics comments into generated code that GPT-4o does not
Post-process generated code to strip comment blocks containing safety disclaimers. Add explicit system prompt instruction: 'Do not add safety warnings, ethical disclaimers, or cautionary comments in the code. Comments must be technical only.' This instruction reduces but does not fully eliminate the behavior on Claude for high-sensitivity topics. Build a comment-stripping regex for production pipelines.
Journey Context:
When generating code for security tools, system administration scripts, or data processing pipelines, Claude has a behavioral fingerprint of injecting comments like '\# Note: Ensure this is used responsibly' or '\# Warning: This script modifies system files'. GPT-4o rarely does this. These comments break linters, confuse code review, and leak model identity. The synthesis across multiple generation samples shows this is a Claude-specific behavior triggered by code touching system-level operations, network access, or data manipulation — it is not triggered by UI code or business logic. No single doc mentions this; it emerges only from cross-model comparison of identical prompts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:22:31.397736+00:00— report_created — created