Skip to content

How AI agents can use your website's accessibility tree

• • 12 min read
Bart Waardenburg

Bart Waardenburg

AI Agent Readiness Expert & Founder

The accessibility tree is a browser-generated view of a page's semantic structure. It exposes roles and accessible names for elements such as buttons and form fields, helping compatible agents identify what they can interact with.

Browser agents may combine the DOM, accessibility tree, and screenshots. The tree is especially useful for snapshot-dependent browser agents; other agents also use visual context. It is one part of AI agent readiness , and a readable tree alone does not prove task success.

How AI agents see your website

Browser agents can use three representations to understand a page, and they often combine them. Each one trades off accuracy, speed, and token cost differently:

Vision-Based (Screenshots)

Takes a screenshot and interprets it with multimodal AI. Used by Anthropic's Computer Use and Google's Project Mariner (83.5% on WebVoyager). Costs more tokens and can misread dense layouts.

DOM Parsing (Raw HTML)

Reads the full Document Object Model: every div, span, script, and style tag. A typical page produces 15,000+ tokens, most of it markup with no meaning for the task. That noise makes it a poor fit for complex agent tasks.

Accessibility Tree

A simplified view that the browser generates. It lists only semantically meaningful elements, with their roles, names, states, and descriptions. It typically reduces a page to ~200-400 tokens.

Accessibility snapshots are a common structured interface in frameworks such as Playwright MCP and agent-browser. The full DOM contains every div, span, style, and script tag, while the accessibility tree focuses on interactive elements, labels, states, and relationships. Screenshots add layout and visual context that neither tree provides on its own.

FULL DOM TOKEN COUNT (TYPICAL PAGE)
15,000+
ACCESSIBILITY TREE TOKEN COUNT
~200-400
TOKEN REDUCTION
0
WEB TRAFFIC THAT IS AUTOMATED
0

What is the accessibility tree? A technical breakdown

The accessibility tree is a simplified representation of the DOM that browsers automatically generate from your HTML. Originally designed to expose page structure to assistive technologies like screen readers, it gives compatible browser-agent frameworks a concise view of roles, names, states, and relationships.

Every node in the accessibility tree has four core properties:

Role

What the element is: button, link, heading, textbox, navigation, form. Derived from HTML semantics or explicit ARIA roles.

Name

The accessible label: button text, alt text, aria-label, or associated label element. This is what the agent 'reads' to understand each element.

State

Current condition: checked, expanded, disabled, selected, required. Tells the agent what can be interacted with and how.

Description

Additional context from aria-describedby or title attributes. Provides supplementary information beyond the name.

The DOM and the accessibility tree represent the same login form in very different ways:

DOM vs accessibility tree

<!-- What the DOM sees: 47 nodes, deeply nested -->
<div class="flex flex-col gap-4 p-6 bg-white rounded-xl shadow-lg
            border border-gray-200 max-w-md mx-auto">
  <div class="text-center mb-2">
    <h2 class="text-2xl font-bold text-gray-900">Welcome back</h2>
    <p class="text-sm text-gray-500 mt-1">Sign in to your account</p>
  </div>
  <div class="space-y-4">
    <div class="relative">
      <label class="block text-sm font-medium text-gray-700 mb-1"
             for="email">Email</label>
      <input type="email" id="email" name="email" required
             class="w-full px-3 py-2 border border-gray-300 rounded-lg
                    focus:ring-2 focus:ring-blue-500 focus:border-blue-500
                    placeholder-gray-400"
             placeholder="you@example.com" />
    </div>
    <div class="relative">
      <label class="block text-sm font-medium text-gray-700 mb-1"
             for="password">Password</label>
      <input type="password" id="password" name="password" required
             class="w-full px-3 py-2 border border-gray-300 rounded-lg" />
    </div>
    <button type="submit"
            class="w-full py-2 px-4 bg-blue-600 hover:bg-blue-700
                   text-white font-medium rounded-lg transition-colors">
      Sign in
    </button>
  </div>
</div>
# What the accessibility tree sees: 5 meaningful nodes
- heading "Welcome back" level=2
- textbox "Email" required focused
- textbox "Password" required
- button "Sign in"
- text "Sign in to your account"

The DOM version has 47 nodes of styling classes, layout divs, and visual attributes. The accessibility tree has five nodes, and they hold the information an agent needs to enter credentials and submit the form. In this example, accessibility tree parsing is 93% more token-efficient than raw DOM parsing. Frameworks that expose accessibility snapshots can use that compact structure for interaction, while DOM and screenshot context remain useful for other tasks.

