| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/waf/detections/ai-security-for-apps/ | [Back] [Original] |
Applications that use large language models (LLMs) are exposed to threats specific to how LLMs process input prompt injection attacks, PII exposure in prompts, and prompts about unsafe topics.
AI Security for Apps (formerly Firewall for AI) complements your existing WAF rules with detections designed for these LLM-specific threats. It is model-agnostic the detections work regardless of which LLM you use.
When enabled, AI Security for Apps scans incoming requests to endpoints labeled cf-llm for LLM prompts that may contain threats. Currently, the detection only handles requests with a JSON content type (application/json).
Based on scan results, Cloudflare populates AI detection fields fields you can use in WAF rule expressions. You can use these fields in two ways:
cf-llm label in Security Analytics to review detection results across your traffic.AI Security for Apps capabilities vary by Cloudflare plan:
| Capability | Free | Pro | Business | Enterprise |
|---|---|---|---|---|
| LLM endpoint discovery Automatically identify AI-powered endpoints across your web properties | Yes | Yes | Yes | Yes |
| AI Security Log Mode Ruleset Pre-built ruleset that logs the full request body alongside detection results | No | No | No | Paid add-on |
| AI detection fields PII detection, prompt injection scoring, unsafe topic detection, custom topics | No | No | No | Paid add-on |
To get access to the AI Security Log Mode Ruleset and enable AI detection fields, contact your account team.
AI Security for Apps is built into the Cloudflare Web Application Firewall (WAF) the WAF must be enabled on your zone before detection fields can be populated and used in rule expressions.
| Web Proxy Viewer | New URL | Original Page |