Use this prompt when your product pipeline generates UI components, page layouts, or content blocks through an AI model and you need a structured compliance gate before those artifacts reach production. This playbook is built for frontend engineering teams, content operations engineers, and accessibility specialists who must enforce WCAG 2.2 Level AA or Section 508 conformance without manually reviewing every AI output. The prompt produces a pass, fail, or needs-human-review decision with specific success criterion references, violation severity, and remediation guidance. It does not replace automated accessibility testing tools like axe-core or Lighthouse. Instead, it acts as a pre-tool gate that catches structural and semantic issues automated scanners miss, such as heading hierarchy violations, missing ARIA roles on custom widgets, color contrast intent, and focus order logic. Wire this prompt into your CI/CD pipeline, content approval workflow, or design system governance process as a blocking check before automated tests run.
Prompt
Accessibility Compliance Gate Prompt

When to Use This Prompt
A pre-tooling gate for AI-generated UI and content that catches structural accessibility violations automated scanners miss.
The ideal user is an engineering lead or platform engineer responsible for AI output quality gates. They have access to the raw AI-generated HTML, component code, or content payload, and they need a consistent, auditable compliance signal before the artifact proceeds to browser-based testing. The prompt requires the artifact itself, the applicable standard (WCAG 2.2 AA or Section 508), and optionally a component type hint to focus the analysis. Do not use this prompt for runtime DOM analysis of live pages—that is the job of axe-core. Do not use it for color contrast ratio calculations, which require pixel-level computation. Instead, use it to catch intent-level failures: a <div> with an onClick handler that lacks role="button", a heading that jumps from <h1> to <h3>, or an image with a placeholder alt attribute. These are the violations that survive automated scans and accumulate into real user harm.
Before integrating this prompt into a blocking gate, run it against a golden set of 20–30 known-clean and known-violating artifacts to calibrate its sensitivity. False negatives—passing a component that contains a real WCAG failure—are more dangerous than false positives, so tune your eval thresholds to favor needs-human-review over pass when the model is uncertain. Pair this prompt with a structured output schema that includes violations as an array of objects, each with criterion_id, severity, element, and remediation. Log every gate decision with the artifact hash, model version, and timestamp so you can audit decisions later. If the prompt flags a needs-human-review, route the artifact to a review queue with the full violation context attached—never silently pass it.
Use Case Fit
Where the Accessibility Compliance Gate Prompt works, where it fails, and what inputs it assumes before you wire it into a product pipeline.
Good Fit: Pre-Release UI Review
Use when: integrating the prompt into a CI/CD pipeline to scan AI-generated HTML, React, or SwiftUI components before a release branch is cut. Why it works: the prompt expects structured component descriptions and returns a deterministic JSON gate decision that can block a deploy. Guardrail: pair with a schema validator that rejects any gate output missing required fields like violations or overall_verdict.
Bad Fit: Live User-Generated Content
Avoid when: trying to screen real-time user posts or dynamic chat messages for accessibility. Why it fails: the prompt is designed for structured UI code, not freeform text, and the latency of an LLM gate is too high for a synchronous user-facing write path. Guardrail: use a lightweight, rule-based linter for real-time content and reserve this prompt for asynchronous review of templates or generated artifacts.
Required Inputs
What you must provide: a [COMPONENT_CODE] block containing the rendered markup or a structured description of the UI element, and a [STANDARD] field set to WCAG_2.1_AA or Section_508. Why it matters: without the code, the model hallucinates violations; without the standard, it applies an inconsistent rule set. Guardrail: the application layer should reject the request before it reaches the model if either input is empty.
Operational Risk: False Passes on Complex Widgets
What to watch: the model may return a PASS verdict for a complex date picker or modal dialog that has subtle focus-trapping or ARIA misconfiguration. Why it happens: the model evaluates the code as written, not the runtime behavior. Guardrail: for any component with role attributes or JavaScript event handlers, flag the gate result as NEEDS_MANUAL_REVIEW and route to a human auditor.
Operational Risk: Hallucinated Success Criteria
What to watch: the model may cite a WCAG success criterion number that doesn't exist or misattribute a color contrast failure to a keyboard navigation rule. Why it happens: the model is generating plausible references, not retrieving from a canonical WCAG database. Guardrail: post-process the output against a hardcoded list of valid SC numbers (e.g., 1.4.3, 2.1.1) and quarantine any gate decision with an invalid reference.
Not a Replacement for Automated Testing
What to watch: treating this prompt as a substitute for axe-core, Lighthouse, or a screen reader test suite. Why it fails: the prompt performs a static code review, not a runtime accessibility tree audit. Guardrail: use this prompt as a pre-filter to catch obvious issues early and block clearly non-compliant code, but always run an automated testing tool in the same pipeline step before merging.
Copy-Ready Prompt Template
A system-prompt template for evaluating AI-generated UI or content against WCAG 2.1/2.2 and Section 508, producing a structured compliance gate decision.
This prompt template is designed for injection as a system or developer message in a compliance gate pipeline. It instructs the model to act as an accessibility compliance auditor, evaluating a proposed [COMPONENT_OR_CONTENT] against the provided [WCAG_VERSION] and [STANDARD] criteria. The output is a structured JSON gate decision that can be parsed by downstream orchestration logic to either allow the workflow to proceed, block it for remediation, or flag it for human review. The template uses square-bracket placeholders for all dynamic inputs, ensuring it can be adapted to different accessibility standards, risk tolerances, and output schemas without modifying the core instruction logic.
textYou are an accessibility compliance auditor. Your task is to evaluate the following [COMPONENT_OR_CONTENT] against [WCAG_VERSION] Level [CONFORMANCE_LEVEL] and [STANDARD] requirements. ## INPUT [COMPONENT_OR_CONTENT] ## CONTEXT - Component Type: [COMPONENT_TYPE] - User Context: [USER_CONTEXT] - Platform: [PLATFORM] - Assistive Technology: [ASSISTIVE_TECHNOLOGY] ## CONSTRAINTS - Only evaluate against the success criteria explicitly listed in [WCAG_VERSION] Level [CONFORMANCE_LEVEL]. - Do not invent or assume success criteria that are not part of the specified standard. - If the component relies on dynamic behavior or complex state changes, flag it for manual review rather than making assumptions. - For any violation, cite the specific success criterion identifier and provide a concise description of the failure. - If insufficient information is provided to evaluate a criterion, mark it as "INSUFFICIENT_DATA" rather than passing or failing. ## OUTPUT_SCHEMA Return a single JSON object with the following structure: { "gate_decision": "PASS" | "FAIL" | "NEEDS_REVIEW", "summary": "One-sentence summary of the overall assessment.", "violations": [ { "criterion_id": "e.g., 1.1.1", "criterion_name": "e.g., Non-text Content", "severity": "CRITICAL" | "MAJOR" | "MINOR", "description": "Specific description of the failure.", "location": "Identifier for the affected element or region.", "remediation": "Actionable guidance to fix the violation." } ], "warnings": [ { "criterion_id": "...", "description": "Potential concern that does not clearly fail but warrants attention." } ], "needs_review_reasons": [ "Reason why human review is required, if applicable." ], "insufficient_data_criteria": [ "List of criterion IDs that could not be evaluated due to missing information." ] } ## RISK_LEVEL [RISK_LEVEL] ## EXAMPLES [EXAMPLES] ## INSTRUCTIONS 1. Analyze the [COMPONENT_OR_CONTENT] against each applicable success criterion. 2. For each violation, provide the structured output as defined in OUTPUT_SCHEMA. 3. If [RISK_LEVEL] is "HIGH", any CRITICAL violation must result in a "FAIL" gate decision. 4. If [RISK_LEVEL] is "LOW", only CRITICAL violations that affect core functionality should result in "FAIL"; others may result in "NEEDS_REVIEW". 5. If you are uncertain about a violation or the component involves complex interactive behavior, set gate_decision to "NEEDS_REVIEW" and populate needs_review_reasons. 6. Do not include any text outside the JSON object.
To adapt this template for your pipeline, replace each square-bracket placeholder with concrete values before execution. The [COMPONENT_OR_CONTENT] placeholder should receive the raw UI markup, content fragment, or component description to be evaluated. [WCAG_VERSION] and [CONFORMANCE_LEVEL] define the evaluation standard (e.g., "WCAG 2.2" and "AA"). [STANDARD] allows you to specify additional frameworks like "Section 508". The [RISK_LEVEL] placeholder controls the strictness of the gate decision: use "HIGH" for customer-facing production workflows where accessibility failures carry legal or reputational risk, and "LOW" for internal tools or early-stage prototypes where the goal is awareness rather than enforcement. The [EXAMPLES] placeholder should be populated with few-shot demonstrations of correct evaluations for your specific component types, which significantly improves accuracy on complex UI patterns. After the model returns the JSON, validate the output against the schema before acting on the gate decision. For any "NEEDS_REVIEW" or "FAIL" decision, route the full violation payload to your human review queue or remediation pipeline. Never execute a blocked workflow without documented override justification.
Prompt Variables
Every placeholder the Accessibility Compliance Gate Prompt expects, its purpose, a concrete example, and actionable validation rules to prevent silent failures in production.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[UI_CODE_OR_DESCRIPTION] | The frontend component, markup, or design description to evaluate for WCAG/508 compliance | <button onclick='submit()'><img src='send.svg'></button> | Required. Must be non-empty string. Reject if only whitespace. For HTML, validate parseable structure before sending to model. |
[APPLICABLE_STANDARD] | The specific accessibility standard or version to evaluate against | WCAG 2.1 Level AA | Required. Must match known standard string: 'WCAG 2.0', 'WCAG 2.1', 'WCAG 2.2', 'Section 508'. Reject unknown values before prompt assembly. |
[COMPONENT_TYPE] | The UI component category to scope the evaluation and select relevant success criteria | interactive-button | Required. Must be from allowed enum: 'form-input', 'navigation', 'modal-dialog', 'data-table', 'interactive-button', 'media-content', 'page-structure', 'custom-widget'. Default to 'custom-widget' if unknown. |
[CONTEXT_SNIPPET] | Surrounding page context or user flow description to assess the component in its real environment | This button appears in a checkout flow after the order summary. It submits the payment form. | Optional. If provided, must be under 500 tokens. Null allowed. If null, model must note that context-dependent criteria cannot be fully evaluated. |
[PREVIOUS_AUDIT_NOTES] | Prior accessibility findings or known issues for this component to check for regression | Previously failed 1.1.1 for missing alt text on icon buttons. Fixed in v2.3. | Optional. Null allowed. If provided, model must explicitly verify whether prior issues persist. Parse as string array if multiple notes. |
[OUTPUT_SCHEMA] | The exact JSON schema the model must use for its compliance assessment response | See output-contract table for full field definitions | Required. Must be valid JSON Schema object. Validate schema parse before prompt assembly. Model output must pass structural validation against this schema post-generation. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score below which the assessment must escalate to human review rather than auto-pass or auto-fail | 0.85 | Required. Must be float between 0.0 and 1.0. If model returns confidence below this threshold for any violation, the gate must block and route to human review queue regardless of pass/fail status. |
Implementation Harness Notes
How to wire the Accessibility Compliance Gate Prompt into a CI pipeline, content approval workflow, or pre-release review queue.
This prompt is designed to act as a blocking gate, not a passive linter. It should be integrated directly into the path that publishes or deploys UI components, content fragments, or design system changes. The harness must treat a status: "FAIL" or status: "NEEDS_REVIEW" as a hard stop that prevents the artifact from progressing to production. Because accessibility failures carry legal and reputational risk, the implementation must produce an auditable record of every gate decision, including the model's reasoning, the specific success criteria cited, and the remediation guidance provided.
Wire the prompt into your application by placing it after the AI generation step and before any deployment or publish action. The harness should: (1) assemble the prompt with the [COMPONENT_SPEC] or [CONTENT_PAYLOAD] and the [TARGET_STANDARD] (e.g., WCAG 2.2 AA); (2) call the model with a low temperature (0.0–0.1) to maximize deterministic, repeatable assessments; (3) parse the JSON output and validate the schema strictly—reject any response missing required fields like status, violations, or remediation; (4) on parse failure, retry once with a repair prompt that includes the raw output and the expected schema; (5) if status is FAIL, block the pipeline and surface the violations array and remediation guidance to the developer or content author; (6) if status is NEEDS_REVIEW, route the assessment to a human review queue with the full payload, the model's reasoning, and a link to the relevant WCAG success criterion documentation; (7) log the full prompt, response, and gate decision to an audit store for compliance evidence. For high-throughput pipelines, consider caching assessments for identical component signatures to avoid redundant API calls.
The most dangerous failure mode in production is a false pass on complex interactive components—dynamic widgets, modal dialogs, custom select elements, or drag-and-drop interfaces. The model may assess static markup as compliant while missing keyboard trap issues, focus order problems, or missing ARIA live region announcements. To mitigate this, the harness should maintain a registry of known complex component types and automatically escalate any assessment involving them to NEEDS_REVIEW regardless of the model's confidence score. Additionally, implement a sampling-based eval loop: periodically pull gate decisions, have a human accessibility specialist review a random sample, and feed any false passes back as counterexamples in the prompt's [EXAMPLES] block. Do not allow the gate to be silently bypassed with an override flag that lacks a required justification field—every override must capture who approved it, why, and what compensating controls are in place.
Expected Output Contract
The JSON schema, field descriptions, and validation rules your application must enforce on the model response for the Accessibility Compliance Gate Prompt.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
compliance_status | enum: ["pass", "fail", "needs_review"] | Must be exactly one of the three allowed string values. Reject any other status. | |
assessment_summary | string | Must be a non-empty string between 50 and 500 characters. Reject if null, empty, or outside length bounds. | |
violations | array of objects | Must be a valid JSON array. If compliance_status is "pass", the array must be empty. Validate with JSON.parse and length check. | |
violations[].element_id | string or null | Must be a string referencing a specific UI element from [INPUT_CONTENT] or null if the violation is global. Reject if missing key. | |
violations[].wcag_criterion | string | Must match the regex pattern ^\d+.\d+.\d+ [A-Z]+$ (e.g., "1.4.3 AA"). Reject if format is invalid. | |
violations[].severity | enum: ["critical", "major", "minor"] | Must be exactly one of the three allowed string values. Reject any other severity level. | |
violations[].description | string | Must be a non-empty string describing the violation. Reject if null or empty. | |
violations[].remediation | string | Must be a non-empty string with actionable guidance. Reject if null, empty, or contains only generic advice like "fix it". | |
remediation_priority | array of strings | Must be a valid JSON array of element_id strings from the violations list, ordered by severity. If compliance_status is "pass", this must be an empty array. Validate ordering matches severity hierarchy. |
Common Failure Modes
What breaks first when using the Accessibility Compliance Gate Prompt in production and how to guard against it.
False Pass on Complex Components
What to watch: The model approves a complex UI pattern (e.g., a custom date picker or drag-and-drop list) as compliant because it cannot fully reason about the interactive states, focus management, and ARIA live regions involved. Guardrail: Add a rule that any component with more than two interactive states or custom keyboard handling is automatically flagged as needs-manual-review regardless of the model's initial assessment.
Hallucinated Success Criteria
What to watch: The model invents WCAG success criteria numbers or misattributes a violation to a non-existent guideline, creating a false audit trail. Guardrail: Post-process the output against a hardcoded list of valid WCAG SC numbers. If a cited criterion does not exist in the reference list, reject the finding and request a re-evaluation with the correct taxonomy.
Color Contrast Calculation Errors
What to watch: The model estimates contrast ratios from hex codes or visual descriptions instead of computing them, leading to incorrect pass/fail decisions on text and non-text contrast. Guardrail: Never rely on the model for contrast math. Pipe the extracted foreground/background colors to a deterministic contrast ratio calculator tool and use the model only to interpret the tool's result against the threshold.
Ignoring Dynamic Content Changes
What to watch: The prompt evaluates a static screenshot or code snippet and misses violations that only occur after user interaction, such as missing focus indicators, unannounced content updates, or broken skip navigation links. Guardrail: Include a mandatory checklist item in the prompt requiring the model to state explicitly whether it has evaluated all interactive states. If not, the output must be classified as incomplete rather than pass.
Over-Flagging Benign Patterns
What to watch: The model flags technically compliant patterns as violations due to overly conservative interpretation, flooding the review queue with false positives and eroding trust. Guardrail: Require the model to cite the exact paragraph from the success criterion's understanding document for every violation. If it cannot provide a precise match, downgrade the finding to advisory instead of violation.
Context Window Truncation on Large Pages
What to watch: When evaluating a full page with extensive rendered HTML or a long transcript, the model loses early content from its context window, missing violations in the header, navigation, or initial landmarks. Guardrail: Chunk the input by landmark region or component boundary. Run the gate check on each chunk independently and merge the results with a deduplication step before presenting the final compliance report.
Evaluation Rubric
Run these checks against a golden dataset of 20-50 UI components with known accessibility issues (including false positives, borderline cases, and complex widgets) before shipping this prompt to production.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Violation Recall |
| Known violations are missed or assigned to the wrong SC (e.g., color contrast reported as 1.4.3 when it is 1.4.11) | Compare prompt output against ground-truth labels for each component; count false negatives and SC misattributions |
False Positive Rate | <= 10% of compliant components are incorrectly flagged as having violations | Clean components receive violation reports; phantom issues are invented for standard HTML elements | Run prompt against known-clean components; count any violation report as a false positive |
Severity Accuracy |
| A Level A failure is marked Moderate; a Level AAA advisory is marked Critical | Cross-reference severity labels against WCAG conformance level for each reported SC; count mismatches |
Remediation Actionability |
| Remediation says 'fix contrast' without specifying target ratio, element selector, or CSS property | Manual review by a frontend engineer: rate each remediation as actionable or vague; calculate actionable percentage |
Complex Component Handling | Prompt correctly identifies violations inside composite widgets (tabs, modals, autocomplete, data grids) without hallucinating issues on the container | Prompt reports 'missing aria-expanded' on a disclosure that already has it; fails to detect missing focus trap in a modal | Include 5-8 complex components in the golden set; compare prompt output to manual audit results |
False Pass Detection | Prompt flags at least 80% of components that appear compliant but fail under assistive technology (e.g., correct roles but broken keyboard navigation) | Prompt passes a custom dropdown that has proper ARIA but does not respond to arrow keys | Include 5-10 'false pass' components in the golden set; measure detection rate |
Output Schema Compliance | 100% of responses parse against the expected [OUTPUT_SCHEMA] without missing required fields or type errors | JSON is missing the affected_success_criteria array; severity is a string instead of an enum value | Validate every response against the output schema using a JSON Schema validator; count parse failures |
Source Grounding | Every reported violation cites a specific WCAG success criterion number and describes how the component fails it; no hallucinated criteria | Prompt cites 'WCAG 2.1 1.4.12' for a text-spacing issue that is actually 1.4.4; invents a non-existent SC number | Check all cited SC numbers against the official WCAG 2.1/2.2 quick reference; flag any invalid or mismatched citations |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single WCAG level and a simplified output schema. Drop the remediation guidance section and focus only on pass/fail per success criterion. Run against a small set of known UI snippets to calibrate before expanding scope.
codeEvaluate [UI_SNIPPET] against WCAG 2.1 Level AA. Return JSON with: - criterion_id - status: pass | fail | needs_review - violation_description (if fail)
Watch for
- Over-flagging color contrast issues on elements that are decorative or disabled
- Missing
needs_reviewfor complex interactive components like date pickers or drag-and-drop - Hallucinated WCAG criterion numbers that don't exist in the spec

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us