Define security protections
Web Assets provides application context to security detections. This helps detections inspect the right traffic and lets you create rules focusing on targeted protections.
Use this guide to connect a Web Assets operation to a security detection and create a rule that logs, challenges, blocks, or rate limits risky traffic.
Most protections that use Web Assets follow the same workflow:
-
Turn on the security detection that protects the use case, if applicable.
-
In Web Assets, confirm that the relevant operation exists.
Go to Web assets -
Apply the required managed label if not already exists.
-
In Security Analytics, review matched traffic and detection results.
Go to Analytics -
Create a custom rule, or rate limiting rule to act on risky traffic.
AI Security for Apps runs targeted scans on requests to AI-powered operations. Use it to detect prompt injection, personally identifiable information (PII) in prompts, unsafe topics, and other Large Language Model (LLM)-specific signals.
To define protection for an LLM-powered operation:
- Turn on AI Security for Apps.
- Confirm that the operation receiving LLM prompts exists in Web Assets.
- Apply the
cf-llmmanaged label if not already exists. - In Security Analytics, filter by the
cf-llmmanaged label. - Review AI Security for Apps fields on matched traffic.
- Create a custom rule or rate limiting rule that acts on the AI detection fields.
For the full setup workflow, refer to Get started with AI Security for Apps.
Use Security Analytics to confirm that the expected requests carry the right operation and label context before you create a blocking rule.
-
In the Cloudflare dashboard, go to the Analytics page.
Go to Analytics -
Filter by the relevant managed label.
-
Review Sampled logs.
-
Check detection-specific fields, such as LLM prompt fields or leaked credential fields.
You can also export operation and label data with Logpush or query it with the GraphQL Analytics API. For more information, refer to Use labels in analytics and logs.
After you validate detection behavior, create rules that act on relevant detection fields.
For example, a rule can match requests addressed to an operation labeled cf-llm that also carry personally identifiable information in an LLM prompt.
You can use custom rules to log, challenge, block, or skip traffic. You can use rate limiting rules to limit high-volume activity.