Skip to content

robots.txt: throttle/Disallow AI training crawlers (refs #1172) — DRAFT for discussion - #1173

Draft
rdhyee wants to merge 1 commit into
masterfrom
fix/robots-ai-crawler-throttle
Draft

robots.txt: throttle/Disallow AI training crawlers (refs #1172) — DRAFT for discussion#1173
rdhyee wants to merge 1 commit into
masterfrom
fix/robots-ai-crawler-throttle

Conversation

@rdhyee

@rdhyee rdhyee commented Jun 18, 2026

Copy link
Copy Markdown
Member

Refs #1172a concrete, low-risk starting point for this morning's discussion, not a merge-now proposal.

What this changes

Adds AI-crawler handling to robots.txt (the polite layer): Crawl-delay for ClaudeBot (which documents Crawl-delay support and was 26% of all traffic on 2026-06-18), Disallow for pure-training crawlers (GPTBot, CCBot, Bytespider, Amazonbot, meta-externalagent, Diffbot, cohere-ai, PerplexityBot). AI search agents are left allowed for discoverability, and Googlebot is untouched (SEO). Uses 4.2-safe {% if %} (the old bot-protection-middleware branch used {% ifequal %}, which is removed in Django 4.2).

Important history — this revisits a decision (read before reacting)

PR #1094 (BotBlockingMiddleware + robots AI-disallows) was closed 2026-03-31 with: "Eric directed to focus on simplification rather than direct bot mitigation. The faceted search removal (#1116) addresses the root cause (URL explosion) rather than blocking bots at the middleware level."

What's changed since then: the AI-crawler surge is now acute (ClaudeBot alone 124k req/26% on the freshly-cut-over box), and the new 4.2 box runs 3–4× hotter than old blue on identical hardware (#1172). So the question is genuinely back open — but this PR deliberately stays on the robots.txt side (ask-nicely), not the middleware Eric declined.

The options to decide together (this PR is only #1)

  1. robots.txt (this PR) — polite, low-risk, but voluntary (no hard guarantee).
  2. Apache pre-mod_wsgi UA rejection (provisioning repo) — the only hard + cheapest lever (never enters Python). The real fix if we want enforcement.
  3. bot-protection-middleware (Add BotBlockingMiddleware + robots.txt AI bot disallows (#1094) #1094, Eric-declined) — enters Python; least effective; here for completeness.
  4. Root-cause, Eric-aligned: is the 3–4× CPU a Django 4.2 /work/ perf regression, not just crawler volume? (unglue.it (new Django 4.2 box) CPU-saturated by AI crawlers — load 27 on 4 cores (ClaudeBot = 26% of traffic) #1172 has a 10–15-min block-and-measure test.) If so, that's the simplification-flavored fix Eric prefers.

Decisions flagged inline for review

  • ClaudeBot: throttle (Crawl-delay 30) vs full Disallow? (throttle keeps us discoverable.)
  • Keep AI-search bots (OAI-SearchBot / Claude-SearchBot) allowed? (discoverability vs load.)
  • Note: Crawl-delay support is real for ClaudeBot but unreliable generally — don't treat robots.txt as enforcement.

Provenance (deliberate disclosure): rbotyee+Claude diagnosis + this change; rbotyee+Codex adversarial review (corrected the mitigation levers, robots/Crawl-delay claims, and surfaced the prior branch); curated by @rdhyee, not yet human-verified end-to-end. See #1172.

🤖 Generated with Claude Code

ClaudeBot (26% of traffic) + GPTBot were saturating the new 4.2 box.
Adds per-bot stanzas: Crawl-delay for ClaudeBot (documents support),
Disallow for pure-training crawlers; AI search agents left allowed for
discoverability (flagged for review); Googlebot untouched. Uses 4.2-safe
{% if %} (the prior bot-protection branch used {% ifequal %}, removed in 4.2).

Co-authored-by: Claude (rbotyee+Claude) <noreply@anthropic.com>
Co-authored-by: Codex (rbotyee+Codex) <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

1 participant