To inspect the accessibility tree yourself, open Chrome DevTools, go to the Elements panel, and select the "Accessibility" tab in the sidebar. It shows the computed accessibility properties for any element. Browser agents may combine this representation with the DOM and screenshots.

Which AI agent frameworks use the accessibility tree?

These frameworks expose the accessibility tree directly or combine it with other inputs:

Playwright MCP (Microsoft)

Uses accessibility snapshots as the default page representation. The browser_snapshot tool returns a YAML-formatted accessibility tree. All element interactions use getByRole, getByLabel, and getByText, not CSS selectors.

browser-use

Reaches 89.1% on WebVoyager using a Snapshot+Refs system. Generates numbered accessibility snapshots where each interactive element gets a unique ref ID. The agent refers to elements by number, not by CSS path.

OpenAI CUA / Atlas

Uses a hybrid approach combining screenshots with accessibility tree data. The Computer-Using Agent extracts semantic roles and labels from the accessibility tree to ground its visual understanding.

Claude Computer Use

Anthropic's computer use tool includes a read_page action that extracts the accessibility tree. This provides the structured page representation Claude uses for web navigation tasks.

Semantic structure matters even when an agent also uses DOM data or visual rendering. Our guide to the Model Context Protocol (MCP) explains how these agent protocols work.

A Playwright MCP accessibility snapshot of a navigation menu looks like this:

# Playwright MCP browser_snapshot output
- navigation "Main":
  - link "Home" (ref=1)
  - link "Products" (ref=2)
    - link "Enterprise" (ref=3)
    - link "Startup" (ref=4)
  - link "Pricing" (ref=5)
  - link "Documentation" (ref=6)
  - link "Contact Sales" (ref=7)
- main:
  - heading "Build faster with AI" level=1
  - text "Deploy intelligent agents that understand your codebase"
  - link "Get Started Free" (ref=8)
  - link "View Demo" (ref=9)

Each element has a semantic role, a human-readable name, and a reference number. To click the "Get Started Free" link, the agent says "click ref 8". It needs no CSS selectors or pixel coordinates.

The research: accessibility and AI agent performance

The CHI 2026 study "Is the Web Accessible for AI Agents?" tested how accessibility barriers affect agent performance. Agents completed far fewer tasks under keyboard-only and magnified views than under the standard view.

SUCCESS RATE (STANDARD VIEW)
0
SUCCESS RATE (KEYBOARD-ONLY)
0
SUCCESS RATE (MAGNIFIED VIEW)
0

On a fully accessible page with proper semantic structure, the agents in the study succeeded 78.33% of the time. With keyboard-only navigation and no visible focus indicators, the rate fell to 41.67%. With magnified views that hide context, it fell to 28.33%. The barriers that keep disabled users out of a site also stopped these agents from completing tasks.

Benchmark scores for web tasks have also risen quickly:

Benchmark Year Best Score Key Insight
WebArena 2023 14.41% Early baseline, when agents struggled with real websites
WebArena 2025 62%+ 4x improvement in 2 years
WebVoyager 2025 89.1% browser-use, which uses accessibility snapshots
WebVoyager 2025 83.5% Google Project Mariner using hybrid vision+tree approach

The CHI 2026 researchers identified three categories of failure when agents encounter inaccessible pages:

Perception Gaps

Missing alt text, unlabeled buttons, and absent ARIA labels remove important semantics from accessibility snapshots. Agents that depend on those snapshots may miss or misidentify the controls.

Cognitive Gaps

Poor heading hierarchy, missing landmarks, and unclear form labels can force agents to guess at page structure, which wastes tokens on navigation instead of the task.

Action Gaps

Custom widgets without keyboard support, click-only interactions, and missing focus management can stop agents from performing actions, even when they understand the page.

WCAG and AI agent readiness overlap

Web accessibility (WCAG) and AI agent readiness overlap because screen readers and compatible browser-agent frameworks can use the same semantic signals. The table maps each practice to its WCAG criterion, its benefit for agents, and the scanner checkpoint that covers it:

Accessibility Practice WCAG Criterion AI Agent Benefit Scanner Checkpoint
Semantic HTML elements 1.3.1 Info & Relationships Agents identify page regions (nav, main, footer) without guessing 3.3 Semantic HTML
Heading hierarchy (h1-h6) 1.3.1 / 2.4.6 Headings Agents build mental model of content structure and topic flow 3.2 Heading Hierarchy
Image alt text 1.1.1 Non-text Content Agents understand image context without vision models 3.5 Alt Text
ARIA landmarks & labels 1.3.1 / 4.1.2 Name, Role Custom widgets become discoverable and operable 3.4 ARIA Usage
Language attribute 3.1.1 Language of Page Agents can pick the correct language for content processing 3.6 Language Attribute
Form labels 1.3.1 / 3.3.2 Labels Agents know what data goes in which field 4.6 Form Quality
Keyboard navigation 2.1.1 Keyboard Agents can operate all controls without mouse simulation 4.8 Interactive Surfaces
Server-side rendering N/A (best practice) Content is available before JavaScript execution 3.1 SSR Detection
Descriptive link text 2.4.4 Link Purpose Agents understand where links lead without following them 3.7 Descriptive Links

