How to Make Your Website Ready for AI Agents
AI browser agents read your pages through the DOM, the accessibility tree, and screenshots. Here is what to fix so an authorized agent can find information and complete tasks on your site, without weakening security or chasing AI SEO myths.
Someone asks an AI assistant to find the cheapest annual plan on your pricing page and start a trial. The agent loads the page, finds three plan cards with identical “Select” buttons, a monthly/annual toggle built from styled divs, and a sign-up form whose fields have placeholder text but no labels. It guesses. Maybe it picks the right plan, maybe it does not.
That is the problem this guide is about. As more people hand browsing tasks to browser agents and computer-use agents, your site gets a new kind of visitor. Almost everything that helps an agent also helps people, especially people using screen readers and keyboards, so most of the fixes are ones worth making anyway.
Three Different Questions
Website owners tend to lump these together. Keep them separate, because they have different fixes and different evidence behind them.
| Question | What it asks | Main levers |
|---|---|---|
| Search visibility | Can search engines discover, crawl, and understand the page? | Crawlable content, titles, links, canonicals, indexing |
| AI search visibility | Can AI-generated answers (such as AI Overviews) retrieve and cite the page? | The same SEO foundations, plus original, useful content |
| Agent usability | Can an authorized agent operate the site to finish a task? | Semantic HTML, labels, explicit actions, predictable states, permissioned flows |
On the second row, Google is unusually direct. Its AI optimization guide says generative AI features are rooted in its core ranking and quality systems, that you do not need new machine-readable files, AI text files, or special markup to appear, that Google Search ignores files like llms.txt, and that there is no special schema.org markup for generative AI search. A page has to be indexed and eligible to show a snippet. Beyond that, the advice is normal SEO and original content.
This guide focuses on the third row, which gets far less attention. For how AI search changes the way people find answers, see AI search vs traditional search.
How an Agent Reads Your Page
A person sees colors, layout, and familiar patterns. An agent typically works from three representations at once, a point Google’s own Build agent-friendly websites article on web.dev spells out:
- The DOM. The HTML structure, including nesting. A button inside a product card is assumed to belong to that product.
- The accessibility tree. The browser’s simplified map of the page: each element’s role (button, link, textbox, heading), its accessible name, and its state (checked, expanded, disabled). It ignores visual styling. You can inspect it in Chrome DevTools under the Accessibility pane.
- Screenshots. A vision model judges what an element is from its size, color, and position. This is slower and more expensive, so agents tend to use it to confirm what the structure already suggests.
Agents also track links, form state, URLs, and whether something changed after an action. When the HTML says a thing is a button, the accessibility tree names it “Start annual trial,” and the screenshot shows a button with that text, the agent has three signals that agree. When the “button” is an unlabeled div with an icon, it has one weak signal and a guess.
Step 1: Make Important Content Discoverable
Before an agent can use a page, someone or something has to find it. The basics:
- Navigation that names things plainly. “Pricing,” “Docs,” “Refund policy,” not “Explore” or “Solutions.”
- Descriptive titles and one clear H1 per page, with headings in a logical order (H2 under H1, H3 under H2).
- Important facts in text. Prices, plan limits, shipping times, and refund terms should be readable text on the page, not only inside images, PDFs, or tooltips.
- Internal links to key pages from places people would expect them, such as linking the refund policy from checkout.
- Correct canonical URLs and accurate meta descriptions, so duplicates do not compete and summaries match the page.
- Content in the rendered HTML. If your site renders with JavaScript, confirm the content is present after rendering. Google’s guidance mentions sound JavaScript practices as part of a clear technical structure.
None of this is AI-specific. It is the same work that helps people and search engines find things.
Step 2: Use Semantic HTML
Use the element that matches what a control does. A <button> performs an action. An <a href> goes somewhere. A <label> names a form field. A <table> holds tabular data. Headings mark structure, not font size.
Here is a common pattern that causes trouble:
<!-- Before: looks like a button, isn't one -->
<div class="btn btn-primary" onclick="addToCart(42)">
<svg class="icon-cart"></svg>
</div>
The accessibility tree sees a generic element with no name. Keyboard users cannot reach it. An agent has to infer from a screenshot that a cart icon means “add to cart,” and which product it belongs to.
<!-- After: a real button with a clear name -->
<button type="button" class="btn btn-primary" onclick="addToCart(42)">
<svg class="icon-cart" aria-hidden="true"></svg>
Add Linen Tote to cart
</button>
Now the role is “button,” the name is “Add Linen Tote to cart,” it is focusable and works with Enter and Space by default. If you cannot use native elements, add the right role, make the element focusable with tabindex="0", and handle keyboard events, but native elements are less work and fail less often. The WAI-ARIA Authoring Practices cover the patterns; the first rule of ARIA is to prefer native HTML when it exists.
The web.dev guide adds a few practical details: avoid transparent overlays sitting on top of controls (agents may treat covered elements as unreachable), keep actionable elements a reasonable size, and give interactive elements cursor: pointer as a visual cue.
Step 3: Make Forms Understandable
Forms are where agents most often get stuck, and where mistakes cost the most. A form an agent can fill correctly has:
- A visible
<label>tied to each field withforandid. Placeholder text is not a label; it disappears when you type and is often not exposed the same way. - The right input types:
type="email",type="tel",type="date",type="number". These tell both browsers and agents what format is expected. - Required fields marked with the
requiredattribute and a visible indicator. - Format hints next to the field, connected with
aria-describedby: “DD/MM/YYYY,” “Minimum 12 characters.” - Specific error messages that say what is wrong and how to fix it, placed next to the field and announced (for example with
aria-liveor by moving focus to an error summary). - A logical tab order that matches the visual order.
- A clear confirmation after submission, on the page or a new URL, that states what happened.
<label for="company">Company name</label>
<input id="company" name="company" type="text" autocomplete="organization" required>
<label for="launch">Launch date</label>
<input id="launch" name="launch" type="date" aria-describedby="launch-hint">
<p id="launch-hint">Leave blank if you don't have a date yet.</p>
Picture an agent asked to “fill out the contact form with my details but don’t submit.” With labeled fields it can map “company” to Company name and stop before the button. With five unlabeled inputs and placeholders that vanish, it has to guess which box is which.
Step 4: Make Buttons and Actions Explicit
A button’s text should describe its consequence. “Go,” “Submit,” “OK,” and “Continue” force a reader to work out the result from context. “Download report (PDF),” “Pay $49 now,” “Delete this project,” and “Start 14-day free trial” do not.
This matters most for actions that cost money, send something, or cannot be undone. A person reads around the button; an agent may rely heavily on the button’s accessible name. When a page has several similar buttons, such as “Select” on three plan cards, make each name unique (“Select Starter plan”) or ensure each button sits inside a clearly labeled container.
Keep primary actions in consistent positions across similar pages. The web.dev guide specifically calls out layouts where the main action moves around between product pages as confusing for screenshot-based agents.
Step 5: Handle Dynamic Content Reliably
Modern sites change without full page loads, which is where many automated workflows fail. An agent clicks “Apply coupon,” sees no change for 800 milliseconds, and clicks again. Now there are two requests.
Make state changes observable:
- Loading states that are visible and exposed, for example by setting
aria-busy="true"on the region and disabling the button while the request runs. - Disabled controls that are actually
disabled, not just greyed out with CSS. - Modals that move focus inside, can be closed with a visible, labeled close button, and do not leave the rest of the page clickable behind them.
- Toasts and inline messages for important results that stay long enough to be read and are announced with a live region. If the message matters (“Payment failed”), do not let it vanish after two seconds.
- Infinite scroll paired with a paginated alternative or a “Load more” button, so content beyond the first screen is reachable without endless scrolling.
- Error states that explain what failed and what to do.
- A clear end state after an action: a confirmation message, a new URL, an order number. “Did it work?” should have an unambiguous answer.
If you have ever written flaky end-to-end tests for your own site, the same pages that broke your tests will break agents.
Step 6: Provide Useful Structured Information
Structured data using schema.org vocabulary describes page content in a consistent format. Use the types that match what is actually on the page: Product with offers for product pages, Article for articles, Organization for your business details, Event for events, SoftwareApplication for apps, and FAQPage where you genuinely have a visible FAQ.
Two cautions. Structured data must match visible content; marking up prices or reviews that are not on the page violates Google’s guidelines. And it is not a control panel for agents. It can make facts easier to extract, but it does not tell an agent to take an action, and Google says it is not required for generative AI search.
Step 7: Keep It Secure
Agent-ready does not mean open. Every control that protects your site from bad bots and fraud should still apply, and your design should assume that an agent can be wrong or manipulated through prompt injection.
- Authentication and authorization apply to agents exactly as they do to people. An agent acting for a logged-in user gets that user’s permissions and nothing more.
- Confirmation for spending and destructive actions. Show the full total, including tax and shipping, before payment. Require an explicit confirmation step for deleting accounts, cancelling subscriptions, or sending messages.
- CSRF protection, rate limiting, and bot protection stay on. Do not remove CAPTCHAs or weaken checks so automation runs more smoothly.
- Idempotent transactions. Use idempotency keys or equivalent server-side checks so a repeated click or a retried request does not create two orders or two charges.
- Audit logs and fraud detection that record what happened and when, so an unexpected agent action can be traced.
- A proper route for legitimate automation. If customers want to automate tasks on your site, offer an API or integration with scoped tokens, its own rate limits, and clear terms. That is safer than encouraging screen-clicking against your production interface. Experimental standards such as WebMCP aim to let sites expose defined tools to agents, with the option of user confirmation for sensitive actions, but they are early.
Also remember that robots.txt is a request to crawlers that choose to honor it. It is not access control. Anything that must be private needs authentication. For the agent side of this, see the AI agent security checklist.
Step 8: Test Your Site With an Agent
You learn more from watching an agent use your site than from any checklist. Run this on a staging site, a demo environment, or a harmless public flow. Do not test real purchases, payments, account changes, or anything destructive unless you own the account and have explicit authorization.
Pick five to eight tasks that matter to your visitors:
- Find the price of a specific product or plan.
- Find the refund or cancellation policy.
- Locate the documentation page for a named feature.
- Find a specific article by topic.
- Navigate to the contact form.
- Fill in the contact form with test details and stop before submitting.
- List the available subscription plans and what each includes.
Give each task to an agent in a clean browser profile, with a prompt like: “On [staging URL], find the annual price of the Team plan. Do not log in, submit forms, or make purchases. Narrate each step and tell me if anything was unclear.”
Record what happens in a simple table:
| Task | Completed? | Wrong turns | Misread controls | Human help needed | Time | Notes |
|---|---|---|---|---|---|---|
| Find Team annual price | Yes | Clicked “Solutions” first | Toggle read as text | No | 1m 40s | Toggle is a styled div |
Repeat each task a few times. Agents are not deterministic, and one successful run proves very little. If a task succeeds two times out of five, it is not reliable.
Fix and retest. Most problems trace back to the earlier steps: an unlabeled control, a vague button, a modal that traps focus, content hidden behind a hover. If you also want to know how the agent itself should be evaluated, the workflow for testing an AI agent covers that side.
Agent-Ready Website Checklist
Discoverability
- Key pages (pricing, docs, policies, contact) are linked from navigation or the footer
- Each page has a descriptive title, one H1, and logical heading order
- Prices, limits, and policies are in text, not only images or PDFs
- Content is present in the rendered HTML; canonicals are correct
- Pages you want in search are indexable and snippet-eligible
Accessibility
- Actions use
<button>, navigation uses<a href> - Every interactive element has an accessible name (check the accessibility tree)
- Icon-only controls have text labels or
aria-label - Images that convey information have meaningful alt text
- No transparent overlays covering interactive elements
Navigation
- Menu labels describe destinations plainly
- Primary actions sit in consistent positions on similar pages
- Paginated or “Load more” alternative exists for infinite scroll
- Every page can be reached by a link, not only by search or hover
Forms
- Every field has a visible
<label>linked withfor/id - Correct input types and
autocompletevalues - Required fields marked in markup and visually
- Errors are specific, placed next to the field, and announced
- Tab order matches visual order
Interaction
- Button text states the consequence (“Pay $49 now,” not “Go”)
- Similar buttons have unique names or labeled containers
- Loading, disabled, and error states are visible and exposed
- Modals manage focus and have a labeled close button
- Every action ends with an unambiguous confirmation
Security
- Auth, CSRF protection, rate limits, and bot protection unchanged
- Spending and destructive actions require explicit confirmation with full totals
- Payments and orders are idempotent
- Audit logging covers sensitive actions
- Legitimate automation has an API or integration with scoped access
Verification
- Five to eight real tasks tested with an agent on staging
- Each task repeated several times
- Failures traced to specific pages and components
- Fixes retested; keyboard-only test passed
A Reusable Audit Prompt for a Coding Agent
If you use a coding agent such as Claude Code or Codex, it can do a first pass on your codebase. It can only audit what it can actually access: give it the repository, and if it has browser tooling, a local or staging URL. Without those, it will be guessing, and the prompt tells it to say so.
Audit this website for agent readiness: how reliably an authorized AI
browser agent could find information and complete tasks on it.
Access: you have [the repository at ./ / a staging URL: ... / both].
Only report on what you can actually inspect. If you cannot run the site
or open a page, say so and limit findings to the code you can read.
Check and report on:
1. Navigation: unclear menu labels, key pages (pricing, docs, policies,
contact) that are hard to reach or only reachable via hover/search.
2. Non-semantic controls: clickable div/span elements, links used as
buttons or buttons used as links, missing roles or keyboard handling.
3. Accessible names: icon-only buttons, duplicate names like "Select" or
"Learn more" without context.
4. Forms: missing or unlinked labels, placeholder-only fields, wrong input
types, missing required markers, vague or unannounced errors.
5. Keyboard access: elements that cannot be focused or operated by
keyboard, focus traps, tab order that does not match the layout.
6. Dynamic states: missing loading/disabled states, modals without focus
management, toasts that disappear quickly, infinite scroll without an
alternative, actions with no clear confirmation.
7. Ambiguous actions: button text that does not state its consequence,
especially for payments, deletion, or sending.
8. Crawlability and metadata: missing titles or H1s, heading order, content
only rendered client-side, canonical and meta description issues,
structured data that does not match visible content.
9. Security: spending or destructive actions without confirmation,
non-idempotent order/payment endpoints, missing CSRF protection or rate
limiting, any suggestion to weaken bot protection. Flag, do not fix.
For each finding give: severity (high/medium/low by impact on task
completion and safety), affected route and component/file path, what is
wrong, a suggested fix, and how to verify the fix.
Finish with a prioritized list of the top ten fixes. Do not change any
code in this pass. Do not invent routes or files you have not seen.
Review the findings before acting on them. Coding agents are good at spotting unlabeled inputs and div buttons in code; they are less reliable at judging whether a flow makes sense to a person. Treat the output as a lead list, and confirm with your own agent test from Step 8.
Common Mistakes
Treating AI search and agent usability as one project. Adding FAQ schema will not fix a checkout an agent cannot operate, and fixing your form labels will not make an AI answer cite you.
Adding AI-specific markup instead of fixing the page. An llms.txt file or extra schema is harmless at best if the underlying page has unlabeled controls. Google says it ignores llms.txt in Search.
Hiding essentials behind interactions. Prices that only appear on hover, policies only in a chat widget, plan details only in an image carousel.
Placeholder text instead of labels. The single most common form problem, and one of the easiest to fix.
Vague buttons. “Continue” on a page that charges a card.
Weakening security for automation. Removing CAPTCHAs, loosening rate limits, or skipping confirmation steps. Offer a proper API instead.
Trusting one successful agent run. Agents vary from run to run. Test each task several times before calling it reliable.
Where This Leaves You
Start with the pages that make you money or answer the most questions: pricing, sign-up, checkout, contact, and your main documentation. Inspect their accessibility tree, fix labels and button names, make every action end in a clear confirmation, and leave every security control in place. Then watch an agent try your top tasks on staging and fix what it trips over.
The sites that work best for agents will mostly be the ones that already work well for people, including people using screen readers and keyboards. That is a better reason to do this work than any promise about AI rankings. For the content side of AI search, the workflow for optimizing a page for AI search and the AI-friendly website prompts pick up where this guide stops.
Continue learning
Explore related guides, tools, workflows, and prompts that help you go deeper into this topic.
More practical AI guides for work and business.
Read guideA practical guide to help you understand and apply this topic.
Read guideA practical guide to help you understand and apply this topic.
Read guideA practical guide to help you understand and apply this topic.
Read guideA practical guide to help you understand and apply this topic.
Read guideA practical guide to help you understand and apply this topic.
Read guideMore practical AI guides
Browse guides that show you how to use AI for real work tasks: no hype, just practical steps.
Frequently Asked Questions
What is an agent-ready website?
A website an authorized AI agent can navigate and use to complete a task, such as finding a price, filling a form, or locating documentation, without guessing what controls do. In practice it means clear content, semantic HTML, labeled forms, explicit buttons, predictable page states, and security controls that still apply to automated visitors.
Do I need an llms.txt file for Google AI search?
No. Google's AI optimization guidance says you do not need new machine-readable files, AI text files, or special markup to appear in Search, and that Google Search ignores files like llms.txt. Other AI services may read such files, but there is no evidence that any of them is required.
Is there special schema markup for AI Overviews or AI Mode?
No. Google says structured data is not required for generative AI search and there is no special schema.org markup to add. Structured data is still useful for rich results when it accurately matches visible content.
Is agent readiness the same as AI SEO?
No. SEO is about search engines discovering and understanding your pages. AI search visibility is about AI-generated answers retrieving and citing your content. Agent readiness is about whether an agent acting for a user can operate your site. They overlap, but a page can rank well and still be hard for an agent to use.
Should I remove CAPTCHAs so agents can use my site?
No. Bot protection, rate limits, and authentication protect you and your customers. If you want to support legitimate automation, offer an API, an integration, or a permissioned flow with its own limits and logging, rather than weakening protections for everyone.
How do AI agents see a web page?
Most combine several views: the page's HTML structure (DOM), the browser's accessibility tree, which lists elements by role and name, and screenshots interpreted by a vision model. Google's web.dev guidance describes screenshots as slower and more expensive, so structured signals in the HTML and accessibility tree matter a lot.
What is WebMCP?
WebMCP is a proposed web standard that lets a site register tools with defined inputs and outputs so agents can call them directly instead of clicking through the interface. Google's web.dev guide notes it is in active development and available for experimentation in Chrome through an origin trial. Treat it as experimental.
Will making my site agent-ready improve my rankings?
There is no evidence that it directly does, and nobody can promise rankings or AI citations. The changes in this guide overlap heavily with accessibility and usability, which help human visitors, and that is the main reason to make them.
Last updated: