robots.txt: throttle/Disallow AI training crawlers (refs #1172) — DRAFT for discussion - #1173
Draft
rdhyee wants to merge 1 commit into
Draft
robots.txt: throttle/Disallow AI training crawlers (refs #1172) — DRAFT for discussion#1173rdhyee wants to merge 1 commit into
rdhyee wants to merge 1 commit into
Conversation
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>
This was referenced Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1172 — a 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-delayfor ClaudeBot (which documents Crawl-delay support and was 26% of all traffic on 2026-06-18),Disallowfor 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 oldbot-protection-middlewarebranch 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)
bot-protection-middleware(Add BotBlockingMiddleware + robots.txt AI bot disallows (#1094) #1094, Eric-declined) — enters Python; least effective; here for completeness./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
Crawl-delaysupport 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