# What Is robots.txt? Allow, Disallow & How Bots Actually Treat It

> Learn what robots.txt does, why everything is allowed by default unless disallowed, how search and AI crawlers honor it, and why it is a policy signal rather than a security wall.

- **Canonical URL:** https://voightk.dev/concepts/what-is-robots-txt
- **Category:** Web Fundamentals
- **Reading Time:** 4 min read

## What robots.txt Actually Is
`robots.txt` is a plain text file hosted at the root of a domain (for example, `https://voightk.dev/robots.txt`) defined by the Robots Exclusion Protocol (RFC 9309). Before a cooperative crawler fetches pages from a site, it checks `robots.txt` to see which paths the site owner wants crawled and which paths should be skipped.

It is strictly a **voluntary convention**, not an access control mechanism. Well-behaved search engines, SEO crawlers, and major AI crawlers follow it; malicious scrapers and vulnerability scanners ignore it completely.

## Do You Actually Need Allow: /?
By default, **everything on a public website is already allowed** if no `Disallow` rule matches it. You do not need to write `Allow: /` for every bot just to let them crawl your site.

You only need an explicit `Allow:` line in two cases:
1. **Overriding a broader `Disallow:` rule:** For example, blocking `User-agent: *` with `Disallow: /` while explicitly permitting `User-agent: Googlebot` with `Allow: /`, or disallowing `/private/` while allowing `/private/public-page`.
2. **Explicit signaling:** Some site owners include `User-agent: OAI-SearchBot` + `Allow: /` to make their intent unmistakable to auditors, partners, or AI crawler teams.

## Allow vs. Disallow Examples
To explicitly allow a specific crawler (or override a wildcard block):

```text
User-agent: ClaudeBot
Allow: /
```

To ask a specific crawler to stay out of the entire site:

```text
User-agent: ClaudeBot
Disallow: /
```

To allow general crawling while asking bots to skip a specific section:

```text
User-agent: *
Allow: /
Disallow: /internal/
```

## Search Crawlers vs. AI Crawlers vs. Scrapers
Not all bots behave the same way:
1. **Search indexers (Googlebot, Bingbot, YandexBot):** Strictly honor `robots.txt` and publish official ASNs / IP lists so you can verify them.
2. **AI training & retrieval crawlers (ClaudeBot, GPTBot, OAI-SearchBot, PerplexityBot):** Major labs separate training crawlers from live search/user-fetchers so site owners can block training while still allowing search citations.
3. **Spoofed scrapers & vulnerability scanners:** Ignore `robots.txt` completely (and sometimes even read `robots.txt` to discover sensitive paths!). Never list secret admin URLs in `robots.txt`; protect private endpoints with real authentication and `X-Robots-Tag: noindex, nofollow`.

## Frequently Asked Questions

### Does Disallow: / hide a page from attackers or keep it private?
No. `robots.txt` is public and voluntary. Anyone can read it, and uncooperative bots ignore it. Always use real authentication or server-side access controls for private pages.

### If I don't have a robots.txt file, can bots crawl my site?
Yes. Under RFC 9309, a missing `robots.txt` (HTTP 404) means crawlers are permitted to access all public URLs on the site.

### Why do some Encyclopedia of Bots profiles mention robots.txt and others don't?
Only cooperative crawlers honor `robots.txt`. For headless frameworks, spoofed scrapers, and vulnerability scanners, `robots.txt` has no effect, so verification and behavioral or network checks are required instead.
