GitHub built an alt text quality plugin for its Accessibility Scanner to catch alt text that passes automated checks but is still unhelpful, such as filenames, placeholders, or generic words. Five deterministic string-based rules run by default with no AI dependency, while an opt-in rule sends image content and page context to a vision model via GitHub Models for subjective judgments. The post details engineering decisions: catching repeated alt text based on visual layout rather than DOM order, tuning the model prompt with a decision procedure and anti-nitpick rules to avoid flooding developers with false positives, and privacy/cost tradeoffs like redacting URLs before sending data to the model. It closes with limitations, including no support for SVGs, canvas, or aria-label, and a reminder that passing automated checks is not the same as real accessibility conformance.
Table of contents
Proving a string is wrong without seeing the pictureRepetition is a layout problem, not a DOM problemGetting a model to act like a reviewer, not a criticSending images to a model is a privacy and cost decisionWhat this still can’t doWhat we’d tell you if you’re building something similarTags:Written byQuestions this post answers
Why do most automated alt text checkers miss alt text like alt="IMG_2847.png" or alt="3/5 stars" repeated across icons?
Most checkers only verify that an accessible name exists, not whether it says anything useful, because a quality-oriented rule with false positives tends to get disabled by teams. As a result, filenames, placeholders like TODO, generic words like image or logo, and repeated captions across adjacent images all pass presence checks despite being unhelpful to screen reader users. Developers hardening accessibility pipelines can follow tooling design tradeoffs like this on daily.dev.
How can I detect repeated alt text on a webpage without flagging unrelated images that happen to share the same label?
Group images by their on-screen position rather than their order in the DOM. Compare bounding boxes and only treat two images as part of the same repeated run when the gap between their boxes is small relative to the boxes' own size, since a header logo and footer logo can share alt text in markup while being nowhere near each other visually. Teams building accessibility scanners can track layout-aware detection techniques like this on daily.dev.
How do you stop a vision model from flagging every image's alt text as needing improvement?
Use a decision procedure instead of an open-ended prompt: walk four ordered steps (decorative, redundant with caption, functional, informative), stop at the first match, and force structured output with reasoning generated before the verdict. Also add explicit anti-nitpick rules that trust the author's framing, since asking a model 'could this be better?' always yields yes. Anyone tuning LLM-based review tools can follow prompt design lessons like these on daily.dev.
19.4K Impressions1 Comment