Sub topic 13
Keeping your policy up to date
This chapter assumes you have read the earlier chapters. You should know the difference between training crawlers, AI search crawlers, and user-initiated fetchers. You should also be able to write and test a robots.txt file and read an access log. Here you set up a routine that keeps the policy correct as crawlers change.
Why a robots.txt policy goes stale
A robots.txt file matches names. When a vendor adds, renames, or splits a crawler, your file does not change. The behavior you intended then drifts away from the behavior you get.
Three kinds of change cause most of the drift:
- A new token appears. A vendor adds a crawler for a new purpose, such as a separate search crawler. Your
User-agent: *group applies to it. If that group allows everything, the new crawler is allowed, even if you would have blocked it. - A token changes meaning. A vendor moves a function from one crawler to another. A rule that blocked training last year may now cover something else.
- A name is retired or renamed. Your rule still parses, but nothing sends that user agent any more. The file looks protective, and the rule does nothing.
The first case is the common one. Any crawler you have not named falls through to the wildcard group. Your wildcard group is therefore your default policy for every future crawler.
Choose a default on purpose
Pick one of two defaults and write it down.
| Default | Wildcard group | New crawlers are | You must |
|---|---|---|---|
| Open | `User-agent: *` with `Allow: /` | Allowed until you add a block | Watch for new names and block the ones you don't want |
| Closed | `User-agent: *` with `Disallow: /`, plus named allow groups | Blocked until you add an allow | Allow every search engine you want, or you lose traffic |
Most sites choose open. A closed default also blocks Googlebot and Bingbot unless you name them, and a missed name costs you search visibility. An open default fails the other way: a crawler you did not want gets in. Choose the failure you would rather find out about.
Keep the reasons next to the rules. Comments in robots.txt are free, and they show a future maintainer why a rule exists.
# Policy v3, reviewed 2026-11-29
# Default: open. Training crawlers blocked. AI search and user fetches allowed.
# Owner: web team. Review each quarter, or when a vendor announces a new crawler.
User-agent: GPTBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: CCBot
Disallow: /
User-agent: Applebot-Extended
Disallow: /
User-agent: *
Allow: /The dated header helps in two ways. A reader can see how old the file is. It also gives you a string to search for when you want to know which version is live.
Where to learn about changes
Do not rely on news articles. Use the pages the vendors maintain for their own crawlers:
- OpenAI's crawler documentation, which lists GPTBot, OAI-SearchBot, and ChatGPT-User.
- Google's documentation on its crawlers and user-triggered fetchers, which describes Google-Extended.
- Anthropic's, Perplexity's, Apple's, and Common Crawl's crawler pages.
Subscribe to a changelog or RSS feed where one exists. Where none exists, put a recurring reminder in your calendar. Vendor pages tell you what a token is meant to do. Your logs tell you what actually shows up. Use both.
Treat any list of crawler names, including the one in this tutorial, as a snapshot. Check the vendor page before you add or remove a rule.
A review loop
Run the same loop each time, whether the trigger is the calendar or an announcement.
Even when you change nothing, record the review date. A policy with no review date is hard to trust.
Detect drift with a script
You can check by hand that the live file still says what you intended. A script does it more reliably. The one below reads the live robots.txt and compares it with a table of expected outcomes. It exits with status 1 when they differ, so a scheduler can run it and alert you.
import sys
import urllib.request
from urllib.robotparser import RobotFileParser
SITE = "https://example.com"
TEST_URL = SITE + "/articles/guide"
# True means the agent is allowed to fetch TEST_URL.
POLICY = {
"GPTBot": False,
"Google-Extended": False,
"ClaudeBot": False,
"CCBot": False,
"Applebot-Extended": False,
"OAI-SearchBot": True,
"ChatGPT-User": True,
"Googlebot": True,
}
def fetch_rules(site):
request = urllib.request.Request(
site + "/robots.txt",
headers={"User-Agent": "policy-check/1.0"},
)
with urllib.request.urlopen(request, timeout=10) as response:
return response.read().decode("utf-8", errors="replace")
def main():
parser = RobotFileParser()
parser.parse(fetch_rules(SITE).splitlines())
drift = []
for agent, expected in POLICY.items():
actual = parser.can_fetch(agent, TEST_URL)
if actual != expected:
drift.append((agent, expected, actual))
if drift:
for agent, expected, actual in drift:
print(f"DRIFT {agent}: expected {expected}, got {actual}")
return 1
print("Live robots.txt matches policy.")
return 0
if __name__ == "__main__":
sys.exit(main())The script raises an error if robots.txt returns a 404 or a server error. For a scheduled check that is what you want, because a missing file is also a change. Run it from cron or a CI job, and add a deploy step that runs it after every release. Deployments are a common way for a robots.txt file to be overwritten by a staging copy that disallows everything, or by a default that allows everything.
The script can only test names that are in POLICY. It cannot discover new crawlers. That is the job of the next step.
Find crawlers you have not named
Your access log shows every user agent that reached your server. Look for names that contain words like "bot" or "crawl" and that you have not already reviewed. The script below prints the most frequent unreviewed ones from a combined-format log.
import re
import sys
from collections import Counter
# Agents you have already decided about. Add to this list as you review.
REVIEWED = [
"GPTBot", "OAI-SearchBot", "ChatGPT-User", "ClaudeBot",
"PerplexityBot", "CCBot", "Applebot", "Googlebot", "bingbot",
]
USER_AGENT = re.compile(r'"([^"]*)"\s*$')
BOT_HINT = re.compile(r"bot|crawl|spider|fetch|agent", re.IGNORECASE)
def main(path):
counts = Counter()
with open(path, errors="replace") as log:
for line in log:
match = USER_AGENT.search(line)
if not match:
continue
agent = match.group(1)
if not BOT_HINT.search(agent):
continue
if any(name.lower() in agent.lower() for name in REVIEWED):
continue
counts[agent] += 1
for agent, count in counts.most_common(20):
print(count, agent)
if __name__ == "__main__":
main(sys.argv[1])Run it as python find_unknown_bots.py access.log. Each result is a decision to make. You can allow it, block it, or decide it is not worth a rule. Whichever you choose, add the name to REVIEWED so it stops appearing. Over time the output shrinks to the genuinely new names.
The user-agent string is only a claim. A client can send any name, so a log entry that says GPTBot is not proof that OpenAI sent it. When a name matters, check the request's source IP address against the ranges the vendor publishes. Several vendors publish those ranges as machine-readable lists, and some support reverse DNS verification. Re-fetch the lists each time you review, because the ranges change. If your server enforcement uses IP allow-lists, stale ranges will block real crawlers or let in fakes.
When to review
Match the effort to the event. A fixed schedule catches slow drift. An announcement is a reason to review sooner.
| Trigger | What to do |
|---|---|
| Quarterly calendar reminder | Read vendor pages, run the log scan, re-run the policy check |
| A vendor announces a new crawler or token | Read the documentation, decide, update robots.txt, add it to `POLICY` and `REVIEWED` |
| The log scan shows a new frequent bot | Identify the operator, decide, record the decision |
| A deploy touches the web root or CDN rules | Run the policy check and fetch the live file with curl |
| Your goals change, such as a new licensing deal or a push for AI search visibility | Revisit the default and each group, not only the new names |
After any edit, confirm the live file with the commands from the testing chapter:
curl -sI https://example.com/robots.txt | head -n 5
curl -s https://example.com/robots.txt | head -n 3The first command should show a 200 status and a plain text content type. The second should show your new version comment. If a CDN sits in front of your site, a cached old copy can mask your change. Crawlers also cache robots.txt, so a new rule may take a while to take effect. Do not assume a block is active the moment you deploy it.
Common mistakes
- Deleting rules for crawlers you no longer see in logs. A crawler may visit rarely. Remove a rule only when the vendor says the token is retired.
- Treating a vendor's name as a promise of purpose. Read what each token does. For example, Google-Extended is a robots.txt token, not a separate crawler, so you will not find it in your logs. Googlebot makes the requests.
- Updating robots.txt but not the server rules. If you also block by user agent in nginx or at a CDN, update that list too. The two lists drift apart easily.
- Copying a block list from a blog post. Such lists often mix training bots with search bots and block both. Check each name against your own policy.
- Skipping the record. Without a version comment and a review date, nobody can tell whether the file is current.
Exercises
Exercise
Your site uses an open default (User-agent: * with Allow: /) and blocks only GPTBot and ClaudeBot. A vendor releases a new training crawler with a new token. What happens to it, and which step in the review loop finds it?
Show answer
The new crawler matches no named group, so it falls through to the wildcard group and is allowed. The log scan finds it: a bot-like user agent that is not in the reviewed list shows up in the output. You then read the vendor documentation, decide, add a block group, and add the name to both POLICY and REVIEWED.
Exercise
The policy check script passes, but you still see requests with the user agent "GPTBot" from an IP address OpenAI does not publish. What does this tell you, and what should you do next?
Show answer
The script tests only what robots.txt says, and it passes because the file blocks GPTBot. The requests are either from a client that ignores robots.txt, or from one that is faking the name. Compare the source IP with the vendor's published ranges. If it falls outside them, enforce a block on the server for that traffic rather than relying on robots.txt.
Exercise
Why should the review record include a date and a version comment inside robots.txt itself?
Show answer
Anyone can fetch the live file and see its version and last review date. You can confirm that a deploy or a CDN cache shows the new version, and a reader can tell at once how stale the policy might be.