Robots.txt grouping is the logical structure defined in RFC 9309 where a User-Agent token declaration and its subsequent Disallow or Allow directives form a distinct, autonomous rule block. Each group begins with one or more User-Agent lines and ends at the next User-Agent declaration, creating a scoped policy that applies only to the specified crawler.
Glossary
robots.txt Grouping

What is robots.txt Grouping?
The fundamental structural mechanism in a robots.txt file where a User-Agent line is followed by one or more directive lines, forming a rule group that applies exclusively to that bot.
A single robots.txt file contains multiple independent groups, allowing webmasters to define separate access policies for different bots like Googlebot and GPTBot. When a crawler parses the file, it must identify the most specific group matching its user-agent token and obey only that block's directives, ignoring rules defined for other agents.
Key Characteristics of a Rule Group
A rule group is the fundamental structural unit of a robots.txt file, binding a specific crawler identity to a set of access directives. Each group defines a self-contained access policy.
User-Agent Declaration
Every rule group begins with a User-agent: line, which acts as the group's header and target selector. The token following this field specifies which crawler the subsequent directives apply to.
- Case-insensitive matching: The token is matched case-insensitively against the crawler's User-Agent HTTP header.
- Specificity: A group targeting
User-agent: GPTBotapplies only to OpenAI's crawler, whileUser-agent: *acts as a catch-all for any crawler not explicitly named in another group. - Multiple declarations: A single group can list multiple
User-agentlines consecutively to apply the same rules to several bots, e.g.,User-agent: GPTBotfollowed byUser-agent: CCBot.
Directive Stacking
Following the User-agent line, one or more directive lines form the body of the rule group. These directives are processed sequentially by a compliant parser to determine access rights for a given URL path.
- Disallow: The primary restrictive rule, e.g.,
Disallow: /private/, blocks access to any path starting with/private/. - Allow: An override mechanism used to carve out exceptions from a broader
Disallowrule, e.g.,Allow: /private/public-report.pdf. - Non-standard extensions: Directives like
Crawl-delay: 10can be included to set a politeness policy, though they are not part of the core RFC 9309 standard.
Group Termination & Separation
A rule group is terminated by the start of the next User-agent line or by the end of the file. The boundary between groups is critical for determining which policy applies to a crawler.
- First-match wins: When a crawler parses the file, it must find the most specific group that matches its User-Agent token. If
GPTBotis explicitly defined, it uses that group and ignores theUser-agent: *group entirely. - Blank lines: Empty lines between groups are ignored by parsers and are used purely for human readability to visually separate distinct bot policies.
- Group isolation: Directives in one group have zero effect on crawlers targeted by a different group, ensuring complete policy isolation.
Path Matching Logic
Within a rule group, the path specified in a Disallow or Allow directive is matched against the requested URL's path component using a defined algorithm from RFC 9309.
- Prefix matching: A rule like
Disallow: /apimatches/api,/api/v1/, and/apiary, because it functions as a prefix match. - Wildcard character: The
*token matches any sequence of characters.Disallow: /*.pdf$blocks all PDF files when combined with the end-of-path anchor$. - Precedence by specificity: If multiple directives match a URL, the most specific rule (the one with the longest matching character sequence) takes precedence. An
Allowrule with a longer path overrides a shorterDisallowrule.
Global vs. Specific Policy
The interaction between a specific bot's rule group and the universal User-agent: * group forms the basis of a site's access control hierarchy.
- Explicit targeting: A group for
User-agent: Googlebotprovides a custom policy that overrides the default catch-all rules. - Fallback mechanism: If a crawler's User-Agent token does not match any explicitly named group, it must obey the directives in the
User-agent: *group. - Complete denial: To block all compliant crawlers from a section, a single
Disallow: /sensitivedirective in the*group is sufficient, unless a specific group uses anAllowoverride for that path.
Sitemap Cross-Referencing
Although not a directive that controls access, the Sitemap field is often placed at the end of a robots.txt file, outside of any specific rule group, to point crawlers to an index of canonical URLs.
- Global scope: A
Sitemap: https://example.com/sitemap.xmlline is not bound to anyUser-agentand serves as a discovery hint for any crawler that supports the standard. - Multiple sitemaps: Several
Sitemaplines can be listed to reference multiple sitemap files or sitemap index files. - Efficiency: This mechanism allows a crawler to bypass exhaustive site crawling for discovery, directly fetching the list of URLs the site owner wishes to have indexed.
Frequently Asked Questions
Clear answers to common questions about how robots.txt rule groups function, how directives are parsed, and how to structure access controls for AI crawlers.
A robots.txt group is a structural block within a robots.txt file that binds one or more Disallow or Allow directives to a specific User-Agent token. Each group begins with a User-Agent line, and all subsequent directive lines belong to that group until the next User-Agent line appears. When a compliant crawler like GPTBot or Googlebot requests a URL, it locates the group that most specifically matches its own user-agent token and applies only the rules within that group. If no matching group exists, the crawler falls back to the User-Agent: * wildcard group. This grouping mechanism, formalized in RFC 9309, allows site owners to define distinct access policies for different bots—for example, blocking AI training crawlers while permitting search engine indexers—within a single file.
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 structural components that govern how autonomous AI crawlers interpret access permissions for enterprise web resources.
Disallow Directive
The primary exclusion rule within a group that instructs compliant crawlers to avoid a specified relative path. An empty Disallow value grants full access to the entire site.
Disallow: /private/blocks the directory and all subdirectoriesDisallow: /blocks the entire siteDisallow:(empty) permits unrestricted crawling
Multiple Disallow lines can stack within a single group to create cumulative exclusion zones.
Allow Directive
A granular override mechanism that carves out exceptions from broader Disallow rules. The most specific matching pattern, measured by character length precedence, wins the conflict.
Disallow: /archive/combined withAllow: /archive/public/permits access to the public subdirectory only- Essential for complex content architectures where blanket blocks would inadvertently hide valuable resources
- Supported by all major crawlers per RFC 9309
Crawl-Delay Directive
An unofficial but widely adopted parameter specifying the minimum delay in seconds between successive requests. Prevents server overload from aggressive AI crawlers.
Crawl-Delay: 10enforces a 10-second pause- Respected by GPTBot, CCBot, and Bingbot
- Googlebot ignores this directive; use Google Search Console for rate control
- Critical for protecting origin server health during large-scale AI ingestion events
Sitemap Directive
A discovery optimization field that points crawlers to the canonical XML Sitemap URL. Unlike path rules, this directive is not group-specific and can appear anywhere in the file.
Sitemap: https://example.com/sitemap.xml- Provides an efficient alternative to link-graph discovery
- Reduces wasted crawl budget on low-value pages
- Multiple Sitemap directives are permitted for large-scale enterprise sites
Path Matching & Precedence
The algorithmic core of robots.txt interpretation. Crawlers compare requested URLs against directive patterns using prefix matching with wildcard support.
*matches any character sequence (including empty)$anchors the pattern to the end of the URL path- Longest match wins: a 25-character pattern overrides a 10-character one
Disallow: /*.pdf$blocks all PDF files site-wide
Understanding precedence prevents accidental data exposure through misconfigured overrides.

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