Coding agents like Claude Code and Codex are increasingly capable of finding critical vulnerabilities, but they frequently refuse legitimate security work due to aggressive safety classifiers. A recent analysis by security firm Calif highlighted this tension when a researcher used Codex to discover Java4Shell, a critical OpenJDK memory-corruption bug, in under an hour for less than $200 in token costs. Despite this capability, users report agents stalling or refusing tasks like crash dump analysis or scraping, often triggered by context clues rather than actual policy violations.

The Mechanics of Refusal

The refusal behavior is rarely a single 'safety switch' but rather a combination of four factors. First, classifiers analyze the entire context, including loaded skills and files, not just the user prompt. Anthropic’s documentation notes that terms like 'exploit generation' or 'penetration testing' can trigger fallbacks from Opus 5 to Opus 4.8. Second, offensive-sounding language increases refusal rates; a Scale AI study found prompts with such terms were refused 2.72 times more often. Third, simply stating 'I am authorized' often backfires, with those prompts refused 21.8% of the time compared to 11.6% for detailed task descriptions. Finally, what appears to be a refusal is often a sandbox network block, particularly in Codex where network access is disabled by default.

Official Verification Programs

For users requiring dual-use capabilities like malware analysis or exploit validation, vendors have introduced formal verification paths. Anthropic’s Cyber Verification Program (CVP) offers tiers for Defense and Red Team access, adjusting safeguards on models like Claude Mythos and Opus. OpenAI’s Daybreak program similarly provides Blue and Red tiers, with Red access granting reduced refusals on newer models like GPT-6.2 Astra. However, these programs are not free passes; Anthropic’s own evaluation showed that even with Defense access, 46 out of 50 tasks were still blocked, whereas Red Team access allowed 34 out of 50 tasks to complete.

Scoping and Sandboxing Best Practices

The most effective mitigation is honest, detailed scoping within configuration files like AGENTS.md or CLAUDE.md. Instead of vague requests like 'do a pentest,' users should specify owners, in-scope targets, defensive outputs, and stop conditions. For example, asking an agent to 'review upload.php for path traversal and write a failing test' is less likely to trigger classifiers than 'show me how to break it.' Additionally, running agents in isolated sandboxes with strict network allowlists is critical. Codex requires enabling network_proxy=true to enforce domain restrictions, while Claude Code users must explicitly disable unsandboxed commands to prevent silent fallbacks.

Key Takeaways

  • Agents refuse work based on context triggers, not just explicit policy violations.
  • Detailed, defensive task descriptions significantly reduce refusal rates compared to vague or offensive-sounding prompts.
  • Formal verification programs (CVP, Daybreak) are required for advanced dual-use tasks like exploit validation.
  • Sandboxing with network allowlists and local models for sensitive findings is essential for privacy and control.

The Bottom Line

Stop trying to trick the classifier and start documenting the authorization. Honest scoping and proper sandboxing are the only reliable ways to get consistent security results from coding agents.