◉GEMINI LABJP
●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 5 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 5 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…
Articles/Dev Tools
⟐ Dev Tools/2026-04-08Advanced

Automating Accessibility Audits with the Gemini API — A Design That Survives False Positives

Build a WCAG 2.2 audit pipeline with the Gemini API. Separate what can be measured from what needs judgment, then use structured output, baseline diffing, and tiered CI gates to keep false positives from killing the practice.

gemini-api286accessibilitywcagweb-developmentautomation55python108

✦ Premium Article

I still remember the night I first pointed a Gemini-powered accessibility audit at a site I run as an indie developer.

The JSON came back with thirty-seven violations. My pulse picked up. Then I started checking them one by one in the browser. A contrast ratio the model reported as 3.1:1 measured 7.2:1 in reality — perfectly compliant. Meanwhile, a focus ring that genuinely dissolved into the background appeared nowhere in the report.

The model seemed to be looking at the screen. It was not measuring pixels.

What follows is the pipeline I rebuilt from that failure. The core idea is a single sentence: never ask a language model to compute something a formula already answers. Hold that line, and your audit output stops being a curiosity and starts being something you can gate a build on.

What the Model Must Never Measure, and What It Should Judge

WCAG success criteria fall into two very different families. Some have a formula that produces exactly one answer. Others require reading context.

Hand the first family to an LLM and you will get a plausible-looking number. It is not a measurement — it is a generation. The second family, on the other hand, is precisely where rule-based tools fall down, and precisely where Gemini earns its keep.

LayerOwnerExample criteriaBasis for the verdict
Deterministic Playwright + arithmetic 1.4.3 contrast / 2.5.8 target size / 1.1.1 presence of alt / 3.1.1 lang Computed style and bounding boxes, resolved by formula
Judgment Gemini API 1.1.1 usefulness of alt text / 2.4.4 link purpose / 1.3.1 semantic heading structure / 1.4.1 color as sole cue Requires meaning and context; no formula exists
Advisory Gemini (screenshots) Visual oddities, suspected layout breakage Treated only as a flag that queues a human review

Take 1.1.1 Non-text Content. Whether an alt attribute exists is a one-line DOM query. Whether alt="image1" actually serves as a text alternative is unanswerable without surrounding context. Sending the first question to Gemini and the second to a regular expression is the most common way this architecture goes wrong.

It is exactly the hole I fell into first.

WCAG 2.2 and the Honest Limits of Automation

WCAG 2.2 defines more than eighty success criteria, and machines cannot settle all of them. Each of the four principles has a different affinity for automation.

PrincipleRepresentative criteriaDeterministic coverageWhere AI helps
PerceivableContrast, text alternativesHighJudging the quality of alt text
OperableKeyboard access, target sizeModerateAssessing focus order sanity
UnderstandableReadability, input assistanceLowAssessing how specific error messages are
RobustMarkup conformanceHighRarely needed

Rule-based tooling reliably resolves roughly 30-40% of the criteria. The rest is human territory.

The point of adding Gemini is to convert part of that remainder into machine-readable findings — not to replace the checks that axe already performs correctly. Blur that boundary and you turn deterministic results into probabilistic ones.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦How to split the pipeline into a deterministic layer and a judgment layer so contrast ratios are never guessed by a language model
✦A response_schema and temperature 0.0 setup that stops audit JSON from drifting between runs, making diffs meaningful
✦Baseline fingerprinting and tiered CI exit codes that surface new violations without letting false positives block every build
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⟐ Dev Tools2026-09-15
The approval rules I had written never matched once — auditing my Gemini CLI policies
A deny rule I trusted for half a year had never matched. The pattern was tested against a JSON string, the folder I kept my rules in is not read, and ask_user turns into deny the moment nobody is watching. Here is the audit, and the script I wrote to keep doing it.
◈ API / SDK2026-05-17
Auto-generating Japanese and English Release Notes from git log with Gemini API — A Real Implementation from Beautiful HD Wallpapers v2.1.0
I realized I was spending 1–2 hours per release writing notes in multiple languages. Here's how I automated that with Gemini API and git log — tested on Beautiful HD Wallpapers v2.1.0, with code you can run today.
⟐ Dev Tools2026-10-17
Hung Jobs Fail Quietly — Wrapping a Scheduled Gemini Call With a Timeout, an Empty-Output Check, and a Lock
An outer shell script that protects a cron-driven `gemini -p` call from three quiet failures: hanging on a response, exiting 0 with empty output, and overlapping with the previous run. Includes exit codes and timings measured with stand-in commands, and how far `timeout` reaches into child processes.