Sub topic 3
OpenAI's three user agents
This chapter covers the three crawlers OpenAI documents: GPTBot, OAI-SearchBot, and ChatGPT-User. It explains what each one does, how to control each with robots.txt, and where the controls overlap or fall short. It assumes you know how robots.txt groups work (covered in the first chapter) and can read HTTP headers and short Python scripts.
Why OpenAI uses three agents
OpenAI splits its web access into three user agents so that site owners can make separate choices about three different uses of their content:
- Training. Collecting pages that may be used to train generative AI models.
- Search. Finding and linking to pages in ChatGPT's search features.
- User-initiated fetching. Loading a page because a person asked ChatGPT to look at it.
Each agent has its own robots.txt token. A rule written for one does not apply to the others, so you can block training and still appear in AI search results.
| Agent | Purpose | Triggered by | robots.txt token |
|---|---|---|---|
| GPTBot | Gathers content that may be used to train generative AI models | OpenAI's automated crawling | `GPTBot` |
| OAI-SearchBot | Finds and surfaces sites in ChatGPT search results | OpenAI's automated crawling for search | `OAI-SearchBot` |
| ChatGPT-User | Fetches a page when a user or a custom GPT asks for it | A person's action inside ChatGPT | `ChatGPT-User` |
OpenAI's documentation is the authority on these details and it changes over time. Check the current crawler documentation before you rely on anything below, especially the ChatGPT-User behavior described later.
GPTBot
GPTBot is the training crawler. Allowing it means your public pages may be included in data used to train future models. Disallowing it tells OpenAI not to use your site for that purpose.
A full block looks like this:
User-agent: GPTBot
Disallow: /Blocking GPTBot does not remove content that was already collected in the past. The rule applies to future crawling. If you need to know what happened before you added the rule, look at your historical access logs (see the monitoring chapter).
GPTBot's user-agent string contains the token GPTBot. A typical request header looks like this:
User-Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; GPTBot/1.1; +https://openai.com/gptbotThe version number can change, but the GPTBot token stays the same. That is why server-side rules match the token and not the whole string.
OAI-SearchBot
OAI-SearchBot supports search. It looks for pages that ChatGPT can cite and link to when it answers a question using web search. OpenAI states that it is not used to crawl content for training generative AI foundation models.
If you want your pages to be discoverable in ChatGPT search, do not block OAI-SearchBot. Blocking it means your site may not appear in those results. OpenAI notes that changes to robots.txt can take some time to be reflected in its systems, so a newly added rule is not instant.
Allowing it explicitly is optional, because a path is allowed by default when no rule blocks it. Many site owners still write the Allow group because it documents intent and protects against a later broad rule.
User-agent: OAI-SearchBot
Allow: /ChatGPT-User
ChatGPT-User is different in kind. It does not crawl on a schedule. A request from ChatGPT-User happens because a person, or a custom GPT acting for a person, asked ChatGPT to open a URL or take an action on the web. Traffic is therefore tied to human interest in your page.
Three points matter here.
- It is not a training crawler. OpenAI describes ChatGPT-User as separate from GPTBot, and says it is not used to crawl content for training.
- robots.txt may apply differently. Automated crawlers follow robots.txt as a rule. For user-initiated fetching, the standard argument is that a person made the request, much like a browser. OpenAI's documentation has described robots.txt rules as possibly not applying to ChatGPT-User for this reason, and the wording has changed over time. Treat a
Disallowfor ChatGPT-User as a request that may not be honored, and confirm the current policy in OpenAI's docs. - Blocking has a user-facing cost. If you block it, someone who pastes your URL into ChatGPT may get an error or an answer without your page's content.
Allowing it is again the default:
User-agent: ChatGPT-User
Allow: /Putting the three together
The most common policy is to opt out of training while staying available for search and user requests. The file below does that. Everything not named falls under the * group.
# Opt out of training, stay available for AI search and user requests
User-agent: GPTBot
Disallow: /
User-agent: OAI-SearchBot
Allow: /
User-agent: ChatGPT-User
Allow: /
User-agent: *
Allow: /The diagram shows how a single request is routed to a group.
A crawler uses the single group that best matches its token and ignores the rest. This is why the * group does not add to the GPTBot group. It only applies to agents that have no group of their own.
Section-level policies
You do not have to choose all or nothing. If part of your site is private or paid, block only that path for training and leave the public articles open.
User-agent: GPTBot
Disallow: /members/
Disallow: /drafts/
User-agent: OAI-SearchBot
Disallow: /members/
Disallow: /drafts/Notice that the second group also hides those paths from search. If members-only content should never appear in AI answers, you must repeat the rule for each agent. A rule for GPTBot never carries over.
Verifying a draft with Python
Before you deploy, test the rules with Python's standard-library parser. The script below checks the three OpenAI agents and one unrelated agent against a draft.
from urllib.robotparser import RobotFileParser
rules = """\
User-agent: GPTBot
Disallow: /
User-agent: OAI-SearchBot
Allow: /
User-agent: ChatGPT-User
Allow: /
User-agent: *
Allow: /
"""
parser = RobotFileParser()
parser.parse(rules.splitlines())
url = "https://example.com/articles/guide"
for agent in ["GPTBot", "OAI-SearchBot", "ChatGPT-User", "SomeOtherBot"]:
print(agent, parser.can_fetch(agent, url))
# GPTBot False
# OAI-SearchBot True
# ChatGPT-User True
# SomeOtherBot TrueThis confirms how the file reads. It does not confirm that OpenAI's systems follow it. For that you need logs.
Common errors
- Blocking everything with one wildcard.
User-agent: *followed byDisallow: /blocks OAI-SearchBot and ChatGPT-User too, along with ordinary search engines. Use named groups when you want a narrow block. - Misspelled tokens. The tokens are case-insensitive in matching, but a typo such as
GPT-Botmatches nothing and the rule silently does nothing. - Assuming one rule covers all three. Blocking GPTBot does not stop OAI-SearchBot or ChatGPT-User. Each needs its own group.
- Expecting instant effect. OpenAI says updates can take time to propagate. Verify with logs after a few days.
- Treating ChatGPT-User like a crawler. Its visits come from user actions, so a block may not hold and may degrade the experience of people who share your links.
- Relying on the user-agent string alone. Anyone can send a header that says
GPTBot. For real enforcement, see the chapters on server-side blocking and crawler verification.
Checking what OpenAI's agents actually do
OpenAI publishes the IP ranges its crawlers use. Fetch the current list from OpenAI's documentation and compare it with the addresses in your logs. A request that claims to be GPTBot but comes from outside those ranges is not OpenAI's crawler. A quick first look at your own logs:
grep -Ei 'GPTBot|OAI-SearchBot|ChatGPT-User' access.log \
| grep -Eio 'GPTBot|OAI-SearchBot|ChatGPT-User' \
| sort | uniq -c | sort -rnIf GPTBot appears after you added a Disallow: / rule and several days have passed, check the source IP before concluding that OpenAI ignored you. An impersonator is the more likely explanation.
Summary
- GPTBot is for training, OAI-SearchBot is for ChatGPT search, and ChatGPT-User is for fetches a person starts.
- Each has its own token and its own group, and rules do not carry over between them.
- Opting out of training does not require leaving search. Block GPTBot and allow OAI-SearchBot.
- ChatGPT-User may not follow robots.txt in the same way as an automated crawler, so check OpenAI's current documentation.
- Test drafts with a parser, then confirm real behavior in logs and with IP checks.
Exercise
A publisher wants to keep its whole site out of OpenAI model training and keep its articles discoverable in ChatGPT search. Its robots.txt currently contains only "User-agent: " followed by "Disallow: /private/". Which groups should it add, and does the existing "" group need to change?
Show answer
Add a "User-agent: GPTBot" group with "Disallow: /" to opt out of training, and a "User-agent: OAI-SearchBot" group with "Allow: /" to stay available for search (the Allow is optional because paths are allowed by default, but it records intent). The "" group does not need to change for this goal, but note that GPTBot and OAI-SearchBot each use their own group and ignore "". Because OAI-SearchBot now has its own group, it no longer inherits "Disallow: /private/". If /private/ must stay out of search, repeat "Disallow: /private/" in the OAI-SearchBot group.
Exercise
Your access log shows requests with a user agent containing GPTBot, two weeks after you added "User-agent: GPTBot / Disallow: /". What should you check before deciding that OpenAI is ignoring your robots.txt?
Show answer
Check that the live file is actually served at the site root with the expected content (for example with curl), and that the token is spelled correctly. Then compare the source IP addresses of those requests with the IP ranges OpenAI publishes. If the addresses are outside the published ranges, the traffic is probably an impersonator, and robots.txt cannot stop it. Block it on the server instead, for example by IP or with other server-level rules.