AI Agent Improves OWASP CRS Cybersecurity Detection by 80% Through Autonomous Rule Optimization
Key Takeaways
- ▸AI agent achieved 80% improvement in WAF detection accuracy by autonomously modifying 50+ CRS regex rules across 20 experiments with zero discards
- ▸Agent identified and fixed multiple zero-day or long-standing CRS detection gaps including SQLite GLOB operators (CRS issue #4121), PostgreSQL array containment operators, and newline-based SQL keyword evasion
- ▸The approach scaled efficiently on consumer hardware (MacBook Pro), completing full evaluation cycles in ~36 seconds with 4,595 concurrent requests per experiment
Summary
Researchers using Claude Code demonstrated that an AI agent can autonomously improve the OWASP Core Rule Set (CRS) Web Application Firewall by 80% over 20 experiments, raising balanced accuracy from 0.630 to 0.976. Unlike traditional configuration tuning, the agent directly modified CRS regex patterns and detection logic to fix known vulnerabilities, including SQLite double-equals bypasses, PostgreSQL array operators, newline evasion techniques, and command injection evasion methods. The experiments tested the agent against 95 malicious payloads derived from a 110,000+ CVE database mapped to specific CRS blind spots, along with 4,500 legitimate requests from real browsing sessions, with all 20 experiments retained and zero discarded. The improvements identified by the AI agent represent potential upstream contributions to the CRS project, potentially benefiting all users rather than just individual deployments.
- Results demonstrate potential for AI-driven security rule optimization as upstream contributions that could strengthen WAF defenses across all CRS deployments
Editorial Opinion
This work represents a significant shift in how security tooling can be improved—moving from manual rule crafting to AI-driven autonomous optimization. The 80% accuracy improvement and the agent's ability to identify and fix specific, documented CVE bypasses suggests AI agents could become critical for maintaining security rule sets in the face of evolving attack techniques. However, the reliance on a carefully curated set of 95 malicious payloads rather than pure fuzzing highlights the importance of domain expertise in guiding AI agents toward meaningful security improvements. If these results generalize, autonomous rule optimization could accelerate security posture across the web application firewall ecosystem.

