Your Vibe-Coded robots.txt Blocks ChatGPT Search. I Wrote a Checker.
DEV Community

Your Vibe-Coded robots.txt Blocks ChatGPT Search. I Wrote a Checker.

A post I saw on X this week put it cleanly: vibe coding isn't ending. It's growing a test suite and a review step, and then nobody calls it vibe coding anymore.

That matches the work I actually do after a marketing site comes out of a coding agent. The review step is usually not a clever exploit. It's a file the agent wrote when someone typed "block AI crawlers from training on our content."

The same shape

I keep seeing the same shape. The comment at the top talks about training. The rules also Disallow the crawlers that ChatGPT, Claude and Perplexity use for search. Google Search still works, so nobody notices for a month.

The site is live, the sitemap line is missing, and three assistant-search crawlers were told to stay away. It doesn't matter whether the site came from Cursor, Claude Code or an AI website builder. If robots.txt treats "AI" as one bucket, this applies.

So I wrote the kind of robots.txt a coding agent produces for that prompt, for a fictional bookkeeping practice called Bramble Books. Then I wrote a short checker, crawler_access.py, that evaluates a dated matrix of official tokens - search, training and user-triggered, which are not the same thing - and says which ones are allowed to fetch /.

I ran it, rewrote the file so the training opt-out stayed and the search crawlers were allowed, and ran it again. All the numbers below come from those two runs.

The Bramble Books fixture

The fixture Bramble Books is fictional. It does bookkeeping for independent shops in Portland. The repo looks like a typical generated marketing site. The file that matters here is robots.txt.

The prompt I used as the model is the one people actually type:

"Add a robots.txt that blocks AI crawlers from training on our content."

The file below is the kind of answer that prompt produces. The comment is about training. The list is the usual blob of names from a public "block AI crawlers" snippet.

# Block AI crawlers from training on our content.
# Generated for the Bramble Books marketing site.
User-agent: GPTBot
Disallow: /
User-agent: ChatGPT-User
Disallow: /
User-agent: OAI-SearchBot
Disallow: /
User-agent: CCBot
Disallow: /
User-agent: anthropic-ai
Disallow: /
User-agent: Claude-Web
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Claude-SearchBot
Disallow: /
User-agent: Claude-User
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: Applebot-Extended
Disallow: /
User-agent: PerplexityBot
Disallow: /
User-agent: Bytespider
Disallow: /
User-agent: meta-externalagent
Disallow: /
User-agent: *
Allow: /

There is no Sitemap: line. There is no llms.txt. Googlebot is not named, so it falls through to User-agent: * and is allowed. That is why this is easy to miss: Google Search still works.

Search vs training tokens

OpenAI documents GPTBot for training and OAI-SearchBot for ChatGPT search, as separate tokens. Anthropic does the same with ClaudeBot and Claude-SearchBot. A Disallow on the training token is a policy choice. A Disallow on the search token can hide the site from that assistant's results.

I used the token list as of 14 November 2026, from the operators' own crawler pages. We keep a dated table of those names in our robots.txt examples for search and AI crawlers, because the names change and old gists do not.

The file also names anthropic-ai and Claude-Web. Those are historical tokens. They do not stand in for Claude-SearchBot.

The checker

The checker crawler_access.py reads a robots.txt - and an llms.txt if you pass one - and evaluates a fixed matrix of official tokens against a path, default /.

It follows Google's matching rules:

  • the most specific (longest) matching User-agent group wins, and * is used only when no named group matches.
  • For the path, the longest matching Allow or Disallow rule wins; a tie prefers Allow.
  • A named group does not inherit the * group's rules, and * does not apply once a named group matches.

It does not fetch the live site, does not check IP ranges, and does not claim a crawler will honor the file. User-triggered fetchers get their own section because OpenAI and Perplexity say robots.txt may not apply to them. A hard block belongs at the edge.

crawler_access.py (about 400 lines)

