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.
Glossary
robots.txt

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Master the core directives, tokens, and mechanisms that govern how AI crawlers and search engine bots interact with your web infrastructure.
User-Agent Token
A specific substring in the User-Agent HTTP request header used in a robots.txt file to target a directive block at a particular crawler.
- GPTBot: OpenAI's web crawler for model training data
- CCBot: Common Crawl's open repository bot
- Googlebot: Google's indexing crawler
- Anthropic-AI: Anthropic's content acquisition bot
Each token maps to a distinct organizational crawler with its own compliance behavior.
Disallow & Allow Directives
The two fundamental rules that control crawler access at the path level:
- Disallow:
/private/blocks access to that directory and all subdirectories - Allow:
/private/public/grants an override exception within a disallowed path
Precedence rule: The most specific matching pattern, measured by character length, always takes priority. This enables granular, layered access control policies.
Crawl-Delay Directive
An unofficial but widely supported parameter specifying the number of seconds a crawler should wait between successive requests. While not part of RFC 9309, major bots like Bingbot and YandexBot respect it.
- Example:
Crawl-Delay: 10enforces a 10-second pause - Critical for protecting server resources during AI training data collection surges
- Googlebot ignores this directive; use Google Search Console for rate limiting instead
Sitemap Directive
A robots.txt field that points to the URL of an XML Sitemap, providing an efficient discovery path for crawlers to find all canonical pages a site owner wishes to have indexed.
- Example:
Sitemap: https://example.com/sitemap.xml - Reduces unnecessary crawling of low-value pages
- Supports multiple sitemap declarations for large sites
- Complements robots.txt by guiding bots toward desired content rather than only blocking it
Robots Meta Tag & X-Robots-Tag
Page-level directives that provide crawlers with indexing and serving instructions beyond what robots.txt can express:
- noindex: Prevents the page from appearing in search indices
- nofollow: Instructs crawlers not to follow outbound links
- noarchive: Blocks cached copies in search results
- nosnippet: Suppresses text previews in SERPs
The X-Robots-Tag HTTP header extends these controls to non-HTML resources like PDFs, images, and API responses.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us