Researchai crawlers
Back to writing

Crawler policy

Robots.txt Allow and Disallow: rules and examples

The public robots file tells cooperating crawlers where to go. Privacy begins at the server.

Find your robots.txt answer
Monochrome generative point study “Sevenfold Echo,” a mathematical form rendered in black and white.

Robots.txt Allow and Disallow control cooperative crawling: select the crawler’s group, then use the longest matching path; Allow wins an equal match. They don’t protect a private file: the server must refuse unauthorized requests.

Disallow all crawling, or allow one exception

Disallow every path for the wildcard group
User-agent: *
Disallow: /
Allow one exact path inside a blocked directory
User-agent: *
Disallow: /drafts/
Allow: /drafts/public-guide$

These are two separate example files. A named group such as Googlebot doesn’t inherit the wildcard group: repeat the restrictions there if that crawler should follow them too. The final $ makes the second exception exact, so adding ?lang=en changes its result.

Trace the group, the rule, and the result

Choose one of the eight worked cases. The same /drafts/plan path is blocked for ExampleCrawler and allowed for Googlebot because they select different groups.

ExampleCrawler requests /drafts/public-guide?lang=en

  1. Select the group. User-agent: * applies because this file has no ExampleCrawler group.
  2. Compare matching paths. Disallow: /drafts/ matches. The Allow ending in $ doesn’t match the query suffix.
  3. Crawl disallowed. Disallow: /drafts/ decides this case.
Read the two-group example file
User-agent: *
Disallow: /drafts/
Allow: /drafts/public-guide$
Disallow: /search?

User-agent: Googlebot
Disallow: /staging/
Allow: /staging/release-notes$

Illustrative matching on example.com, using the eight-case CSV and its example policy. Choices run in your browser; no URL is fetched. The table below contains every case without JavaScript. A permitted crawl doesn’t establish indexing or authorization.

Start with the result you need

Follow your question to a worked example or repair.
Your questionWhere to look
Disallow a directory or allow an exceptionSelect the crawler group, then compare the matching paths.
Indexed, though blocked by robots.txtChoose inclusion or removal; verify Google can read the intended response.
Wildcards and path matchingRun 18 named cases for prefixes, queries, end markers and group selection.
Crawler directives decision tableChoose a response for crawling, indexing, private access or duplicate URLs.
Robots.txt errors and cachingDistinguish missing policy, server failure and a last-good cached copy.
Crawl-delay provider supportCompare documented support and run a finite owned-host pacing example.
Keep a public page out of SearchDeliver noindex where the indexer can retrieve it.
Protect a private documentDeny unauthorized requests before a shared cache can expose the body.

The protocol’s matching rules govern cooperative fetching. For training, AI search and user-triggered retrieval, use the separate AI crawler policy guide.

Publishing /private/account in robots.txt gives strangers an address and asks cooperating crawlers to avoid it. The server still decides what happens when someone requests it. I would test the private response with an uncooperative client before trusting a rule that depends on courtesy.

RFC 9309 distinguishes crawler rules from authorization. Can a client ignoring robots.txt still obtain the private document? That test includes shared caches: a correct application check can be bypassed when an intermediary serves a saved body to the next requester.

Method & limits

This is a control-design argument. RFC 9309 and RFC 9111 were read October 25, 2026. Google’s robots limitations were checked September 10, 2026; matching examples and robots/noindex documentation were checked October 23, 2026. Other source dates are listed below. Shell requests and the cache-warm scenario are proposed tests for an owned host. No endpoint, proxy, cache configuration, deployment, or intrusion was exercised or certified. The download is a teaching fixture, not deployed policy or a third-party crawler test. The interactive walkthrough reuses the eight expected decisions; its choices run locally without fetching a URL. RFC 9309 and Google’s group and path rules were rechecked October 28, 2026.

The selected group determines Allow and Disallow

A crawler directive needs a URL and a matching rule before it has an observable result. In this example, every test URL is on https://example.com. ExampleCrawler uses the wildcard group; Googlebot has its own group. Google’s group-selection rules explain why the second group does not inherit restrictions from the first.

Within the selected group, the most specific matching path wins. An equally specific Allow takes precedence over Disallow. Matching is case-sensitive, and a final $ anchors a rule to the end of the path and query. RFC 9309’s matching rules and Google’s wildcard examples describe those decisions.

A robots.txt example with two independent crawler groups

This teaching fixture demonstrates matching. It does not secure either directory. If a restriction should apply to Googlebot too, include it in that group.

User-agent: *
Disallow: /drafts/
Allow: /drafts/public-guide$
Disallow: /search?

User-agent: Googlebot
Disallow: /staging/
Allow: /staging/release-notes$

Eight paths, two crawler groups

The eight-case download places each expected decision beside its path. Run the example policy through a parser to compare them. The result tests rule matching; requests and later uses need their own observations.

  • Allow does not override every Disallow: specificity decides between matching rules.
  • Disallow: / asks a cooperative crawler to avoid the whole site. An empty Disallow value imposes no path restriction.
  • A missing matching rule permits the fetch. Keep a separate server-side permission check for private resources.
  • A copied User-Agent does not prove crawler identity; this table evaluates a claimed product token only.
