LLMs can suggest shiny Web APIs your users’ browsers don’t support. A practical fix: validate model outputs against MDN’s browser‑compatibility data in a queryable database (often called a “browser‑compat‑db”). Simon Willison highlights how to work with this data in SQLite—making support checks fast and automatable.
Why this matters
Model hallucinations aren’t just wrong—they’re costly when they ship to production. Verifying Web API usage (e.g., WebGPU, File System Access, Web Share) against target browsers prevents breakage and bug backlogs.
MDN’s browser-compat-data standardizes feature support across Chrome, Firefox, Safari, and Edge. Putting it in SQLite enables dead-simple checks in CI, PR bots, or LLM tools.
Fast path: turn MDN data into an automated check
- Define targets: a canonical list like “Chrome 115+, Safari 16.4+, Firefox 116+, Edge 115+.”
- Map features: when your LLM proposes an API (e.g., navigator.clipboard.writeText), extract its MDN identifier.
- Query support: check “is_supported” for each target browser/version in the SQLite table(s).
- Decide policy: block merges on unsupported APIs or auto-suggest a progressive enhancement/fallback.
Integration patterns that work
- Pre-commit/CI: scan diffs for new Web APIs and fail if coverage is below thresholds.
- PR bot comment: post a matrix of support with links to MDN for each debated API.
- LLM tool (RAG): give your agent a “check_compat(feature, targets)” tool that returns supported/partial/unsupported.
- Runtime health: log if unsupported features are executed in real user sessions to guide progressive enhancement.
Data and queries (plain-English)
Tables typically include features, browsers, and support statements. For a given feature, join support by browser and filter on your version minimums. Flag “partial_implementation” and “prefix” notes as risks, not green lights.
If your LLM suggests WebGPU or File System Access, run: “Return support for Chrome, Safari, Firefox, Edge vs required versions. If unsupported, propose polyfills or alternative APIs.”
What Simon Willison showed
Simon demonstrates working with MDN browser‑compatibility data in SQLite—ideal for quick queries and automation. Read his write‑up for context and examples: Browser‑compat DB.
Takeaway
Before you ship LLM‑authored front‑end code, enforce an automated browser‑support check. It’s a lightweight guardrail that turns risky suggestions into shippable solutions.
Sources
- MDN Browser Compatibility Data (BCD): https://github.com/mdn/browser-compat-data
- Simon Willison on working with a browser‑compat DB in SQLite: Blog post
Enjoy content like this? Subscribe to our newsletter for weekly, practical AI tips: https://theainuggets.com/newsletter

