Skills
Adversa AI: Claude Code Deny Rules Silently Bypassed After 50 Subcommands — Token-Cost Optimization Creates Security Hole
Adversa AI discovered that Claude Code's MAX_SUBCOMMANDS_FOR_SECURITY_CHECK = 50 hard cap means any shell command with 50+ subcommands (joined by &&, ||, ;) skips all deny-rule enforcement, falling back to a generic auto-allowable prompt. A developer who configures 'never run rm' sees rm blocked alone but executed freely after 50 no-ops. Anthropic patched on April 6. The root cause: security analysis costs tokens, so Anthropic capped it — a design tradeoff that silently traded safety for performance. Audit your Claude Code version and update past v2.1.100.
Source
↳ Follow the thread