Expected fetch decisions for this exact example file; Yes means permitted by these crawl rules, not authenticated or guaranteed to be indexed.
CrawlerSelected groupPath and queryFetch permitted?Matching reason
ExampleCrawler*/drafts/planNoThe /drafts/ prefix is disallowed.
ExampleCrawler*/drafts/public-guideYesThe longer Allow rule matches the complete URL path.
ExampleCrawler*/drafts/public-guide?lang=enNoThe final $ prevents that Allow rule matching a query suffix.
ExampleCrawler*/search?q=toolsNoThe path and query start with /search?.
ExampleCrawler*/Search?q=toolsYesPath matching is case-sensitive; no rule matches this capital S.
GooglebotGooglebot/drafts/planYesThe specific Googlebot group does not inherit the * group.
GooglebotGooglebot/staging/buildNoThe selected group disallows /staging/.
GooglebotGooglebot/staging/release-notesYesThe longer Allow rule wins inside the selected group.

The AI-crawler policy examples apply these rules to named products. The crawler-compliance review compares documented intent with observed behavior.

The desired outcome chooses the control

A public faceted catalogue can rely on cooperative crawl preferences. An account document must stay private when a client lies about its identity or ignores the policy. Putting both jobs in robots.txt leaves the harder one unenforced.

For public material, there is another consequential distinction. Google can know a URL exists without fetching the page, so a robots disallow can leave the address in Search. To remove a public page through noindex, Google has to retrieve the directive. Blocking that retrieval first can prevent the indexer from seeing the instruction you meant it to follow. Google’s robots limitations.

Four boundaries · choose the one that enforces the outcome

  • 01Crawler request policy
    robots.txtGuide cooperative crawlers away from paths

    Voluntary rule; server access and caller identity need their own checks

  • 02Indexer processing after retrieval
    noindex via meta or X-Robots-TagKeep a public response out of supporting indexes

    The response stays public

  • 03Whether a principal receives the representation
    Authentication plus server-side authorizationKeep a resource private

    Must hold across hosts, methods, caches, and alternate routes

  • 04How much work a client may consume
    Rate, concurrency, quota, and cache controlsProtect origin capacity

    Search and training eligibility require their own decisions

Crawler preference, index processing, private access, and origin capacity act at different boundaries. Each desired outcome belongs with the control that can enforce it.
Robots, noindex, authentication, and rate-limit decision table
View as a table
Desired outcomePrimary controlWhat it changesBoundary
Guide cooperative crawlers away from pathsrobots.txtCrawler request policyVoluntary rule; server access and caller identity need their own checks
Keep a public response out of supporting indexesnoindex via meta or X-Robots-TagIndexer processing after retrievalThe response stays public
Keep a resource privateAuthentication plus server-side authorizationWhether a principal receives the representationMust hold across hosts, methods, caches, and alternate routes
Protect origin capacityRate, concurrency, quota, and cache controlsHow much work a client may consumeSearch and training eligibility require their own decisions

The crawler directives decision table connects the result you need to the directives in a concrete response.

No robots.txt is not the same as noindex

A missing robots file does not mean “do not crawl.” Under RFC 9309’s access-result rules, an unavailable file such as a 404 may permit access; a server or network failure is a different state. Google documents its own robots.txt status handling, including a special treatment for 429.

To exclude an otherwise public HTML page from Google Search, put noindex in the page’s head or its HTTP response, and let Google retrieve it. Google does not support a noindex line in robots.txt. Blocking the URL before Google can fetch that instruction can leave the URL discoverable in Search. Google’s noindex guide gives both supported forms.

  • Fetch the deployed robots response, including redirects and status, before blaming a rule in your local file.
  • Then inspect the page response and rendered metadata separately. The raw HTML and rendered DOM evidence guide shows what each observation can establish.
  • Use the server-log verification method to investigate the caller, rather than treating its User-Agent as proof.
The response being tested is /robots.txt unless the row explicitly describes a page response. Google-specific behavior is labelled.
Observed stateWhat it means for crawlingStill unproven
robots.txt returns 404Google assumes no robots restrictions; RFC 9309 permits a crawler to proceed when the file is unavailable.The page has been removed from Search or a private resource is protected.
robots.txt returns 401 or 403Google treats these as other unavailable 4xx responses, not an enforced site-wide crawling ban.That protected page routes also deny unauthorized access.
robots.txt returns 429Google handles 429 differently from the other 4xx responses; its ordinary missing-file assumption doesn’t apply.That there are no crawl restrictions or that the origin should accept more requests.
robots.txt returns 5xx or has a network failureCheck provider-specific retry/cache behavior. Google initially pauses crawling after a server-side fetch failure and can later reuse a last-good file.That the new file’s rules were fetched, or that every crawler behaves identically.
Public page returns a noindex meta tag or X-Robots-TagA supporting indexer must retrieve the page to process the instruction.Authentication, confidentiality, or a robots disallow.
Choose one supported noindex delivery method

