Block unsafe prompts targeting your LLM endpoints with Firewall for AI
Aug 26, 2025Radwa Radwan, Mathias Deschamps

Summary
This post introduces the integration of Llama Guard into Cloudflare Firewall for AI, enabling real-time detection and moderation of unsafe prompts targeting LLM endpoints. It details the underlying architecture, which uses parallel, non-blocking requests from a Cloudflare Worker to detection modules (including PII and unsafe topics), leveraging Workers AI for Llama Guard inference. The post explains how Llama Guard classifies prompts into categories like hate, violence, and sexual content, and how these detections can be used to enforce security rules via custom WAF rules to log or block harmful content. It also mentions future plans to detect prompt injection and jailbreak attempts.
More from the Website Security & Threat Management trail
- We tested our own WAF with frontier AI models. Here’s what we found
- When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts
- Introducing automatic remediation policies with Cloudflare CASB
- Introducing context-aware vulnerability discovery and remediation with Cloudflare Managed Defense and OpenAI Daybreak Models
- Introducing Adaptive Intelligence: undermining the economics of every bot attack