No Way Out: Catching the Keyboard Traps That Scanners Miss
Your page can pass the scanner and still hold a keyboard user captive. Here is how we built TabQuest with Kiro to find those traps, one real key press at a time.

The web without a mouse
Many people move through websites with a keyboard, or with something that behaves like one: a switch device, a screen reader, voice control. Some have a tremor that makes a pointer painful to aim. Some just broke their trackpad. For all of them, the Tab key is how a page is walked, one control at a time.
That walk breaks more often than you'd think. When the UK government's digital service checked 1,151 public-sector websites between 2022 and 2024, it reported keyboard access among the most common problems, with 64% of those sites failing on it. Its checkers test by hand.
The worst version of the failure is a keyboard trap: focus goes into something, usually a popup, and no key gets it out. Web accessibility guidelines have a rule for exactly this, WCAG 2.1.2, No Keyboard Trap. It's one of the most serious ones, because nothing after the trap exists any more. Not the next field, not the pay button, not the way back.
Why a scanner can walk right past it
Automated checkers are excellent at reading a page. They can tell you an image has no alternative text or a field has no label. A trap is different. It isn't written anywhere in the markup. It only appears when you press keys in order and watch where you end up.
It's also a judgment call. A well-built dialog keeps focus inside on purpose while it's open. So "focus loops" isn't the bug. The question is whether you can leave.
In 2023 I worked on Sight Beyond Sight, a hackathon project that summarised web pages and read them aloud for visually impaired people. It was about helping someone understand a page. TabQuest asks an earlier, blunter question: can you get through the page at all?
The shop you can't leave
We built a small haunted potion shop to show it.

You Tab to Checkout and press Enter. A popup called "Join the Coven" opens and asks for your email. Tab takes you from the field to the Join button and back again. Shift+Tab does the same. Escape does nothing. There is a "×" in the corner, but it is a <div> with a click handler, so only a mouse can reach it. If you use a keyboard, your shopping trip is over.

We ran axe, a standard automated checker, on this page. It reported zero serious or critical issues, and none of the rules it lists is tagged to the No Keyboard Trap criterion. That isn't axe being broken. Reading markup and pressing keys are different jobs.
Before reading on, try to escape it yourself using only your keyboard.
Watch it in three minutes
Video link: youtu.be/VR6XbkFziDk
What TabQuest does
You give TabQuest a task, such as "reach Order placed". It drives a real browser using only Tab, Shift+Tab, Enter, Space and Escape, records where focus lands after every press, and tells you what happened.

It sorts what it finds into plain categories:
| Finding | What it means |
|---|---|
| Trap | Focus is stuck in a loop and no tested key gets it out |
| Intentional loop | A popup holds focus on purpose, and has a working exit |
| Blocked | The goal can't be reached with these keys |
| Completed | The task can be done by keyboard, with the keys listed |
| Focus lost | Focus fell back to the page itself after something changed |
The second row matters as much as the first. A tool that calls every dialog a trap gets switched off within a day.
Under the hood

1. Only real keys count
You can't fake this with JavaScript. A synthetic KeyboardEvent doesn't move focus, so a script that "presses Tab" that way learns nothing. TabQuest sends real key presses through Playwright. After each one it records the focused element: its role and name, which dialog it sits in, where it is on screen, and whether you can actually see a focus outline.
2. Explore like a patient user
The explorer works at two levels. First it walks the Tab ring of the current page state. Then, from each stop on that ring, it opens a fresh browser context, replays the shortest path back, and tries one of Enter, Space or Escape to see whether that opens a new state. It has hard limits (40 page states, 80 positions in a ring, depth 25, 90 seconds per task), because an unbounded crawler never finishes.
3. Turn presses into a graph
Every focus position becomes a node and every key press an edge. Loops are found with Tarjan's strongly connected components algorithm, and here is the subtle part: loops are computed over Tab and Shift+Tab edges only, while exits are judged using all the keys.
Why? If you compute loops over every key, "Enter opens the popup, Escape returns to the button" glues the popup and the page into one big loop, and the thing you wanted to judge disappears.
4. Be strict about the verdict
A loop is only a trap when no tested key path gets from it back to the page, or to the goal. And if a run hits one of its limits, TabQuest reports inconclusive. It never turns an unfinished search into "clean", and a truncated run never raises a trap alarm either.
5. Show it, in two ways
The web app draws the graph as a haunted maze, because a keyboard trap really is a haunted room: you keep walking and there is no door.

Everything in the drawing also exists as an ordered text trace, such as "Escape → focus on 'Email' textbox in dialog 'Join the Coven'". An accessibility tool that only explains itself with a picture would be missing its own point.
6. Make the fix stay fixed

