Security, Privacy & EU Regulations Bot Governance & Anti-Scraping
33. Robots, AI Web Scrapers & Bot Mitigation Architecture
Govern AI/LLM crawlers with RFC 9309 and llms.txt, enforce machine-readable EU TDM reservations, analyze JA4 TLS fingerprints, and deploy zero-tracking Proof-of-Work bot defenses.
bots-crawlers-scraping.ts
typescript
// 1. RFC 9309 Robots & AI Crawler Governance Engineexport const AI_SCRAPERS = ['GPTBot', 'ClaudeBot', 'PerplexityBot', 'Bytespider', 'CCBot', 'Google-Extended'] as const;export function evaluateCrawlerPermission(userAgent: string, path: string): { allow: boolean; reason: string } { const isAiScraper = AI_SCRAPERS.some(bot => userAgent.toLowerCase().includes(bot.toLowerCase())); if (isAiScraper && path.startsWith('/labs/')) { return { allow: false, reason: 'EU Copyright Directive Art 4 TDM Reservation' }; } return { allow: true, reason: 'Public Documentation Read Allowed' };}// 2. Client-Side Proof-of-Work (PoW) Anti-Bot Challenge (Altcha standard)export async function solvePowChallenge(challenge: string, difficulty: number): Promise<number> { let nonce = 0; const encoder = new TextEncoder(); while (true) { const data = encoder.encode(`${challenge}:${nonce}`); const hashBuffer = await crypto.subtle.digest('SHA-256', data); const hashArray = new Uint8Array(hashBuffer); // Check leading zero bits let leadingZeros = 0; for (const byte of hashArray) { if (byte === 0) leadingZeros += 8; else { leadingZeros += Math.clz32(byte) - 24; break; } } if (leadingZeros >= difficulty) return nonce; nonce++; }}Robots, AI Scrapers & Bot Defense Engineering
The explosion of autonomous AI scrapers and LLM retrieval agents necessitates modern machine-readable content protocols, lawful copyright opt-outs, and zero-tracking bot mitigation.
- RFC 9309 Robots Exclusion Protocol & AI Governance: Declare deterministic crawl boundaries for major AI scrapers (
GPTBot,ClaudeBot,PerplexityBot,Bytespider). llms.txt&llms-full.txtStandards: Provide curated, structured markdown feeds optimized for AI reasoning and contextual discovery without scraping heavy HTML.- EU TDM &
X-Robots-Tag: noaiReservations: Enforce machine-readable Text and Data Mining reservations under EU Copyright Directive Article 4 (<meta name="tdm-reservation" content="1">) to legally restrict automated model training. - TLS & Network Fingerprinting (JA3 / JA4): Analyze client TLS extension ordering and HTTP/2
SETTINGSframe characteristics at the WAF layer to detect headless scraper runtimes. - Zero-Tracking Proof-of-Work Challenges: Replace invasive, tracking-heavy CAPTCHAs with client-side cryptographic SHA-256 challenges (Altcha standard) that stop automated brute force attacks with zero user profiling.
AI Crawlers, Robots & Anti-Scraping Simulator Robots 2026
OpenAI GPTBot (AI LLM Training Scraper) BLOCKED (TDM / noai Directive)
Machine-readable EU Copyright Art 4 TDM opt-out & X-Robots-Tag: noai enforced.
Zero-Tracking Proof-of-Work Bot Mitigation Difficulty: 10 bits
Clients compute lightweight SHA-256 nonces directly in the browser to defeat scraper brute-forcing without third-party tracking pixels.