# How robots.txt decides what AI crawlers can read

> Named rules, the longest match, and why a crawler can be allowed and still blocked.

Audit check: Reachable. Source: RFC 9309, the Robots Exclusion Protocol. Last checked 19 Nov 2026.

robots.txt is a plain text file at the root of a site. It lists rules for crawlers, grouped by the name each crawler uses to identify itself. A crawler follows the group that names it. If no group names it, it follows the group for every crawler, written as `User-agent: *`.

## When rules conflict, the longest match wins

An Allow and a Disallow can both match a page. The rule with the longer path wins, so a specific Allow can open one folder inside a blocked one. When the two paths are the same length, Allow wins.

## The copyable example

```text
User-agent: GPTBot
Disallow: /drafts/

User-agent: *
Disallow: /drafts/
Allow: /drafts/published/
```

Here GPTBot is blocked from `/drafts/`, and every other crawler is blocked from `/drafts/` except `/drafts/published/`.

## What Audit checks

Audit reads your robots.txt, applies the rules to the page it checks, and shows which crawlers it allows. It doesn't guess: each result names the rule that decided it.

robots.txt is a request, not a lock. Crawlers that follow the standard honour it. A page that must stay private needs a login or a noindex rule as well.