TabQuest can export a Playwright regression test for the finding. The test describes the behaviour you want, so it fails on the cursed page and passes on the fixed one. On the fixed shop, the same order goes through with the keyboard in seven keys.
Not just our haunted shop
A tool that only finds the bug you planted proves very little. So we loaded widely used libraries exactly as published, at pinned versions, ran each through TabQuest, then ran it again with a fix. Varesh led this work.
| Library | With default settings | After the fix |
|---|---|---|
| Monaco Editor 0.52.2 (the editor inside VS Code) | Trap: Tab never leaves the editor | Gone, using its "Tab moves focus" mode |
| CodeMirror 5.65.21 | Trap: Tab and Shift+Tab both stay inside | Gone, with both keys rebound |
| Ace 1.32.7 | Trap: Tab indents instead of moving on | Gone, with its keyboard accessibility setting |
| tingle.js 0.16.0 (a popup library) | Focus lost when the popup closes | Gone, with a few lines of page code |
To be fair to the editors: indenting with Tab is what you want while writing code, and Monaco has a shortcut to toggle it. The problem is a page that embeds one in the middle of a form, for someone who doesn't know the shortcut.
We also recorded the awkward results. Chosen's multiple select traps focus and we found no documented option to fix it. And there is a dialog bug TabQuest does not catch yet. Both are written up with the real-world examples.
Putting it in CI: the GitHub Action
A one-off audit goes stale at the next redesign. So the TabQuest repository is also a GitHub Action: point it at your task files and a preview URL, and a pull request that introduces a trap fails.
- uses: Haadesx/Kiroween26@<ref> # use a tag or commit SHA
with:
tasks: 'a11y/*.task.json'
base-url: ${{ steps.deploy.outputs.url }}
fail-on: 'trap,blocked'
artifact-name: 'keyboard-audit'Each run writes a job summary with findings in plain language, and uploads the traces and generated tests as an artifact. A task that crashes, or a pattern that matches no files, fails the job too. A silent pass is the one thing a checker must never give you.
Kiro wrote the spec and built the action from it. The first run on a real GitHub runner failed: a popular setup step read the consuming repository's package.json instead of the action's own. Our guard jobs failed loudly, Kiro fixed it, and on the next run the cursed checkout failed with a trap while the fixed checkout and a well-behaved settings page passed. Exactly the three answers we wanted. Full guide here.
Building it with Kiro
I expected a code generator. What I got felt much closer to an engineering partner with a strong sense of process. Kiro doesn't just answer a prompt: it gives you a way of working, where the intent is written down, the proof is part of the job, and the project's rules travel with every session. It changed how I build, and it's the part of this project I'm most excited to talk about.
The Kiro toolbox we used
- Specs to turn an idea into requirements, a design and tasks
- Property-based testing to attack that design with hundreds of inputs
- Steering to keep every session inside the project's rules
- Hooks to run checks the moment a file changes
- MCP to give Kiro a real browser
- Custom agents for focused jobs, with tight permissions
- Powers to package what we learned for other developers
- Kiro CLI and IDE for scripted runs and hands-on sessions
- Kiro Crew to turn a tool into a service that keeps watch
Specs caught a bug before any code existed
Spec mode is the feature I'd miss most. Describe what you want, and Kiro writes requirements in a precise "when this happens, the system shall do that" style, a design with numbered properties that must always hold, and a task list it can then execute. You review a page of plain language before reviewing a thousand lines of code.
We wanted TabQuest to hint when Tab jumps visually backwards. Kiro started with a spec: requirements, a design with properties that must always hold, and tasks. Reviewing the design showed a flaw: every Tab ring wraps from its last control to its first, so every popup and every page would have been flagged. We fixed a paragraph instead of debugging a maze.
Property tests found what examples didn't
Instead of a handful of hand-picked cases, property-based tests throw hundreds of generated inputs at a rule. Review later found that our "same visual row" comparison wasn't transitive: three positions could each come before the next, in a circle. Kiro updated the spec first, added a property saying the order of records must never matter, then fixed the code.
It kept paying off. A property over the sentences TabQuest prints to explain a finding turned up "1 reachable focus positions", broken grammar that no example test had asked about. In the Crew app, Python's Hypothesis library exposed two different findings collapsing into one.
The habit I took from this: a new test has to fail on the broken code before I trust it passing. Kiro also broke code on purpose (mutation testing) to check the tests would notice.
Kiro walked into the trap
Using the Playwright MCP server, Kiro drove the deployed shop with real key presses. Six Tabs, Enter, and it was stuck in "Join the Coven", exactly where a person would be. On the fixed page it completed the order. It was an independent check on our own explorer.
Hooks: silent, then red to green
Kiro hooks run a command when something happens, like saving a file. Ours looked correct, and on Windows they never fired: Kiro passes a backslash path, and our patterns expected forward slashes. An automation that never fires looks exactly like one that always passes. Kiro rewrote the patterns and added a check covering both path styles.
Later, Varesh recorded the full loop in the Kiro CLI: remove the Escape fix and the hook turns red; Kiro writes it back from the bugfix spec and the hook turns green.
Steering and custom agents that pushed back
Steering files tell Kiro the project's rules. In one task we asked for a new summary to be reachable by Tab, and Kiro declined to add a tabindex to plain text, because our accessibility steering forbids it. It checked reachability through reading order and headings instead.
We also ran a custom a11y-reviewer agent over a visual redesign. It noticed that two cues which didn't rely on colour had been dropped, and Kiro restored them.
Kiro as tester and auditor
Some of the most useful sessions built no features at all. Asked to harden the web app's tests, Kiro added dozens of them, broke the code deliberately to prove they bite, and found two real bugs on the way: a "jump to step 1" link on a recording with no steps, and an unfinished run that looked complete on screen. It then fixed both, spec first.
It even tested our writing. Kiro added checks that compare the claims in our README with the recorded data, and they immediately failed: the README quoted a key-press count that no longer matched. Documentation that can fail a build is a wonderful thing.
One tool, several ways to work
The Kiro CLI was our workhorse. Headless runs let each task be one scoped command, and we often had two or three sessions working side by side in separate git worktrees. I used the Kiro IDE for a batch of spec-first changes where I wanted to watch closely. And because you can choose the model per session, quick mechanical jobs went to a light, cheap one, while code and reviews got stronger ones. Spending effort where it matters is a small feature that adds up fast.
A power that carries the know-how
Kiro built our own power, tabquest-keyboard-audit. We installed it, opened an unrelated empty folder and asked about a keyboard trap in a promo popup. Kiro activated the power and answered with TabQuest's rules for telling a trap from a deliberate loop.
That's my favourite kind of feature: what we learned the hard way is now something another developer can install.
Every one of these is backed by files and logs in the repository: see the Kiro write-up.
From a scan to a watch: TabQuest Patrol on Kiro Crew
CI covers the code you ship. It doesn't cover a marketing popup added through a tag manager on a Tuesday. For that you need something that keeps looking.
So I built TabQuest Patrol, an app for Kiro Crew. You give it pages to watch. It runs TabQuest on them, compares each run with the last one, and tells you what is new and what is fixed.