As Jason Taylor, Chief Accessibility Innovation Strategist at UsableNet, puts it: "Optimizing for accessibility is like optimizing for AI agents: same tree, same rules." The accessibility tree is essential to screen readers and an important structured signal for compatible browser agents. Improving accessibility can therefore improve those agents' semantic interactions too.

Our scanner measures a subset of these overlapping signals. Checkpoints in our Content & Semantics category inspect published markup such as landmarks, labels, headings, alt text, language attributes, and link text. They do not run a browser agent or measure task comprehension.

The ARIA controversy: use it with caution

Because some browser-agent frameworks use accessibility snapshots, adding ARIA attributes everywhere can look like the answer. OpenAI has suggested that developers add aria-label attributes to improve agent understanding. Accessibility experts disagree, and WebAIM data shows why: pages that use ARIA have more detectable errors than pages without it.

ERRORS ON PAGES WITH ARIA
0
ERRORS ON PAGES WITHOUT ARIA
0

WebAIM's annual Million analysis found that pages using ARIA attributes average 57 accessibility errors, against 27 errors on pages without ARIA. That is more than double. ARIA is often added to patch non-semantic markup instead of improving well-structured HTML.

Accessibility expert Adrian Roselli argues that OpenAI's guidance to add ARIA labels contradicts the first rule of ARIA: "If you can use a native HTML element or attribute with the semantics and behavior you require already built in, instead of re-purposing an element and adding an ARIA role, state or property to make it accessible, then do so."

For both accessibility and AI agent readiness, follow these steps:

  1. Use semantic HTML first. Write <button> instead of <div onclick> and <nav> instead of <div class="nav">
  2. Add ARIA only when HTML falls short, for custom widgets, dynamic content regions, or complex interaction patterns
  3. Test your accessibility tree to verify that what the browser generates matches what you intend agents and screen readers to see
  4. Never use ARIA to override correct HTML semantics. A <button role="link"> can confuse both screen readers and agents

The two snippets below show a wrong and a right approach:

<!-- WRONG: div soup with ARIA band-aids -->
<div role="navigation" aria-label="Main navigation">
  <div role="list">
    <div role="listitem">
      <div role="link" tabindex="0" aria-label="Home"
           onclick="navigate('/')">Home</div>
    </div>
    <div role="listitem">
      <div role="link" tabindex="0" aria-label="Products"
           onclick="navigate('/products')">Products</div>
    </div>
  </div>
</div>

<!-- RIGHT: semantic HTML that needs zero ARIA -->
<nav aria-label="Main navigation">
  <ul>
    <li><a href="/">Home</a></li>
    <li><a href="/products">Products</a></li>
  </ul>
</nav>

The semantic version is shorter, produces a cleaner accessibility tree, works with keyboard navigation by default, and needs no ARIA roles. It exposes clearer roles and names to tools that read the accessibility tree. The scanner checks parts of the underlying markup, but does not run a browser agent against either example.

The business case: 95% of top websites have WCAG failures

Accessibility snapshots are one important browser-agent signal, so widespread accessibility failures weaken that interaction path.

TOP 1M SITES WITH WCAG FAILURES
0
SITES THAT PASS BASIC WCAG
0
AVERAGE ERRORS PER PAGE
0
ERRORS FROM JUST 6 ISSUE TYPES
0

WebAIM's 2025 Million analysis found that 94.8% of the top 1,000,000 websites have detectable WCAG failures, and the average page has 51 errors. 96% of all detected errors fall into six categories:

  1. Low contrast text (81% of pages) does not directly affect AI agents
  2. Missing alt text (54.5%) makes image meaning less reliable across non-visual and structured representations
  3. Missing form labels (45.9%) make form fields ambiguous in accessibility snapshots
  4. Empty links (44.6%) make links hard to identify by role and name
  5. Empty buttons (28.1%) remove the programmatic name used by semantic interaction tools
  6. Missing document language (17.1%) means agents may process content in the wrong language

Five of these six issues degrade the accessibility tree that snapshot-dependent browser agents use. Fixing them does not require a redesign: add alt text, label forms, name links and buttons, and set a language attribute. Each fix is a small markup change that you can measure.

