Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/bot-management/README.md
1# Cloudflare Bot Management23Enterprise-grade bot detection, protection, and mitigation using ML/heuristics, bot scores, JavaScript detections, and verified bot handling.45## Overview67Bot Management provides multi-tier protection:8- **Free (Bot Fight Mode)**: Auto-blocks definite bots, no config9- **Pro/Business (Super Bot Fight Mode)**: Configurable actions, static resource protection, analytics groupings10- **Enterprise (Bot Management)**: Granular 1-99 scores, WAF integration, JA3/JA4 fingerprinting, Workers API, Advanced Analytics1112## Quick Start1314```txt15# Dashboard: Security > Bots16# Enterprise: Deploy rule template17(cf.bot_management.score eq 1 and not cf.bot_management.verified_bot) → Block18(cf.bot_management.score le 29 and not cf.bot_management.verified_bot) → Managed Challenge19```2021## What Do You Need?2223```txt24├─ Initial setup → configuration.md25│ ├─ Free tier → "Bot Fight Mode"26│ ├─ Pro/Business → "Super Bot Fight Mode"27│ └─ Enterprise → "Bot Management for Enterprise"28├─ Workers API integration → api.md29├─ WAF rules → patterns.md30├─ Debugging → gotchas.md31└─ Analytics → api.md#bot-analytics32```3334## Reading Order3536| Task | Files to Read |37|------|---------------|38| Enable bot protection | README → configuration.md |39| Workers bot detection | README → api.md |40| WAF rule templates | README → patterns.md |41| Debug bot issues | gotchas.md |42| Advanced analytics | api.md#bot-analytics |4344## Core Concepts4546**Bot Scores**: 1-99 (1 = definitely automated, 99 = definitely human). Threshold: <30 indicates bot traffic. Enterprise gets granular 1-99; Pro/Business get groupings only.4748**Detection Engines**: Heuristics (known fingerprints, assigns score=1), ML (majority of detections, supervised learning on billions of requests), Anomaly Detection (optional, baseline traffic analysis), JavaScript Detections (headless browser detection).4950**Verified Bots**: Allowlisted good bots (search engines, AI crawlers) verified via reverse DNS or Web Bot Auth. Access via `cf.bot_management.verified_bot` or `cf.verified_bot_category`.5152## Platform Limits5354| Plan | Bot Scores | JA3/JA4 | Custom Rules | Analytics Retention |55|------|------------|---------|--------------|---------------------|56| Free | No (auto-block only) | No | 5 | N/A (no analytics) |57| Pro/Business | Groupings only | No | 20/100 | 30 days (72h at a time) |58| Enterprise | 1-99 granular | Yes | 1,000+ | 30 days (1 week at a time) |5960## Basic Patterns6162```typescript63// Workers: Check bot score64export default {65async fetch(request: Request): Promise<Response> {66const botScore = request.cf?.botManagement?.score;67if (botScore && botScore < 30 && !request.cf?.botManagement?.verifiedBot) {68return new Response('Bot detected', { status: 403 });69}70return fetch(request);71}72};73```7475```txt76# WAF: Block definite bots77(cf.bot_management.score eq 1 and not cf.bot_management.verified_bot)7879# WAF: Protect sensitive endpoints80(cf.bot_management.score lt 50 and http.request.uri.path in {"/login" "/checkout"} and not cf.bot_management.verified_bot)81```8283## In This Reference8485- [configuration.md](./configuration.md) - Product tiers, WAF rule setup, JavaScript Detections, ML auto-updates86- [api.md](./api.md) - Workers BotManagement interface, WAF fields, JA4 Signals87- [patterns.md](./patterns.md) - E-commerce, API protection, mobile app allowlisting, SEO-friendly handling88- [gotchas.md](./gotchas.md) - False positives/negatives, score=0 issues, JSD limitations, CSP requirements8990## See Also9192- [waf](../waf/) - WAF custom rules for bot enforcement93- [workers](../workers/) - Workers request.cf.botManagement API94- [api-shield](../api-shield/) - API-specific bot protection95