- Run history and diffs, so you can see when a trap appeared.
- A notification when a new trap or blocked goal shows up.
- A draft fix with the usual repairs: Escape closes, focus returns to the button that opened the popup, the close control is a real
<button>. - Issue text you can paste into a tracker, with steps to reproduce and the WCAG criterion.
- A regression test, when the run leaves a usable trace.
- A patrol agent with no shell access, and a nightly schedule that ships paused so an idle install costs nothing.

What Crew taught me that documentation didn't
Every change started as a requirement in the spec, and Kiro then ran it in a separate test gateway, the way a user would. Those live runs found what unit tests could not:
- An agent session couldn't call the app's own routes. It was refused for lack of a dashboard credential, so Kiro wrote a small MCP server to give the agent a proper way in.
- A real "inconclusive" result from the command line was being recorded as an error, so the inconclusive notice could never fire.
- Our own setup panel dropped keyboard focus. In an accessibility tool. That one stung, and it got its own requirement, tests and fix.
Property tests earned their place here too. They found that two findings, one with an empty container name and one with none, collapsed into one identity, so a new trap could have hidden behind an old one.
I also let Kiro run on a schedule, picking up work while I was away, with reviews before anything merged.
When the log was wrong
Unattended doesn't mean unchecked.
In review, some times in Kiro's own session log didn't match its commits. One entry ended at a time that hadn't arrived yet. The code was fine. The record was not.
The rows were corrected, with a note saying so, and the Patrol repository now has a test that checks log times against git. This changed how I think about agents more than any feature that worked first time. I don't want to rely on an agent being right. I want a setup where being wrong gets noticed.
What TabQuest doesn't do
- It is a bounded keyboard audit, not a WCAG compliance check. A clean run doesn't prove a page is accessible.
- It tests with five keys in Chromium. Widgets that need arrow keys show up as blocked, not as traps.
- It doesn't look inside shadow DOM or iframes.
- It checks one task at a time, and says nothing about screen readers, zoom or contrast.
- Patrol's live runs were done on Windows, plus an install on macOS by Varesh. Its automated tests also run on Linux.
Why I'd reach for Kiro again
What impressed me most wasn't speed, although it was fast. It was that Kiro made careful work the easy path. Specs gave me something to disagree with early. Properties argued back when my reasoning was sloppy. Steering remembered the rules when I was tired. Hooks, MCP and powers connected it all to the real world, and Crew let the result keep watch after the coding was done.
I used to ask "does it look right?" Now I ask "what would prove it wrong?" That shift is the best thing I'm taking away from Kiroween.
What I'd tell another team
- Review the spec, not just the diff. The cheapest bug we fixed never became code.
- Run your automation once and watch it fire. On every operating system you claim to support.
- Make new tests fail first. A property that passes on the buggy version proves nothing.
- Say "inconclusive" when you mean it. People forgive a tool that admits it didn't finish. They don't forgive a false "all clear".
- Keep the agent's work checkable. Specs, logs tied to commits, and tests that catch a wrong record.
Credits and links
I built TabQuest with my friend and teammate Varesh (@Haadesx). Alongside Kiro, we also used Claude Code, Codex and DeepSeek-based agents.
- Live demo
- Demo video
- TabQuest on GitHub, including the GitHub Action
- TabQuest Patrol, the Kiro Crew app
Try this on something you've built: unplug your mouse and finish one task. See if you can get out.