Accessibility improvements strengthen semantic interaction for compatible browser agents, but they do not prove overall AI agent readiness. Sites that fix these issues give snapshot-dependent agents better structured signals. Broader readiness also depends on rendered DOM access, visual context, content quality, and agent protocols.

Practical checklist: making your site accessible to AI agents

The checklist has three tiers, ordered from the most common issues to advanced work:

Tier 1: quick wins (the most common issues)

Add Alt Text to All Images

Every meaningful image needs descriptive alt text. Decorative images get alt='' (empty). Missing alt text appears on 54.5% of pages.

Label All Form Fields

Every input needs a visible <label> with a matching for/id pair. Placeholder text is not a label. Use an explicit association.

Name All Links and Buttons

No empty links or icon-only buttons without aria-label. Accessible names give screen readers and semantic browser tools a reliable interaction target.

Set the Language Attribute

Add lang='en' (or appropriate code) to your <html> element. Agents may use it to pick the right language for processing.

Tier 2: structural improvements

Fix Heading Hierarchy

Use a single h1, then h2 for sections, h3 for subsections. Never skip levels. Agents can use headings to build a model of your content.

Use Semantic HTML Landmarks

Replace div-based layouts with <header>, <nav>, <main>, <aside>, <footer>. These create navigation landmarks in the accessibility tree.

Enable Server-Side Rendering

Fetch-only crawlers and non-rendered retrieval do not execute JavaScript. SSR puts meaningful content in the initial HTML response, while render-capable browser agents may still process client-side content.

Use Descriptive Link Text

Replace 'click here' and 'read more' with descriptive text. Agents should understand a link's destination from its text alone.

Tier 3: advanced AI agent optimization

Add Structured Data (JSON-LD)

Schema.org markup gives agents explicit entity information. Organization, Product, FAQPage, and BreadcrumbList are common types.

Implement WebMCP

Expose your site's capabilities as structured tool definitions that agents can discover and invoke. See our WebMCP guide for details.

Create llms.txt

A plain-text file at /llms.txt that tells AI systems what your site offers, in a format written for language models.

Publish agents.json

Advertise your AI agent capabilities so other agents can discover and interact with your services programmatically.

Our posts on WebMCP , agents.json , and the Google A2A protocol cover the advanced tier in detail.

One tree, two audiences

The accessibility tree was designed to make the web usable for people with disabilities. It now also gives compatible browser-agent frameworks a structured, semantic representation of page content and available actions. Other agents may combine it with the DOM and screenshots.

Work on web accessibility therefore also improves the semantic signals that compatible browser-agent frameworks read: semantic HTML, a proper heading hierarchy, labeled forms, descriptive links, and ARIA where needed.

Since 94.8% of the top 1,000,000 websites show detectable WCAG failures, most sites have room to improve. A better accessibility tree helps users with disabilities and snapshot-dependent browser agents. It does not guarantee recommendations, citations, transactions, or overall agent readiness, but it removes avoidable semantic barriers.

Sources

Ready to check?

Scan your website

Measure published signals and get recommendations across 5 categories. The stable-core score and methodology grade appear only when evidence is complete.

  • Stable-core score and grade when evidence is complete
  • 5 categories, 77 checkpoints
  • Code examples for every recommendation

Related articles

Continue reading about AI agent readiness and web optimization.

Vercel agent-browser: CLI browser automation for AI agents
• 10 min read

Vercel agent-browser: CLI browser automation for AI agents

Vercel agent-browser automates browsers through shell commands and accessibility snapshots. Learn how refs work and when a CLI fits your agent workflow.

ai-agents web-standards accessibility
Playwright: From Test Runner to AI Agent Interface
• 11 min read

Playwright: From Test Runner to AI Agent Interface

After Playwright overtook Cypress, Microsoft released Playwright MCP as an important browser automation option for compatible agents. We explain how getByRole and accessibility snapshots expose useful roles and names without guaranteeing complete agent navigation or task success.

ai-agents web-standards accessibility
Grok Bot, Meta Muse and OpenAI dots: is your website ready?
• 6 min read

Grok Bot, Meta Muse and OpenAI dots: is your website ready?

What Grok Bot, Meta Muse and OpenAI dots mean for agent readiness. A real browser walkthrough and practical checks for forms, login and task completion.

ai-agents getting-started web-standards

Explore more

Explore the checks behind measured stable-core coverage.

Rankings
SEE HOW OTHERS SCORE

Rankings

Browse AI readiness scores for scanned websites.
Compare
HEAD TO HEAD

Compare

Compare two websites side-by-side across all 5 weighted categories.
About
HOW WE MEASURE

About

Learn about our 5-category scoring methodology.