Link Response Headers for Agent Discovery — RFC 8288 Explained
How HTTP Link headers (RFC 8288) let AI agents discover your site's key resources without parsing HTML — and how to add them to your site in minutes.
HTML developers know the <link> tag. What many don't know is that the same relationship information can be declared directly in the HTTP response header — before any HTML is downloaded. These are HTTP Link headers, standardised in RFC 8288. For AI agents, they are one of the fastest and most reliable ways to discover what a website offers.
What Are HTTP Link Headers?
An HTTP Link header is returned as part of the server response alongside status codes and content-type. It looks like this:
HTTP/1.1 200 OK
Content-Type: text/html
Link: </llms.txt>; rel="ai-manifest"
Link: </openapi.json>; rel="service-desc"
Link: </about.md>; rel="alternate"; type="text/markdown"An agent can issue a HEAD request — which returns headers but no body — and immediately know where your OpenAPI spec lives, that a Markdown version of the page exists, and where your AI manifest is. No HTML parsing, no JavaScript execution, no waiting for the full page to load.
Key rel Values for AI Agent Discovery
The rel attribute on a Link header defines the relationship between the current resource and the linked one. Several rel values are directly useful for AI and agent discovery:
rel="service-desc"— Points to an OpenAPI or service description document. Defined in RFC 8631. This is how an agent discovers your API contract.rel="describedby"— Points to documentation, a schema, or any resource that describes the current page. Broad but widely supported.rel="alternate" type="text/markdown"— Declares a Markdown version of the current page, enabling AI agents to retrieve clean, distraction-free content.rel="hub"— Points to a WebSub hub for real-time update subscriptions. Useful for agents that need to stay current with your content.rel="ai-manifest"— An emerging informal convention pointing to yourllms.txtor equivalent AI site manifest.rel="canonical"— Helps AI agents resolve duplicate content to the authoritative URL — critical for consistent indexing.rel="mcp"— Points to an MCP server card, enabling tool discovery for agents that support the Model Context Protocol.
Why Agents Prefer Headers Over HTML
AI crawlers operate under tight constraints: limited context windows, API rate limits, and cost per token. When an agent can learn everything it needs from response headers alone, it saves a full page fetch. For sites with thousands of pages, this difference compounds quickly. It also bypasses the biggest trap in modern web: JavaScript-rendered content. A Next.js, React, or Vue app may return a nearly empty HTML shell before hydration — but the Link header is always there.
Key insight: HTTP Link headers work even for JavaScript-rendered SPAs. An agent doesn't need to execute your JavaScript to read the Link header — it's part of the raw HTTP response.
Implementing Link Headers on Your Site
Adding Link headers is a few lines of configuration. Here's how to do it across common platforms:
Next.js (app router)
// next.config.ts
const nextConfig = {
async headers() {
return [
{
source: "/:path*",
headers: [
{
key: "Link",
value: [
'</llms.txt>; rel="ai-manifest"',
'</openapi.json>; rel="service-desc"',
].join(", "),
},
],
},
{
source: "/blog/:slug",
headers: [
{
key: "Link",
value: '</blog/:slug.md>; rel="alternate"; type="text/markdown"',
},
],
},
]
},
}
export default nextConfignginx
server {
add_header Link '</llms.txt>; rel="ai-manifest"' always;
add_header Link '</openapi.json>; rel="service-desc"' always;
location ~ ^/blog/(.+)$ {
add_header Link '</blog/$1.md>; rel="alternate"; type="text/markdown"' always;
}
}Link Headers vs. HTML Link Tags
Both approaches carry the same information, and both have value. The HTML <link> tag in <head> is discoverable by browsers and crawlers that do parse HTML. The HTTP header is discoverable by anything making HTTP requests — including agents that never touch the DOM. Use both where possible: the HTTP header for universal machine discoverability, and the HTML tag for browser-level tooling and SEO crawlers that look for it in markup.
Best practice: Declare at minimum rel="service-desc" pointing to your OpenAPI spec (if you have one) and rel="ai-manifest" pointing to your llms.txt on every page. These two links give an agent an immediate map of your site's capabilities and content.