#!/usr/bin/env python3
"""crawler_access.py - show which official AI/search crawlers a robots.txt allows.
Usage: python3 crawler_access.py fixtures/before
python3 crawler_access.py --robots path/to/robots.txt [--llms path/to/llms.txt]
Evaluates a fixed matrix of operator-documented tokens against the file, using Google's robots.txt matching: the most specific (longest) matching User-agent group wins; * is used only when no named group matches. For a path, the longest matching Allow/Disallow rule wins; a tie prefers Allow.
This does not fetch the live site, does not check IP ranges, and does not claim a robots.txt rule will be honored. User-triggered fetchers are listed separately because some operators say robots.txt may not apply to them.
Token purposes in TOKENS are as of 14 Nov 2026, from each operator's documented crawler page (also summarized in PolyDraft's robots.txt guide).
"""
from __future__ import annotations
import argparse
import sys
from dataclasses import dataclass, field
from pathlib import Path
# purpose: search | training | control | user
# control = a robots.txt token read by an existing crawler, not a User-agent of its own
TOKENS: list[dict[str, str]] = [
# Search
{ "token": "Googlebot", "purpose": "search", "product": "Google Search", "robots": "follows", "note": "also feeds AI Overviews and AI Mode" },
{ "token": "OAI-SearchBot", "purpose": "search", "product": "ChatGPT search", "robots": "follows", "note": "ChatGPT search results; not GPTBot" },
{ "token": "Claude-SearchBot", "purpose": "search", "product": "Claude search", "robots": "follows", "note": "" },
{ "token": "PerplexityBot", "purpose": "search", "product": "Perplexity search", "robots": "follows", "note": "not used to train foundation models, per Perplexity" },
{ "token": "Applebot", "purpose": "search", "product": "Apple search (Siri, Spotlight)", "robots": "follows", "note": "" },
# Training / archive
{ "token": "GPTBot", "purpose": "training", "product": "OpenAI training", "robots": "follows", "note": "training opt-out; does not control ChatGPT search" },
{ "token": "ClaudeBot", "purpose": "training", "product": "Anthropic training", "robots": "follows", "note": "" },
{ "token": "CCBot", "purpose": "training", "product": "Common Crawl", "robots": "follows", "note": "common in 'block AI' snippets" },
{ "token": "Bytespider", "purpose": "training", "product": "ByteDance", "robots": "follows", "note": "common in 'block AI' snippets" },
{ "token": "meta-externalagent", "purpose": "training", "product": "Meta AI training", "robots": "follows", "note": "" },
# Control tokens (not a distinct crawler user-agent)
{ "token": "Google-Extended", "purpose": "control", "product": "Gemini training and grounding", "robots": "token", "note": "token, not a crawler; no effect on Google Search" },
{ "token": "Applebot-Extended", "purpose": "control", "product": "Apple generative training", "robots": "token", "note": "token, not a crawler; does not hide Apple search" },
# User-triggered
{ "token": "ChatGPT-User", "purpose": "user", "product": "ChatGPT user-triggered fetch", "robots": "may-not-apply", "note": "OpenAI: robots.txt rules may not apply" },
{ "token": "Claude-User", "purpose": "user", "product": "Claude user-triggered fetch", "robots": "follows", "note": "Anthropic says its bots honor robots.txt" },
{ "token": "Perplexity-User", "purpose": "user", "product": "Perplexity user-triggered fetch", "robots": "may-not-apply", "note": "Perplexity: generally ignores robots.txt" },
]
# Historical names that still show up in generated "block AI" files.
STALE_TOKENS = {
"anthropic-ai": "current Anthropic tokens are ClaudeBot, Claude-SearchBot, Claude-User",
"claude-web": "current Anthropic tokens are ClaudeBot, Claude-SearchBot, Claude-User",
"chatgpt-user / 1.0": None, # placeholder ignored
}
@dataclass
class Rule:
  kind: str # allow | disallow
  path: str
@dataclass
class Group:
  agents: list[str] = field(default_factory = list)
  rules: list[Rule] = field(default_factory = list)
def parse_robots(text: str) -> tuple[list[Group], list[str], list[str]]:
  """Return (groups, sitemap urls, named user-agent tokens found)."""
  groups: list[Group] = []
  sitemaps: list[str] = []
  current: Group | None = None
  saw_rule = False
  def start_group() -> Group:
    nonlocal current, saw_rule
    current = Group()
    groups.append(current)
    saw_rule = False
    return current
  for raw in text.splitlines():
    line = raw.strip()
    if not line or line.startswith("#"):
      continue
    if ":" not in line:
      continue
    field, _, value = line.partition(":")
    key = field.strip().lower()
    value = value.strip()
    if key == "user-agent":
      if current is None or saw_rule:
        start_group()
      assert current is not None
      if value:
        current.agents.append(value)
    elif key in {"allow", "disallow"}:
      if current is None:
        start_group()
      assert current is not None
      current.rules.append(Rule(key, value))
      saw_rule = True
    elif key == "sitemap":
      if value:
        sitemaps.append(value)
  # Ignore Crawl-delay, Host, Content-signal, and other extensions.
  named = []
  for g in groups:
    for a in g.agents:
      if a != "*":
        named.append(a)
  return groups, sitemaps, named
