How robots.txt governs AI crawlers
robots.txt lives at the root of your domain and lists rules grouped by user-agent. It’s standardized as RFC 9309, the Robots Exclusion Protocol. Two rules from that spec surprise people and cause most misconfigurations:
- A crawler obeys only the single most specific matching user-agent group—not a union of groups. If a group names the bot (e.g. GPTBot), the wildcard * group is ignored entirely for that bot.
- Within a group, the most specific path rule wins (the one matching the most characters); on an exact tie, Allow beats Disallow. If no rule matches, the URL is allowed by default.
Anatomy
# https://example.com/robots.txt
User-agent: GPTBot
Disallow: /
User-agent: OAI-SearchBot
Allow: /
User-agent: *
Allow: /
Sitemap: https://example.com/sitemap.xmlBecause named groups override the wildcard, a bot listed in its own group ignores your `User-agent: *` rules completely. Don’t assume a global rule also covers a specifically-named bot.
One more crucial limit: robots.txt is a published preference, not access control. Compliant bots honor it; bad actors ignore it. It also isn’t a de-indexing tool (see below).
Sources & further reading
- RFC 9309 — Robots Exclusion Protocol — The IETF standard: group matching, longest-match precedence, allow-wins-on-tie, default-allow.
- How Google interprets the robots.txt specification — Google’s exact handling of groups, Allow/Disallow, and wildcards.
