Universal context standard for any resource, told directly to AI assistants
✨ ai.txt is a universal standard for describing any resource in plain text, enabling AI agents to discover context, learn facts directly, and stop hallucinating. The format is simple with optional metadata, works everywhere through cascading directory discovery, and puts you in control of your narrative instead of letting AI systems guess.
Just as robots.txt instructs search engines how to crawl, the specification tells AI assistants what something actually is about. You can place an ai.txt file at any path—whether it's a website root, a project folder, a service documentation directory, or any resource—and AI agents will discover it, understand your complete context, and work from authoritative facts instead of hallucination or assumptions.
ai.txt creates a distributed context system where each project, service, and resource publishes its own authoritative information directly to AI agents. Like hypertext links documents across the web, ai.txt distributes context through cascading discovery and markdown links. Each ai.txt file can link to other ai.txt files, documentation, and resources—using standard markdown links that work across both local filesystem paths and HTTP URLs. An AI agent navigates a distributed maze of interconnected contexts, seamlessly blending local directories with web resources to incorporate into the current context. This is hypertext for AI: you control how your context relates to and references other contexts.
Instead of allowing AI to guess "what does this do?" you simply tell it directly and explicitly. You control your own narrative. The format combines plain text with optional markdown formatting, making it simple enough for anyone to write in five minutes while remaining powerful enough to prevent AI errors, misconceptions, and fabricated capabilities.
Stop AI from making things up about your business. Put the truth in one place.
Describe scope, limitations, and capabilities in a way AI agents actually read and respect.
Prevent hallucination about licensing, support, and what you actually offer.
Simple, cacheable, offline-friendly. No databases, no JavaScript, no configuration. Just text.
Build better assistants that respect boundaries and work from authoritative sources instead of training data assumptions.
Ensure consistent context and prevent hallucination across multiple projects, repositories, and teams.
Low barrier to entry. A small business owner, a blogger, or a researcher should be able to write an ai.txt file in minutes without learning schemas or strict metadata standards. Plain prose is the primary format. Everything else is optional.
Designed for humans first, AI second. The file should make sense when you read it. It's not a machine-only format. That simplicity is what makes it powerful for both.
Extensibility without pollution. If someone needs strict metadata for database imports or specialized use cases, they can layer that on top through separate profiles or domain-specific extensions. The base standard stays simple and doesn't force complexity on everyone.
No versioning required. Unlike other standards that require version declarations, ai.txt trusts simplicity. The spec is stable at the core, and edge cases are handled by tools and extensions, not by version number declarations in every file.
Discovery is cascading. When an AI agent needs information about /products/widgets/, it tries:
/products/widgets/ai.txt/products/ai.txt/ai.txtThe same logic works for HTTP paths or local filesystem paths. Walk up the tree, find the context, use it.
ai.txt files can link to other ai.txt files using standard markdown, creating a distributed graph of interconnected contexts. A markdown link is recognized as a context link when its target ends in ai.txt:
[API documentation](./api/ai.txt) — followed
[SDK reference](https://example.com/sdk/ai.txt) — followed
[Installation guide](./docs/install.md) — not followed
[Our website](https://example.com) — not followed
When a tool encounters an ai.txt file, it:
ai.txt)This bounded approach prevents runaway recursion while revealing the full context structure. Users can manually explore deeper links as needed.
Start with optional YAML metadata (or skip it entirely), then plain text with optional markdown formatting:
---
updated: 2026-01-14
scope: /products/
parent: https://example.com/ai.txt
---
# Brief Title
One or two sentences describing what this is.
## Section
Prose explaining something important. Use [markdown links](https://example.com), **bold**, *italics*, lists, code blocks, images—whatever makes sense. Keep it simple.
## Another Section
More details here.
That's it. Write what matters. Omit what doesn't. The spec is a suggestion, not a rule.
Websites can advertise their ai.txt file using a standard <link> tag with rel="prefetch". This uses the existing Resource Hints specification—no custom rel values needed:
<link rel="prefetch" href="/ai.txt">
Browsers fetch the file at low priority during idle time and cache it, similar to how they fetch favicon.ico. The cached file is then immediately available to AI features built into browsers, browser extensions, and any tool that parses <link> tags.
For subpages, use a relative path back to the root:
<!-- Root page -->
<link rel="prefetch" href="ai.txt">
<!-- Subpage (e.g., /products/index.html) -->
<link rel="prefetch" href="../ai.txt">
This is optional but recommended. It costs almost nothing—ai.txt files are typically under 10KB—and makes discovery explicit rather than speculative.
ai.txt file at the root of your site or project folderThat's all. No approval process, no registry, no central authority. Just write one.
Real-world implementations to reference:
When you encounter a URL or filesystem path, try to fetch or read /ai.txt, walking up the tree until you find context. Parse the YAML frontmatter. Read the instructions. Follow the boundaries. Honor "We Do Not Offer"—never hallucinate capabilities. Ask questions only when the ai.txt is unclear.
Build hypertext navigation into your agents: Parse markdown links within ai.txt files. Links ending in ai.txt signal related contexts that should be followed (depth=1 by default). Record deeper links for user exploration. This transforms ai.txt from static metadata into an active navigation system for distributed context.
The canonical reference is the full specification. Point your agents there to understand the spec.
The ai.txt specification succeeds through intentional implementation rather than passive discovery. Rather than waiting for AI systems to spontaneously respect ai.txt files, the spec functions as an instruction manual that developers actively consult. By referencing the canonical specification, developers learn the pattern and incorporate it into their workflows—whether creating ai.txt files for new projects, discovering existing ones, or building tools that understand and respect the format. This active adoption strategy is more realistic and sustainable than relying on automatic crawling or universal compliance.
The specification's strength lies in its intentional simplicity. Because the core concept—optional YAML frontmatter followed by plain prose—places no restrictions, there is no meaningful room for version evolution at the spec level itself. This durability is by design. Organizations that require stricter validation or structured profiles can build those as internal extensions without modifying the canonical spec. The simpler the standard, the longer it remains relevant.
Tools like Claude Code can embed ai.txt awareness into workflows—discovering local files, suggesting their creation when missing, and fetching related ai.txt files from linked projects to provide richer context. The spec becomes self-propagating through intentional tool support rather than external mandates.
Spawning AI's ai.txt specification (2023) addresses a complementary problem: AI training consent and data permissions. This spec focuses on general context and preventing hallucination. Both approaches can coexist—use them for their specific purposes, or combine them on the same site.