def _agent_match_length(agent_line: str, token: str) -> int:
  """Longest matching product-token length, or 0. Exact, case-insensitive."""
  a = agent_line.strip().lower()
  t = token.strip().lower()
  if a == "*":
    return 0 # handled separately
  if t == a:
    return len(a)
  return 0
def select_group(groups: list[Group], token: str) -> tuple[Group | None, str]:
  """Pick the most specific matching group. Returns (group, label)."""
  best_len = -1
  matched: list[Group] = []
  for g in groups:
    length = 0
    for a in g.agents:
      length = max(length, _agent_match_length(a, token))
    if length > 0:
      if length > best_len:
        best_len = length
        matched = [g]
      elif length == best_len:
        matched.append(g)
  if matched:
    if len(matched) == 1:
      return matched[0], next(a for a in matched[0].agents if _agent_match_length(a, token) == best_len)
    # Same-length matches: merge rules, Google-style.
    merged = Group(agents = [token], rules = [r for g in matched for r in g.rules])
    return merged, token + " (merged)"
  star = [g for g in groups if any(a.strip() == "*" for a in g.agents)]
  if not star:
    return None, "(no matching group)"
  if len(star) == 1:
    return star[0], "*"
  merged = Group(agents = ["*"], rules = [r for g in star for r in g.rules])
  return merged, "*"
def rule_matches(rule_path: str, url_path: str) -> bool:
  if rule_path == "":
    return False # Prefix match, as in Google's robots.txt spec. A trailing $ is end-anchor.
  path = rule_path
  anchored = False
  if path.endswith("$"):
    anchored = True
    path = path[:-1]
  if not url_path.startswith(path):
    return False
  if anchored and url_path != path:
    return False
  return True
def allowed(group: Group | None, url_path: str = "/") -> bool:
  if group is None:
    return True # no rules for this agent: allow
  applicable: list[Rule] = []
  for r in group.rules:
    if r.path == "" and r.kind == "disallow":
      # "Disallow:" with no path means allow all, and is not a match.
      continue
    if r.path == "" and r.kind == "allow":
      continue
    if rule_matches(r.path, url_path):
      applicable.append(r)
  if not applicable:
    return True
  best_len = max(len(r.path.rstrip("$")) for r in applicable)
  top = [r for r in applicable if len(r.path.rstrip("$")) == best_len]
  if any(r.kind == "allow" for r in top):
    return True
  return False
def assess_llms(path: Path | None) -> tuple[str, list[str]]:
  if path is None or not path.is_file():
    return "missing", ["optional; Google Search does not use this file"]
  text = path.read_text(encoding = "utf-8", errors = "replace")
  notes = []
  if not text.strip():
    return "empty", ["file is present but empty"]
  has_heading = any(ln.startswith("# ") for ln in text.splitlines())
  has_link = any("](" in ln or ln.strip().startswith("http") for ln in text.splitlines())
  if not has_heading:
    notes.append("no Markdown heading")
  if not has_link:
    notes.append("no links to source pages")
  status = "present" if has_heading and has_link else "present, incomplete"
  if has_heading and has_link:
    notes.append("has a heading and at least one link")
  notes.append("optional; Google Search does not use this file")
  return status, notes
def fmt_block(allowed_flag: bool) -> str:
  return "ALLOW" if allowed_flag else "BLOCK"
def inspect(robots_path: Path, llms_path: Path | None, path: str = "/") -> str:
  text = robots_path.read_text(encoding = "utf-8", errors = "replace")
  groups, sitemaps, named = parse_robots(text)
  lines: list[str] = []
  lines.append(f"crawler-accessrobots.txt{robots_path}")
  if llms_path is None:
    lines.append("llms.txtMISSING")
  elif llms_path.is_file():
    lines.append(f"llms.txt{llms_path}")
  else:
    lines.append(f"llms.txtMISSING ({llms_path})")
  if sitemaps:
    for i, s in enumerate(sitemaps):
      prefix = "Sitemap:" if i == 0 else ""
      lines.append(prefix + s)
  else:
    lines.append("Sitemap:(none)")
  lines.append("")
  lines.append(f"POLICY MATRIX(path {path})")
  lines.append("")
  results: dict[str, dict] = {}
  for spec in TOKENS:
    group, label = select_group(groups, spec["token"])
    ok = allowed(group, path)
    results[spec["token"]] = {"allow": ok, "group": label, **spec}
  sections = [("SEARCH (blocking these can hide the
Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.