Use the meta tag inside the HTML head, or send the HTTP response header. Keep the page accessible to the indexer that must read it.

<!-- HTML head -->
<meta name="robots" content="noindex">

# Alternative HTTP response header
X-Robots-Tag: noindex

A cached copy can defeat the permission check

Consider an account document loaded by an authorized user. The application checks permission and returns the file. A shared cache then stores that response under a key that omits the user’s identity. When an anonymous client requests the same address, the cache serves the private document without asking the application again.

I would test the anonymous response before and after an authorized visit across public hosts and alternate routes, inspecting the returned body because a cache that serves an earlier user’s file can defeat correct authorization code while the response status still looks like a successful request. The application passed; delivery leaked. A 200 can carry a login page or the private file.

RFC 9111 gives cache directives different jobs. Unqualified private excludes shared-cache storage while permitting private caches under their applicable rules. Unqualified no-cache permits storage but requires successful validation before reuse. No-store prohibits cache storage. None of these decides who may receive the original response.

The cache and permission policies must preserve the same access decision through delivery. Inspect public headers and bodies, then test an anonymous client and another signed-in principal after an authorized visit. A protected application response won’t cover a file route that bypasses it or an edge rule that replaces it.

Alternate routes, methods, and file variants need the same protection. A cache can change which component returns the body, so authorization has to survive the whole delivery path. Robots policy contributes no permission check to that chain.

Verify policy and authorization as independent checks

The public policy response and protected-resource denial should both be tested.

curl -fsS -D robots.headers https://example.com/robots.txt -o robots.body

curl -sS -o /dev/null -w "%{http_code}\n" \
  -A "ExampleCrawler/1.0" https://example.com/private/account

curl -sS -o /dev/null -w "%{http_code}\n" \
  -A "Mozilla/5.0" https://example.com/private/account

Cooperation still needs a real parser

Cooperation fits a public catalogue’s crawl preference. Its parser still needs correct product-token matching, group selection, percent-encoding, and longest-path rules. I would use that lighter control for public crawling and require enforced authorization for confidentiality.

The retrieval result matters too. RFC 9309 permits access when the file is unavailable, such as a 404, and requires assumed complete disallow when server or network errors make it unreachable, subject to its caching and prolonged-failure provisions. A local “fail closed on every error” setting is an operator override. Record it as one. Protocol access results.

Save the returned file with its effective URL, redirect chain, status and retrieval time. Then record the parser version, selected group and matching rule. Together they let a reviewer explain why production made a different decision from the copy under review. Scheme, host and port define the serving service. Caches belong in this account too.

The robots.txt error and cache timeline follows a failed policy retrieval through Google’s documented last-good-copy behavior.

A familiar name is a claim

Any client can send a Googlebot or GPTBot User-Agent. That string can help select a robots group and route a log record, but granting privileged access from the string alone lets the requester name its own permissions.

Provider-published ranges and verification methods can improve attribution for a public workflow. Save the source version, retrieval time and trusted client address, with explicit stale or missing-evidence states. Even a well-attributed crawler has acquired no right to another user’s account document. Attribution can inform an operational rule without becoming the resource’s authorization policy.

Rate limits, concurrency limits, quotas, and caching decide how much work the origin accepts. An allow rule can support discovery while the server limits expensive requests, giving public crawl policy and capacity enforcement their own jobs.

The release has two observable results

A release needs two independent results: the public robots file selects the intended crawl rules, and protected bodies stay unavailable to anonymous and wrong-user requests after cache warm-up. Keep the returned file and parser decision for the first, then response evidence for the second.

Logs can explain who reached the measured service and which response followed. For public pages, cooperative rules can be proportionate. For private documents, I would require the stronger result: an uncooperative client still can’t obtain the body from any component that serves it.

Sources

  1. RFC 9309: Robots Exclusion ProtocolVerified Sep 10, 2026
  2. RFC 9110: HTTP SemanticsVerified Jul 19, 2026
  3. Google Search: introduction to robots.txtVerified Sep 10, 2026
  4. OWASP Authorization Cheat SheetVerified Jul 19, 2026
  5. OpenAI crawler documentationVerified Jul 19, 2026
  6. Google crawling infrastructure: robots.txt interpretationVerified Oct 23, 2026

    Group selection, path matching and Google-specific HTTP-error/cache behavior. The teaching fixture is illustrative, not a live-site policy test.

  7. Google Search: noindex implementation and crawl-access requirementVerified Oct 23, 2026

    Meta and HTTP-header implementations; Google does not support noindex in robots.txt.

  8. RFC 9111: HTTP Caching — response Cache-Control directivesIETF / RFC Editor · 2022-06Verified Oct 25, 2026

    Read response no-cache, no-store and private semantics and shared-cache authorization provisions. These describe cache behavior; no actual cache or permission configuration was tested.

Supporting material

Read next