AI agents are now regular visitors to websites, and most of them still “search” a site the hard way: crawl pages, scrape HTML, hope for the best. On 25 November 2026 Cloudflare launched Search for Agents (in beta, on all plans). Flip one switch and Cloudflare indexes your site and exposes a standard search endpoint at /.well-known/search that returns relevant content in Markdown. It also advertises that endpoint in your pages so agents can discover it automatically.
This tutorial explains how it works, how to turn it on, how to query it (including with the new HTTP QUERY method), and how to write an agent tool that discovers and uses the endpoint on any site that supports it.
How Search for Agents works
When you enable it, Cloudflare:
- Creates an AI Search instance named
search-for-agents-<ZONE_ID>that uses your domain (https://<your-domain>) as its data source. - Crawls and indexes your content using the “Discover” parse type, which follows sitemaps and links, so a sitemap is helpful but not required.
- Exposes
https://your-domain/.well-known/search, which returns retrieved content in Markdown with source references and relevance scores. It does not return an AI-generated answer, so agents can use the results with their own models. - Adds discovery metadata to the
<head>of your HTML pages (and to Markdown responses if you use Markdown for Agents).
Requests to the endpoint stay subject to your AI Crawl Control and WAF rules, so your existing bot policies still apply.
Default settings worth knowing
From the Search for Agents guide:
| Setting | Default |
|---|---|
| Crawl page limit | 100,000 pages (subject to instance limits) |
| Crawl depth | 5 link hops |
| Sync interval | 24 hours |
| Search mode | Hybrid (vector + keyword), fused with Reciprocal Rank Fusion |
| Embedding model | @cf/qwen/qwen3-embedding-0.6b |
| Chunk size / overlap | 1,024 tokens / 10% |
| Max results | 10 chunks, match threshold 0.4 |
| Similarity cache | On, 48 hours |
| Subdomains | Not included |
Some settings, including the embedding model and data source, are fixed when the instance is created. You can change others later in the instance’s Settings tab. Usage is billed under AI Search pricing and limits, covering ingestion, storage and queries, so check those before enabling it on a very large site.
Step 1: turn it on
Your domain must already be on Cloudflare.
- In the dashboard, open your domain’s Overview page.
- Under Quick Actions, turn on Search for Agents.
- Review the defaults and pricing notice, then confirm.
- Wait for the first crawl to finish before testing.
Only index content you want to be publicly searchable. If you have members-only or staging pages reachable by links, block them first.
Step 2: check the discovery tags
After it is enabled, view the source of any page. Cloudflare adds tags like these:
<meta name="agent:instructions" content="Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown." />
<meta name="agent:endpoint" content="https://example.com/.well-known/search?q={query}" />
<meta name="agent:method" content="GET" />
<meta name="agent:documentation" content="https://developers.cloudflare.com/ai-search/how-to/search-for-agents/" />
If Markdown for Agents is on, requests with Accept: text/markdown receive the same information as YAML front matter.
Step 3: query the endpoint
GET
curl --get "https://example.com/.well-known/search" \
--data-urlencode "q=How do I verify webhook signatures?"
HTTP QUERY
The endpoint also supports QUERY, a newer HTTP method that works like a safe, idempotent GET but carries the query in the request body. That is handy for long natural-language questions that would make ugly URLs:
# plain-text body
curl -X QUERY "https://example.com/.well-known/search" \
-H "Content-Type: text/plain" \
--data "How do I verify webhook signatures?"
# JSON body
curl -X QUERY "https://example.com/.well-known/search" \
-H "Content-Type: application/json" \
--data '{"q":"How do I verify webhook signatures?"}'
You can try it today against Cloudflare’s own developer docs, which advertise https://developers.cloudflare.com/.well-known/search?q={query} in their metadata.
Step 4: build a discovery-aware agent tool
Here is a small Python tool an agent can call with any URL. It looks for the agent:endpoint tag and, if found, searches the site instead of crawling it. It needs only httpx (pip install httpx) and the standard library. We ran it against Cloudflare’s developer docs on 26 November 2026, and it returned Markdown results headed by the “Purge a single URL” section.
# site_search.py
import re
import httpx
META = re.compile(
r'<meta\s+name="agent:(endpoint|method)"\s+content="([^"]+)"', re.I
)
def discover(url: str, client: httpx.Client) -> dict:
html = client.get(url, headers={"Accept": "text/html"}).text
return {k.lower(): v for k, v in META.findall(html)}
def site_search(page_url: str, question: str) -> str:
with httpx.Client(follow_redirects=True, timeout=20) as client:
meta = discover(page_url, client)
endpoint = meta.get("endpoint")
if not endpoint or "{query}" not in endpoint:
return "This site does not advertise an agent search endpoint."
base = endpoint.split("?")[0]
if meta.get("method", "GET").upper() == "GET":
r = client.get(base, params={"q": question})
else:
r = client.request("QUERY", base, json={"q": question})
r.raise_for_status()
return r.text # Markdown with sources and scores
if __name__ == "__main__":
print(site_search("https://developers.cloudflare.com/",
"How do I purge cache for a single URL?")[:1500])
Register site_search as a tool with your agent framework of choice. The Markdown it returns is ready to drop into the model’s context, with source references the model can cite.
Production tips:
- Cache discovery results per domain. The tags do not change between pages.
- Respect
429responses and back off. Site owners pay per query. - Prefer the advertised method, and fall back to crawling only when no endpoint exists.
Using the same index elsewhere
The instance Search for Agents creates is a normal AI Search instance. You can also query it from a Cloudflare Worker through a binding, turn on separate public REST and MCP endpoints, or embed search and chat components on your site. Those extra endpoints are independent of /.well-known/search, and you do not need them for Search for Agents.
Should you enable it?
Good fit: documentation sites, blogs, knowledge bases, product catalogues: anywhere you would rather agents read the right paragraph than hammer every page.
Think twice: sites with lots of gated or personal content, or very large sites where ingestion and storage costs matter. Review AI Crawl Control and WAF rules first, because they still apply to the endpoint.
Takeaway
Search for Agents turns “please don’t crawl my whole site” into a standard, discoverable API: /.well-known/search, Markdown results, GET or QUERY. For site owners it is one toggle with sensible defaults. For developers building agents, it is a strong reason to add endpoint discovery to your web tools today, because a growing share of sites will be able to answer questions directly.
Sources: Cloudflare changelog – Introducing Search for Agents · Search for Agents guide · Cloudflare blog announcement · AI Search limits & pricing
