Before you start
- The relay must be live on the website. See Add a website.
-
The relay code must call
serveAgentPage. On CloudFront, it must have the two functions. On ASP.NET on IIS, the module does it, and you do not change code. See the pages for Vercel, Cloudflare, AWS CloudFront, self-hosted Next.js and ASP.NET on IIS. - The relay must run on each path that you serve. If you set up the relay for Only some paths, add these paths to its matcher, routes or behaviors.
serveAgentPage, the Agent pages card shows Your relay does not serve these pages yet. Click See what to change. The Relay card shows the lines to change in your code.
Turn on agent pages
1
Turn on the switch
Open the website and go to Settings. In the Agent pages card, turn on the switch.
2
Select the MCP tools
In MCP tools to give agents, select a Waniwani agent, or No tools. This row shows only when your organization has a Waniwani agent.
3
Select the paths
Go to Pages. Click Serve next to each path that you want to serve. In Suggested paths to add, click Add or Add all. The suggestions come from the last readiness scan.
Paths
A website can have 200 path entries and 1,000 stored agent pages. Until a folder page is ready, the agent gets your normal page. If a folder entry covers a path, you cannot change that path alone.
To stop serving a path, open the ⋯ menu of the path in Pages and click Stop serving.
Who gets an agent page
The relay sends the agent page when all of these are true:- The website has agent pages on, and the path is served.
- The method is
GETorHEAD. - The request comes from an AI agent, or it asks for Markdown in its
Acceptheader. - The agent page is ready, and it gets to the relay in time: the headers in 300 ms and the body in 1 second. The body is 1 MB at most.
Accept header lists text/markdown. If not, it gets HTML. Other clients get Markdown only when they prefer Markdown to HTML. If not, they get your normal page.
If a condition is false, or if Waniwani does not answer in time, the request goes to your site with no change. An error in the relay never breaks your page.
An agent page response has these headers:
What is in an agent page
Waniwani opens your page in a headless browser and waits until the network is idle. Then it keeps the page and removes:- Scripts, except JSON-LD and the Waniwani chat embed
<noscript>blocks and HTML comments<link>tags, exceptcanonical,alternate,author,license,prevandnext- Inline event handlers, such as
onclick - The Waniwani chat widget that the embed shows on the page
off mode. Thus, an agent in a browser with WebMCP also gets the tools.
How pages stay current
When the relay records an agent visit to a ready page, Waniwani gets your live page again. It does this one time in 5 minutes for each path, at most. If the HTML changed, Waniwani renders the agent page again. If your page answers404 or 410, the agent page shows Failed and agents get your normal page.
Waniwani also checks the pages one time each hour:
- A failed page renders again after 1 day. If your page answered
404or410, it renders again after 14 days. - If no agent visited a ready page for 14 days, Waniwani gets your live page again and renders the agent page again if the HTML changed.
Check and preview
In Pages, each path shows its status:
The Tokens column shows the tokens of your page and of the agent page.
Click a path to open its page. The Serve to agents switch serves or stops the path. If the render failed, the page shows the reason. The preview has the tabs What agents get, What people see and Compare:
- What agents get: select Markdown or HTML, and Rendered or Source.
- What people see: Rendered shows a browser screenshot of the top of your page, with the time of the screenshot. Source shows the first 4,000 characters of your HTML.
More settings
When agent pages are on, Settings shows three more cards.Goals
Agents pick a goal at the top of yourllms.txt. Each goal has a link, /llms.txt?goal= and its name, and up to 5 pages that agents must read. A website can have 12 goals. Click Suggest again to get suggestions, and Approve to use one. Click Add goal to write your own.
Agent files
Agents look for files at fixed addresses, such as/llms.txt, /robots.txt, /agents.md and /.well-known/mcp.json. Waniwani writes these files from your site. You can edit them. Click Publish to serve them through the relay. Click Regenerate to write them again.
A file from your own site shows Yours in the Source column.
Protocols
Each protocol goes on or off at once, with no deploy.
MCP and WebMCP show Not available yet.
Troubleshooting
A page stays Failed
A page stays Failed
Waniwani renders from your public
https address. A firewall or a bot protection rule can stop the render. The relay lets the render request through to your site, because it has the header x-waniwani-render.The card says that your relay does not serve these pages
The card says that your relay does not serve these pages
Your code does not call
serveAgentPage. On CloudFront, the viewer request function from the newest zip is not attached. Click See what to change, change the code and deploy. Then click Check now.The card says that no agent page came back from your website
The card says that no agent page came back from your website
This is on CloudFront. The origin request function is not on the behavior. Attach
origin-request.mjs as Origin request on the same behaviors, deploy and click Check now.The test command returns your normal page
The test command returns your normal page
Make sure that the path shows Agent page · ready, and that the relay runs on that path. A new setting can need 2 minutes to get to the relay.