Skip to content

hotfix: bypass per-IP rate limit for known AI crawler UAs - #617

Merged
Flotapponnier merged 1 commit into
mainfrom
hotfix/ai-crawler-bypass-rate-limit-v2
Jun 21, 2026
Merged

hotfix: bypass per-IP rate limit for known AI crawler UAs#617
Flotapponnier merged 1 commit into
mainfrom
hotfix/ai-crawler-bypass-rate-limit-v2

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Cherry-pick of #615 (dev). Bypasses the in-memory token bucket on read-only API endpoints (/api/citable, /api/llm-context, /api/stat, /api/mcp, /api/freshness, /api/series, etc.) when User-Agent matches a known AI crawler pattern (GPTBot, ChatGPT-User, PerplexityBot, Perplexity-User, ClaudeBot, anthropic-ai, Google-Extended, Meta-ExternalAgent, Bytespider, cohere-ai, Diffbot, AI2Bot, etc.).

Pattern matches the full robots.txt allowlist plus a few extras. Western LLM coverage approx 95 percent. Chinese models other than ByteDance (Bytespider) do not publish a documented bot UA, so they remain throttled by design.

UA spoofing is possible but the affected endpoints are read-only and explicitly designed to be cited, so the worst case is what we already want.

* feat(rate-limit): bypass per-IP throttle for known AI crawler user agents

* rate-limit: expand AI bot allowlist to match robots.txt

Adds Meta-ExternalAgent, Meta-ExternalFetcher, cohere-ai, Perplexity-User
(all already in robots.txt), plus AI2Bot, Ai2Bot-Dolma, Kagibot,
FacebookBot, MistralAI-User, TimpiBot, Webzio-Extended for completeness.
Comment now states the regex must stay in sync with src/app/robots.ts.

Western LLM coverage is at ~95 percent after this. Chinese models other
than ByteDance (Bytespider) do not publish a documented bot UA, so they
fetch via generic browser UAs and stay throttled by design.
@Flotapponnier
Flotapponnier merged commit 18072c9 into main Jun 21, 2026
@Flotapponnier
Flotapponnier deleted the hotfix/ai-crawler-bypass-rate-limit-v2 branch June 21, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant