Request Score Fields: Bot Management, WAF Attack Vectors, and LLM Prompt Injection
How Cloudflare bot, WAF, and LLM prompt scores work in Rules language and Logpush, including ranges, plan limits, and thresholds.
This page summarises Cloudflare documentation on numeric score fields attached to HTTP requests: Bot Management bot score, WAF attack scores (global and per attack vector), AI Security prompt-injection and token counts, and related Logpush column names. These values power custom rules, rate limiting expressions, and security analytics. Several scores use the same 1–99 scale but mean opposite things for bots versus attacks—read each field’s definition before you write rules.
Bot score (cf.bot_management.score): human vs automated traffic
Section titled “Bot score (cf.bot_management.score): human vs automated traffic”Bot score answers whether the request likely came from a person or automation. In the Rules language field reference, Cloudflare defines it as follows:
Represents the likelihood that a request originates from a bot using a score from 1–99.
A low score indicates that the request comes from a bot or an automated agent. A high score indicates that a human issued the request.
— Cloudflare, cf.bot_management.score
Requirements: Enterprise plan with Bot Management enabled.
In HTTP Requests Logpush datasets, the same concept appears as BotScore (integer). That dataset notes that scores below 30 are commonly associated with automated traffic, and that the field is available only for Bot Management customers (contact your account team to enable). Account Abuse Protection Events also exposes BotScore with the 1 (likely bot) to 99 (likely human) range.
When to use bot score in rules
Section titled “When to use bot score in rules”Use bot score when you want different actions for suspected bots (challenge, log, route) without relying only on IP or User-Agent heuristics. Pair thresholds with your own traffic profile: documentation gives below 30 as a common automation signal in logs, not a universal block rule.
WAF attack score (cf.waf.score and vectors): malicious vs clean requests
Section titled “WAF attack score (cf.waf.score and vectors): malicious vs clean requests”WAF attack scores measure how likely a request matches attack patterns. They are not bot scores: here, low means more malicious and high means more likely clean.
Cloudflare lists these fields in WAF attack score:
| Rules language field | Role | Plan (per docs) |
|---|---|---|
cf.waf.score |
Global 1–99 score combining attack vectors | Enterprise + attack score detection |
cf.waf.score.sqli |
SQL injection (SQLi) vector | Enterprise + attack score detection |
cf.waf.score.xss |
Cross-site scripting (XSS) vector | Enterprise + attack score detection |
cf.waf.score.rce |
Command injection / RCE vector | Enterprise + attack score detection |
cf.waf.score.class |
Bucketed label: attack, likely_attack, likely_clean, clean |
Business or above |
Per-vector references repeat the same pattern—for example cf.waf.score.sqli: an attack score from 1–99 classifying the SQLi attack vector.
The global field cf.waf.score is described as:
A global score from 1–99 that combines the score of each WAF attack vector into a single score.
The special score 100 indicates that Cloudflare did not score the request.
— Cloudflare, cf.waf.score
How to read WAF attack score numbers
Section titled “How to read WAF attack score numbers”From WAF attack score:
- 1 — request is almost certainly malicious.
- 99 — request is likely clean.
- 100 — request reached the attack score system but was not scored (rules/logs treat this as a special value).
- In Logpush, 0 means the request did not reach the attack score stage (for example, already mitigated earlier); 0 does not appear in the dashboard.
The global score is derived from vector scores (SQLi, XSS, RCE, etc.) but is not a simple sum. A low global score usually goes with medium-to-low vector scores; a high global score suggests higher vector scores.
cf.waf.score.class vs numeric scores
Section titled “cf.waf.score.class vs numeric scores”cf.waf.score.class maps numeric ranges to labels for dashboards and expressions (Business plan or above):
| Dashboard label | Field value | Numeric attack score range |
|---|---|---|
| Attack | attack |
1–20 |
| Likely attack | likely_attack |
21–50 |
| Likely clean | likely_clean |
51–80 |
| Clean | clean |
81–99 |
Requests with attack score 100 show as Unscored in the dashboard; that class cannot be used in rule expressions.
Attack score detection also decodes Base64, JavaScript Unicode escapes, and URL-encoded content in the URL, headers, and body when scoring.
Logpush WAF score column names
Section titled “Logpush WAF score column names”HTTP Requests (zone and account datasets) expose:
WAFAttackScore— overall request score from the WAF detection moduleWAFRCEAttackScore,WAFSQLiAttackScore,WAFXSSAttackScore— per-vector WAF scores
Use these names in Logpush pipelines; use cf.waf.score* in Rules language expressions.
LLM prompt injection score and token count (AI Security for Apps)
Section titled “LLM prompt injection score and token count (AI Security for Apps)”For applications that send LLM prompts through Cloudflare, AI Security adds request fields and Logpush columns.
cf.llm.prompt.injection_score
Section titled “cf.llm.prompt.injection_score”From cf.llm.prompt.injection_score:
A score from 1–99 that represents the likelihood that the LLM prompt in the request is trying to perform a prompt injection attack.
A low score (for example, below 20) indicates that there is a high probability that the LLM prompt in the request is trying to perform a prompt injection attack.
The special score 100 indicates that Cloudflare did not score the request.
— Cloudflare, cf.llm.prompt.injection_score
Requirements: Enterprise plan and AI Security for Apps enabled.
Interpretation aligns with WAF attack scores for “maliciousness”: lower = more likely injection. Score 100 = not scored.
Prompt injection detection explains why Cloudflare uses a score instead of a boolean: injection sits on a spectrum, and thresholds trade off false positives vs missed attacks. Documented examples:
- Strict (e.g. less than 50) — blocks more; higher false positive rate on legitimate prompts.
- Moderate (e.g. less than 30) — typical balance.
- Conservative (e.g. less than 20) — fewer false positives; may miss subtle injection.
cf.llm.prompt.token_count
Section titled “cf.llm.prompt.token_count”cf.llm.prompt.token_count is an estimated token count for the prompt in the request, using a general-purpose tokenizer (may not match your LLM provider’s count). Example expression from the docs:
(cf.llm.prompt.token_count gt 4000)Same Enterprise + AI Security for Apps requirements.
Logpush: AI Security vs deprecated Firewall for AI fields
Section titled “Logpush: AI Security vs deprecated Firewall for AI fields”Firewall Events and HTTP Requests include:
| Current field | Meaning |
|---|---|
AISecurityInjectionScore |
Likelihood of prompt injection (AI Security) |
AISecurityTokenCount |
Token count (AI Security) |
Deprecated replacements:
FirewallForAIInjectionScore→ useAISecurityInjectionScoreFirewallForAITokenCount→ useAISecurityTokenCount
cf.threat_score and Security Level (legacy)
Section titled “cf.threat_score and Security Level (legacy)”Do not build new rules on cf.threat_score:
Previously, a threat score represented a Cloudflare threat score from 0–100, where 0 indicated low risk. Now, the threat score is always 0 (zero).
— Cloudflare, cf.threat_score
Security Level repeats that the threat score is always 0 and recommends not creating rules based on threat score, since it is no longer populated.
OWASP request threat score (managed rules concept)
Section titled “OWASP request threat score (managed rules concept)”Separate from cf.threat_score, the OWASP Core Ruleset concepts page defines request threat score for matched OWASP rules:
Each OWASP rule that matches the current request has an associated score. The request threat score is the sum of the individual scores of all OWASP rules that matched the request.
— Cloudflare, Concepts
That value is a sum of rule contributions, not the same field as Bot Management or WAF attack score in Rules language. When debugging OWASP parity mode or managed rule behaviour, use this definition; when writing custom WAF rules, use cf.waf.score* and related fields from attack score detection.
Score fields at a glance: direction, specials, and plans
Section titled “Score fields at a glance: direction, specials, and plans”| Field family | Low values mean | High values mean | Special values | Typical plan gate |
|---|---|---|---|---|
Bot (cf.bot_management.score / BotScore) |
Likely bot | Likely human | — | Enterprise + Bot Management |
WAF attack (cf.waf.score*) |
Likely attack | Likely clean | 100 = unscored; Logpush 0 = not reached | Enterprise + attack score detection (class: Business+) |
LLM injection (cf.llm.prompt.injection_score) |
Likely injection | Less likely injection | 100 = not scored | Enterprise + AI Security for Apps |
LLM tokens (cf.llm.prompt.token_count) |
(count, not risk) | Larger prompts | — | Enterprise + AI Security for Apps |
cf.threat_score |
N/A (always 0) | N/A | Always 0 now | Do not use for new rules |
Complexity-based rate limiting and response scores
Section titled “Complexity-based rate limiting and response scores”WAF rate limiting parameters define complexity-based limits using score_per_period and an origin response header (score_response_header_name). That mechanism limits traffic when a cumulative score per period exceeds a cap—not the same as reading cf.waf.score on a single request. Use it when your origin returns a per-request cost or risk score in a header; use cf.waf.score and bot/LLM fields when Cloudflare computed the score at the edge.
Common mistakes
Section titled “Common mistakes”- Using
cf.threat_scoreor Security Level threat score after deprecation—both document a constant 0. - Assuming all 1–99 fields work the same way—bot score increases for humans; WAF and injection scores increase for cleaner/safer requests.
- Treating 100 as “worst attack”—for WAF and LLM injection, 100 means Cloudflare did not score the request.
- Ignoring Logpush 0 on WAF attack scores—0 means the request never reached attack scoring, not “perfectly clean.”
- Keeping deprecated Logpush columns (
FirewallForAI*) instead ofAISecurity*when building new pipelines. - Confusing OWASP request threat score (sum of matched rule scores) with
cf.waf.score(ML/heuristic attack score detection).
How to check this on your site
Section titled “How to check this on your site”- Confirm your plan and features: Bot Management, attack score detection, and AI Security for Apps / prompt injection match the fields you reference in rules.
- Send test requests through the zone and inspect HTTP Requests or Firewall Events Logpush samples for
BotScore,WAFAttackScore,AISecurityInjectionScore, and related columns. - In the Cloudflare dashboard, compare numeric WAF attack scores to
cf.waf.score.classlabels using the ranges in WAF attack score. - Validate custom rule expressions against the field reference pages (for example cf.bot_management.score, cf.waf.score, cf.llm.prompt.injection_score).
- You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page does not match your zone, the docs, or a Logpush sample, email yimasynthetic@gmail.com with the page URL and the exact sentence or score field you are questioning.