---
id: "cloudflare-firewall-for-ai"
type: "component"
kind: "waf"
provider: "cloudflare"
category: "security"
docs: "https://developers.cloudflare.com/waf/detections/firewall-for-ai/"
url: "https://localhost:3000/catalogue/components/cloudflare-firewall-for-ai"
---

# Firewall for AI

WAF detection for LLM endpoints that flags PII, prompt injection and unsafe topics in prompts.

| | |
|---|---|
| Provider | [cloudflare](https://localhost:3000/catalogue?provider=cloudflare) |
| Kind | [Web application firewall](https://localhost:3000/catalogue/kinds/waf) |
| Category | Security |
| Official docs | [https://developers.cloudflare.com/waf/detections/firewall-for-ai/](https://developers.cloudflare.com/waf/detections/firewall-for-ai/) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `botProtection` | boolean | — | no | — | **false** |
| `customRuleCount` | integer | — | no | — | inherited |
| `endpointLabel` | string | — | no | "cf-llm" | inherited |
| `managed` | boolean | — | no | false | **true** |
| `managedRuleSet` | string | — | no | — | inherited |
| `mode` | enum | `detection`, `prevention`, `off` | no | — | **"detection"** |
| `piiDetection` | boolean | — | no | true | inherited |
| `promptInjectionDetection` | boolean | — | no | true | inherited |
| `rateLimiting` | boolean | — | no | — | **false** |
| `unsafeTopicDetection` | boolean | — | no | true | inherited |

Bold values are the ones this component pins.

## Rules that apply · 0

No rule selects this kind or its category.

## Other products of the same kind · 13

- [Web Application Firewall](https://localhost:3000/catalogue/components/alibaba-waf.md) `alibaba-waf` — alibabacloud
- [AWS WAF web ACL](https://localhost:3000/catalogue/components/aws-waf.md) `aws-waf` — aws
- [AWS WAF Classic](https://localhost:3000/catalogue/components/aws-waf-classic.md) `aws-waf-classic` — aws
- [Azure Web Application Firewall](https://localhost:3000/catalogue/components/azure-web-application-firewall.md) `azure-web-application-firewall` — azure
- [Cloudflare WAF](https://localhost:3000/catalogue/components/cloudflare-waf.md) `cloudflare-waf` — cloudflare
- [Coraza](https://localhost:3000/catalogue/components/coraza.md) `coraza` — default
- [Imperva Application Security](https://localhost:3000/catalogue/components/imperva.md) `imperva` — default
- [ModSecurity](https://localhost:3000/catalogue/components/modsecurity.md) `modsecurity` — default
- [NAXSI](https://localhost:3000/catalogue/components/naxsi.md) `naxsi` — default
- [Generic web application firewall](https://localhost:3000/catalogue/components/waf.md) `waf` — default
- [Google Cloud Armor](https://localhost:3000/catalogue/components/google-cloud-armor.md) `google-cloud-armor` — gcp
- [reCAPTCHA Enterprise](https://localhost:3000/catalogue/components/google-recaptcha-enterprise.md) `google-recaptcha-enterprise` — gcp
- [Web Application Firewall](https://localhost:3000/catalogue/components/oci-waf.md) `oci-waf` — oci

## Use it in a design

```yaml
nodes:
  - { id: "cloudflare-firewall-for-ai", component: "cloudflare-firewall-for-ai" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# Firewall for AI (AI Security for Apps): WAF detection that scans prompts on endpoints
# labelled cf-llm for PII, prompt injection and unsafe topics. It only populates detection
# fields; blocking needs a custom or rate limiting rule ("Firewall for AI"), so it ships
# in detection mode.
schemaVersion: "1"
type: "component"
id: "cloudflare-firewall-for-ai"
kind: "waf"
provider: "cloudflare"
docs: "https://developers.cloudflare.com/waf/detections/firewall-for-ai/"
defaults:
  managed: true
  mode: "detection"
  rateLimiting: false
  botProtection: false
properties:
  promptInjectionDetection:
    type: "boolean"
    default: true
  piiDetection:
    type: "boolean"
    default: true
  unsafeTopicDetection:
    type: "boolean"
    default: true
  endpointLabel:
    type: "string"
    default: "cf-llm"
```

Human page: https://localhost:3000/catalogue/components/cloudflare-firewall-for-ai
