Inferensys

Glossary

robots.txt

A plain text file placed at the root of a web server that implements the Robots Exclusion Protocol (REP) to instruct automated crawlers which parts of a site they are permitted to access.
Developer reviewing semantic search engine results on laptop, relevance scores visible, technical search demo.
ROBOTS EXCLUSION PROTOCOL

What is robots.txt?

A plain text file placed at the root of a web server that implements the Robots Exclusion Protocol (REP) to instruct automated crawlers which parts of a site they are permitted to access.

A robots.txt file is a machine-readable text document hosted at the root of a web domain (e.g., /robots.txt) that serves as the primary access policy for automated crawlers. It implements the Robots Exclusion Protocol (REP), formally standardized in RFC 9309, by defining Allow and Disallow directives scoped to specific User-Agent tokens, thereby instructing compliant bots—including AI data scrapers like GPTBot and CCBot—which URL paths they may or may not fetch.

While robots.txt is a voluntary protocol with no enforcement mechanism, it functions as a critical first line of defense in retrieval-bot access management. Site owners use wildcard pattern matching and Sitemap directives to optimize crawl budget allocation. However, malicious actors often bypass these rules through User-Agent spoofing, making robots.txt a necessary but insufficient component of a broader web scraping mitigation strategy that includes rate limiting and behavioral fingerprinting.

CRAWLER GOVERNANCE

Key Characteristics of robots.txt

The robots.txt file is the foundational mechanism of the Robots Exclusion Protocol (REP), acting as a voluntary access policy that compliant crawlers parse before fetching resources from a web server.

01

Plain Text Protocol

A robots.txt file is a strictly formatted plain text file hosted at the root of a domain (e.g., /robots.txt). It follows the syntax standardized in RFC 9309, using line-based records to define access groups. The file must be served with a text/plain MIME type and is limited to 500 kibibytes in size; crawlers ignore any content beyond this limit. The protocol supports UTF-8 encoding for internationalized domain names and paths.

500 KiB
Max Parseable Size
RFC 9309
Governing Standard
02

User-Agent Targeting

Directives are organized into rule groups, each beginning with a User-agent: line that specifies the target crawler. A group applies only to the bot whose User-Agent token matches the declared value. The * wildcard token targets all crawlers not explicitly addressed by a more specific group. This allows site owners to maintain a general policy while carving out exceptions for specific bots like Googlebot or GPTBot.

*
Universal Wildcard
GPTBot
OpenAI's Token
03

Disallow and Allow Directives

Access control is implemented through two core directives:

  • Disallow: Blocks a crawler from accessing a specified relative path and all subdirectories. A Disallow: / directive blocks the entire site.
  • Allow: Grants access to a specific subdirectory or file that would otherwise be blocked by a broader Disallow rule, enabling granular overrides. When multiple patterns match a URL, the most specific rule (longest character match) takes precedence, not the order of declaration.
04

Wildcard and Pattern Matching

The protocol supports limited pattern matching to define rules for dynamic URL spaces:

  • * (Asterisk): Matches any sequence of zero or more characters. For example, Disallow: /*.pdf$ blocks all PDF files.
  • $ (Dollar Sign): Anchors the pattern to the end of the URL path, ensuring an exact suffix match. Crawlers evaluate the requested URL path against these patterns using a defined algorithmic matching process to determine authorization.
05

Sitemap Discovery

The Sitemap: directive provides an efficient discovery mechanism for crawlers. It points to the absolute URL of an XML Sitemap, which lists all canonical pages a site owner wishes to have indexed. This directive is not bound to a specific User-Agent group and can appear anywhere in the file. It is a critical complement to access rules, ensuring that allowed content is efficiently discovered and crawled.

06

Voluntary Compliance Model

The Robots Exclusion Protocol is a voluntary standard, not an enforceable security mechanism. Well-behaved crawlers from major search engines and AI labs respect the directives. However, malicious scrapers, email harvesters, and some unauthorized AI training bots may ignore the file entirely or use User-Agent spoofing to bypass restrictions. Therefore, robots.txt should be part of a defense-in-depth strategy that includes rate limiting and firewall rules.

ROBOTS.TX FAQ

Frequently Asked Questions

Precise answers to the most common technical questions about the Robots Exclusion Protocol and the robots.txt file, targeting the queries developers and infrastructure engineers actually search for.

A robots.txt file is a plain text file placed at the root of a web server that implements the Robots Exclusion Protocol (REP) to instruct automated crawlers which parts of a site they are permitted to access. When a compliant crawler visits a site, it first requests /robots.txt and parses the file according to RFC 9309. The file contains one or more groups, each starting with a User-agent line specifying the target bot, followed by Disallow and Allow directives with path patterns. The crawler compares the URL it intends to fetch against these patterns using path matching logic. If a match is found in a Disallow rule and not overridden by a more specific Allow rule, the crawler must not access that URL. Critically, robots.txt is an advisory protocol—it relies on voluntary compliance by well-behaved crawlers like Googlebot and GPTBot, and offers no technical enforcement against malicious bots that ignore it.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.