All guides

DEVOMNITOOLS / Developer guides

Robots.txt Architecture, RFC 9309 Standards & AI Scraper Governance

Master official IETF RFC 9309 precedence rules, configure defensive directives for AI bots (GPTBot, ClaudeBot), and avoid crawl-blocking HTTP errors.

DevOmniTools Published: 3 min read
RFC 9309 robots.txt precedence matrix and AI crawler containment architecture diagram

Key takeaways

  • IETF RFC 9309 establishes the formal standard for robots.txt, mandating longest-match path precedence.
  • In equal-length path conflicts between Allow and Disallow directives, RFC 9309 explicitly dictates that Allow wins.
  • HTTP 403 and 401 response codes on robots.txt trigger a full site crawl block, whereas HTTP 404 grants unrestricted access.

RFC 9309 Robots.txt Parser Precedence & AI Crawler Directives Flowchart

For nearly three decades, the robots.txt protocol operated as an informal, de facto convention across web infrastructure. In September 2022, the Internet Engineering Task Force (IETF) codified the specification into RFC 9309: Robots Exclusion Protocol.

Understanding RFC 9309 is essential for engineering scalable web applications that protect proprietary data from unconsented LLM training scrapers while ensuring flawless crawlability for search engines.

To test, validate, and debug your site’s directives in real-time, use the robots.txt tester. For comprehensive cryptographic and client-side web utility workflows, explore the token generator and the AES-256 encryption guide.


RFC 9309 Precedence Matrix & Wildcard Resolution

RFC 9309 establishes deterministic rules for resolving overlapping Allow and Disallow directives. Search engine crawlers (Googlebot, Bingbot, YandexBot) execute this algorithm strictly:

1. The Longest-Match Rule

Directives are evaluated based on path length (character count). The rule with the greatest number of octets in the path pattern takes absolute priority, regardless of declaration order in the file:

User-agent: *
Disallow: /catalog/
Allow: /catalog/public-sample.html
  • When accessing /catalog/public-sample.html, the Allow path is 27 characters, while the Disallow path is 9 characters.
  • Result: Allow wins. The page is crawlable.

2. Equal-Length Tiebreaker (Allow Always Wins)

When an Allow and a Disallow rule match a URI with the exact same character length:

User-agent: *
Disallow: /api/v1
Allow: /api/v1
  • Under RFC 9309 Section 2.2.2, the least restrictive directive takes precedence.
  • Result: Allow wins. The crawler is permitted to access /api/v1.

3. Wildcard Semantics (* and $)

  • * matches 0 or more valid characters.
  • $ anchors the pattern to the end of the URL string.
# Disallow all PDF documents across all subdirectories
Disallow: /*.pdf$

# Permit a specific technical whitepaper
Allow: /docs/architecture-whitepaper.pdf$

Governing AI Scraping Engines & LLM Crawlers

Modern generative AI models rely on autonomous crawlers to harvest training data. These bots operate independently from primary search engine crawlers:

Crawler IdentityUser-Agent TokenOperator / ObjectiveRecommended Action
GPTBotGPTBotOpenAI (Model pre-training)Block if content is proprietary
ChatGPT-UserChatGPT-UserOpenAI (Real-time user queries)Allow if referral traffic is desired
ClaudeBotClaudeBotAnthropic (Model training)Block selectively per directory
PerplexityBotPerplexityBotPerplexity AI (Search citations)Allow for AI citability and traffic
CCBotCCBotCommon Crawl (Public dataset)Disallow to prevent open scraping
BytespiderBytespiderByteDance / TikTokRate-limit or disallow high-frequency paths
# Recommended Enterprise AI Crawler Governance Structure
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
Disallow: /

User-agent: PerplexityBot
Allow: /
Disallow: /api/
Disallow: /internal/

# Explicit search engine crawler permission
User-agent: Googlebot
User-agent: Bingbot
Allow: /
Disallow: /internal/

# Sitemap Declaration
Sitemap: https://www.devomnitools.com/sitemap-index.xml

HTTP Status Codes & Error Handling

How your web server serves robots.txt dictates crawl behavior:

  1. HTTP 200 (OK): The crawler parses and applies the directives.
  2. HTTP 401 / 403 (Unauthorized / Forbidden): The crawler assumes a complete crawl block (Disallow: /). No pages will be crawled.
  3. HTTP 404 (Not Found): The crawler assumes full access (Allow: /). All non-restricted pages will be crawled.
  4. HTTP 5xx (Server Error): The crawler halts crawling immediately and retries later, preserving server stability while preventing unintended indexing.

FAQ

What is IETF RFC 9309 and why does it matter?

Published in September 2022, RFC 9309 formalizes the Robots Exclusion Protocol (REP) developed by Martijn Koster in 1994. It standardizes wildcard syntax (* and $), establishes path length precedence, specifies HTTP status code error handling, and sets a 500 KiB file parsing limit.

How should modern AI scrapers (GPTBot, ClaudeBot, CCBot) be controlled in robots.txt?

Target each AI crawler by its specific User-agent token. For instance, declare 'User-agent: GPTBot' with 'Disallow: /' to block OpenAI model training without affecting search indexing crawlers like Googlebot or Bingbot.

What happens when an Allow rule and a Disallow rule have identical path lengths?

Under RFC 9309 Section 2.2.2, when two conflicting directives have the exact same length in octets, the least restrictive directive applies: Allow takes precedence over Disallow.