Cloudflare Used Frontier AI Models to Attack Its Own WAF, and Found Gaps

Cloudflare ran frontier AI models as automated attackers against its own Web Application Firewall (WAF) and recorded 1,107 attempts. According to the company, the vast majority were blocked, and the requests that got through are being used to build new detections for all customers.
- Cloudflare used frontier AI models as automated attackers against its own WAF, with no access to source code or WAF rules.
- The run covered 45 scenarios and 1,107 attempts against an authorized customer staging environment.
- According to Cloudflare, the vast majority of attacks were blocked, with near full coverage for XSS, LFI, SQLi and Log4j.
- Human review left 49 findings worth investigating, 48 of them in CMDi and SSRF.
- Findings are being turned into new detections, and Cloudflare urges customers to keep their software patched.
Why Cloudflare tested the WAF with LLMs
Cloudflare says customers keep asking whether their WAF is ready for frontier AI models, so it set out to measure that. The company argues that what LLMs do best when exploiting applications is iterate and mutate attack payloads faster than a human could. A model can read real-time responses and change tactics, for example by trying a different encoding, sending the payload in another part of the HTTP request, or moving on to the next vulnerability.
Cloudflare took a dynamic approach, meaning the model behaves like a hacker probing a running system. The LLM had no view of source code or WAF rules and could only see selected HTTP response data. A request that was not blocked was treated as a lead for human review, not a confirmed exploit.
How the adaptive loop works
The tester starts from known exploits that the WAF already blocks. Each scenario fixes one attack category, one place in the request for the input, and a limited number of attempts. The loop calls a model twice: a proposal call suggests the next variation, and a review call looks at the response status, selected headers and body. The loop ends when mutations stop producing useful variations or a hard-coded attempt limit is reached.
Neither call receives rule expressions, rule IDs, WAF Attack Score details, or the identity of the security layer that acted. Cloudflare wrote the system in Python instead of wrapping an existing penetration-testing tool. Code, not the models, sends the requests. Before each one it checks the target hostname against an allowlist, disables redirects, records the attempt and enforces the attempt limit. Because response text can appear in later prompts, it is treated as untrusted input. According to Cloudflare, neither model call can deploy a rule or change enforcement.
The test setup and what came out
The main run targeted an authorized customer staging environment protected by Cloudflare's WAF. An allowlisted test User-Agent kept the customer's automated-traffic controls from stopping the test before requests reached the WAF. The zone used WAF Attack Score blocking for scores of 30 or below, the full Cloudflare Managed Ruleset, and the OWASP Core Ruleset at Paranoia Level 3.
Cloudflare ran 45 scenarios. Of these, 44 covered six categories: cross-site scripting (XSS), SQL injection (SQLi), command injection (CMDi), server-side request forgery (SSRF), path traversal or local file inclusion (LFI), and Log4j. The remaining scenario covered log injection and is reported separately. The results describe the configured WAF as a whole, not any individual rule.
The tester recorded 1,107 attempts. Cloudflare says XSS, LFI, SQLi and Log4j had near full coverage. After human review removed malformed, benign, duplicate and out-of-scope observations, 49 findings were worth investigating, 48 of them in CMDi and SSRF.
An SSRF example: the trailing dot
Cloudflare walked through one session in which the model tried to reach a cloud metadata address. It rewrote the same IP as a decimal integer, an octal form and a trailing-dot form, and moved the input between the query string and a form body. The WAF blocked everything except one request. At attempt 18, the model kept the structure of the blocked attempt 17 and switched to the trailing-dot host form. The client then received a redirect instead of a Cloudflare block page.
Cloudflare stresses the limits of this result. There was no successful origin response, no response body, and no evidence that the application fetched metadata. The request was kept for triage and origin-side validation. It raised a specific question: whether the trailing dot changes how the WAF reads the destination.
What it means for WAF users
Cloudflare says the exercise is becoming a foundational building block of its WAF development lifecycle, and that the bypasses it found helped create new detections for all customers. The company also reminds users that a WAF is one layer of protection. A payload that gets past it still needs an exploitable application to succeed, so keeping software patched remains one of the strongest defenses.
Cloudflare: We tested our own WAF with frontier AI models. Here’s what we found


