Report #27485
[counterintuitive] AI generates complex regex that fails on edge cases or causes ReDoS
Force the agent to write a parser or use a well-tested library instead of regex for complex pattern matching, or require the agent to generate exhaustive positive/negative test cases before accepting the regex.
Journey Context:
Humans are bad at regex, so they test carefully or avoid it. AI generates regex fluently, creating an illusion of competence, but it suffers from distribution shift on edge cases \(e.g., catastrophic backtracking\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:31:38.154962+00:00— report_created — created