AI-Generated Code Copyright and Legal Basics for Apps
AI-generated code copyright: who owns the code your coding agent wrote
Updated
AI-generated code copyright is the first legal question to settle before launch, because code a coding agent wrote from prompts alone is likely unprotected in the US. This page is Step 9 of 12 in the Vibe Coding guide. You leave with the copyright rules for agent-written code, an outline for Bookly's privacy policy, a cookie consent and accessibility checklist, the deposit and refund terms to write, and a routine that checks dependency licenses.
Bookly, the salon booking app that runs through this guide, is the example on this page. Its policy, cookie banner, deposit terms and license checks are illustrations of what a real app needs, not results. This page is general information, not legal advice. Rules vary by jurisdiction, so have a lawyer review your final policy and terms before launch.
Related guides: deployment and hosting, Claude Code deep dive, vibe coding security, architecture and the stack.
This page is general information, not legal advice. Rules vary by jurisdiction, so have a lawyer review your privacy policy, terms and refund terms before launch.
AI-Generated Code Copyright
Code From Prompts Alone Is Likely Unprotected in the US
US copyright protects human authorship. Code that a coding agent produced from your prompts alone likely falls into the public domain, so a competitor can copy it. Your own contribution can be protected: the code you write yourself, and the selection, arrangement and modification of agent output. No clear threshold says how much human work is enough, so courts judge mixed work case by case.
Use this as the default: treat agent output as unprotected unless your commit history shows the human authorship.
US Copyright Office Guidance
Three reports on AI and copyright. Part 1 and Part 2 are final. Part 3 is a pre-publication version.
Part 2 is the only final guidance on who owns AI output. Build your ownership record around it.
Thaler v. Perlmutter: The Human Authorship Rule
Copyright needs a human author. The Supreme Court declined to hear the case.
Purely AI-generated code has no US copyright. Mixed code is judged case by case.
Doe v. GitHub: The Ninth Circuit Ruling
Decided September 16, 2026. The DMCA route against attribution claims is now narrow.
Doe v. GitHub was filed in November 2022 in the Northern District of California. It alleges that Copilot was trained on licensed code (GPL, MIT and Apache) and outputs code without the required attribution. The district court dismissed the DMCA 1202(b) claims in July 2024. On September 16, 2026, the Ninth Circuit affirmed that dismissal (No. 24-7700).
The court held that output which lacks attribution is not the same as removed copyright management information. It rejected a strict identical-copy rule. It also said plaintiffs must plead that copyright management information was removed from copies of an existing work. The training-stage theory was not decided, because it was not preserved.
Plaintiffs floated a theoretical DMCA damages figure in the $9B+ range. That is the plaintiffs' number, not a judgment.
What this means for you: the ruling does not make licensed code safe to copy. Ordinary copyright and license claims can still apply to code that closely copies a licensed work.
Two 2026 Disputes Show the Risk
- Claude Code source leak (March 31, 2026). After the source leaked through a source map file, Anthropic filed DMCA takedowns that removed more than 8,000 GitHub copies. An AI-written Python port stayed online. Commentators note that only the human-authored parts are protectable.
- chardet 7.0.0 relicense (March 2026). An AI-driven rewrite moved the library from LGPL to MIT. The original author objected on GitHub. Critics argue the output may still be a derivative work, or that AI output cannot be licensed at all. No court has ruled.
Do not ask a coding agent to rewrite a GPL library so you can relicense it.
License Check for Dependencies and Agent Code
Two risks reach an app maker: code an agent copied from a licensed project, and a dependency whose license conflicts with your product.
- List every dependency, direct and indirect, with its license. Your package manager's lock file holds the full list.
- Flag any GPL or AGPL license in a closed-source product. Permissive licenses such as MIT and Apache 2.0 still require attribution.
- Run a similarity check on agent-written files with a software composition analysis (SCA) tool that includes similarity detection.
- Record each flagged item, the scan date, and the person who decided what to do about it.
- Repeat the scan before each release and after each new dependency.
Copyleft cannot attach to output that has no copyright. If an agent's output is unprotected, a license on it has little to bind, and the real exposure is copied code. That exposure grows when AI output closely tracks copyleft code and lands in a proprietary component.
GitHub offers a public code filter for Copilot suggestions, and its documentation explains how the filter works.
You are legally responsible for code you ship, regardless of who wrote it. Run license scanners before each release, and understand the difference between permissive and copyleft licenses.
Bookly, as an illustration: when the scan flags a GPL package that a helper library pulled in, the team has two fixes before launch. It can replace the package, or it can obtain a license that allows the use. A flag starts a task. It is not a finding about Bookly.
What to Do Before You Ship Agent-Written Code
Copyright gives weak protection to agent output. Use these steps for what copyright cannot protect.
- Record human decisions: the prompts you wrote, the reviews you made, and the edits you kept. Keep the commit history that shows them.
- Treat the code as a trade secret: keep the repository private, limit access, and do not publish the source.
- Use contracts with contractors and collaborators to set who owns the code and who can reuse it.
- Read the current business terms of each coding tool before you rely on any ownership or copyright promise.
- Rules outside the US differ. This page covers US rules only.
Registration and the Open Test Case
Applies if you ever register the code with the US Copyright Office.
An application must disclose AI-generated material that is more than a de minimis amount, and disclaim it. The Copyright Office set this rule in its March 2023 guidance.
If Bookly's owner ever registers the code, the application must separate the human-written parts from the agent-written parts.
The open test case is Allen v. Perlmutter (D. Colo., No. 1:24-cv-2665). It concerns a heavily prompted and edited AI image. Summary judgment motions were briefed by January 2026. Its outcome could change how courts measure human input.
Global Privacy & GDPR
172 Countries Have Data Privacy Laws
Graham Greenleaf (UNSW) counted 172 countries with enacted data privacy laws as of March 2025, adding 12 new laws in 2023 and 2024, at an average of 5.4 per year since 2020. Counts differ. The IAPP counts about 144 countries with laws in force. Thresholds decide which businesses a law covers, so check each law that could apply to you.
GDPR Fines Are Intensifying
Cumulative GDPR fines reached about EUR 7.1 billion by January 2026, according to DLA Piper's annual survey.
Ireland's Data Protection Commission has issued about EUR 4.04B in cumulative fines, led by Big Tech. Meta (EUR 1.2B) and LinkedIn (EUR 310M) are among the largest. The largest 2025 fine was EUR 530M, for international data transfers, issued in April 2025.
Voodoo Games (CNIL)
French mobile game developer fined 3M EUR for reading an advertising identifier without consent. Directly relevant to app developers.
Polish Company (Bisnode): about 220K EUR
Failed to give the people whose data it processed the Article 14 privacy notice. A warning for anyone who processes third-party data.
UK GDPR Post-Brexit
The ICO issued fewer enforcement actions in 2025 but collected far more in fines.
The Data (Use and Access) Act 2025 (DUAA) received Royal Assent on June 19, 2025, and its main parts commenced on February 5, 2026. It raised the PECR fine cap for electronic marketing and cookie breaches to the UK GDPR level: up to GBP 17.5M or 4% of global turnover. It also adds consent-free exceptions for some low-risk cookie uses, with strict conditions. Check the ICO's cookie guidance before you rely on one.
2025 in numbers: The ICO issued 31 enforcement actions and 15 fines in 2025, about half the number of actions in 2024. The average fine rose to about GBP 1.45M, so one case can cost a small app far more than the 2024 average did.
US & International Privacy Laws
20 States With Comprehensive Privacy Laws
Twenty US states have comprehensive consumer privacy laws in effect as of 2026, counting Florida, whose law has a narrower scope. No comprehensive federal privacy law exists.
California
Only state with a dedicated agency (CPPA), broadest scope, and the only private right of action for data breaches.
Texas
The Texas privacy law is Tex. Bus. & Com. Code ch. 541. Read the chapter for its scope and any size exemption before you assume your app is out of scope.
Maryland
Strictest data minimization. Bans the sale of sensitive data entirely.
Rhode Island
35,000 consumers, or 10,000 if more than 20% of revenue comes from selling data. No cure period, and fines up to USD 10,000 per violation.
Connecticut
35,000 consumers under the general threshold. Any business that processes sensitive data or sells personal data is in scope. The minors rules are stronger (amendments effective July 1, 2026).
Indiana and Kentucky
Both took effect January 1, 2026. Each gives a 30-day cure period, and fines up to USD 7,500 per violation.
CCPA/CPRA Enforcement
Penalties are assessed per violation. The amounts were adjusted on January 1, 2025, and the next inflation adjustment is due in 2027.
General Motors
$12.75MCalifornia AG settlement (May 8, 2026). The first CCPA data-minimization case: driver data was sold to LexisNexis and Verisk. The largest CCPA settlement to date.
Disney
$2.75MCalifornia AG, announced February 11, 2026. The opt-out worked only per service or device, and Global Privacy Control was honored only on the device that sent it.
PlayOn Sports
$1.1MCalifornia Privacy Protection Agency action, March 3, 2026.
Tractor Supply Co.
$1.35MThe CPPA's largest fine to date (Sept 2025). No working opt-out, including GPC. The policy lacked consumer rights information, and data was shared without the required contracts. The case started from a single consumer complaint.
Jam City
$1.4MNo CCPA-compliant opt-out in any of its 21 apps. The data of users aged 13 to 16 was sold or shared without opt-in consent.
Healthline Media
$1.55MJuly 2025. Failed to honor opt-outs for targeted ads, and shared health condition data with third parties. Later settlements are larger, but this case shows a common opt-out failure.
Todd Snyder, Inc.
$345,17840-day delay processing opt-outs. Required photo ID for opt-out requests, classified as a dark pattern.
GPC Enforcement Is Top Priority
Businesses must honor browser-based Global Privacy Control signals in a frictionless manner. A growing list of states, including California, Colorado and Connecticut, recognizes universal opt-out signals such as GPC. Under the California Delete Act, data brokers must access the DROP deletion platform at least every 45 days from August 1, 2026. A typical app is not a data broker.
COPPA Enforcement
The FTC aggressively targets app developers who collect children's data.
Epic Games (Fortnite): $275M
Dec 2022. A $275M COPPA civil penalty, plus $245M in refunds over dark-pattern charges.
Disney: $10M
Announced Sept 2025 and approved by the court in Dec 2025. It covered YouTube videos not labeled "Made for Kids." Disney also agreed to a 10-year video review program.
NGL Labs: Banned for Under-18s
Jul 2024. The FTC order bars NGL Labs from offering its anonymous-messaging app to users under 18.
HyperBeard: $4M penalty, $150K paid
2020. Collected children's persistent identifiers via third-party ad SDKs without consent. Most of the $4M civil penalty was suspended on payment of $150K.
Amended COPPA Rule: Now Enforced
The amended rule took effect June 23, 2025. The full compliance deadline was April 22, 2026, and it has passed. It requires separate opt-in consent for sharing children's data with third parties. An FTC policy statement of February 25, 2026 limits enforcement where children's data is collected only for age verification. Embedding third-party SDKs inherits their COPPA violations. Your vendors' COPPA missteps are your own.
FTC Health Breach Notification Rule
The amended rule took effect July 29, 2024, and covers health and wellness apps outside HIPAA.
GoodRx
$1.5MFirst-ever HBNR enforcement (Feb 2023). Shared prescription data with Facebook and Google via tracking pixels.
BetterHelp
$7.8MMar 2023. Shared mental health data with Facebook, Snapchat, and Pinterest for advertising. Misrepresented HIPAA compliance.
Premom (Easy Healthcare)
$200KMay 2023. Fertility app shared health data with third-party SDKs ($100K FTC penalty plus $100K to state AGs).
Context Reveals Conditions
Sharing data that reveals a health condition with an ad or analytics tool has led to FTC cases, including GoodRx and BetterHelp. Context can make an ordinary field reveal a condition, so review what each tool receives on a health page, not only the form fields.
Canada, Australia, Brazil
Canada
PIPEDA still governs. Bill C-36 was tabled June 15, 2026.
Bill C-36 would replace PIPEDA's privacy part and create a commission with binding order powers. It is at first reading. Under PIPEDA today, the Privacy Commissioner cannot impose fines. An offence can carry a fine of up to $100,000 CAD.
Quebec Law 25 (fully effective Sept 2024) requires explicit opt-in consent for sensitive data and cookies. Penalties reach $25M CAD or 4% of gross worldwide revenue.
Australia
POLA Act passed Dec 2024.
A statutory tort for serious privacy invasions commenced June 10, 2025, allowing Australians to sue for up to AU$478,550 in damages.
The small business exemption (businesses under AU$3M annual turnover) is still in force. An exposure draft of the Privacy Amendment (Personal Data Protection) Bill 2026 was released August 31, 2026. No commencement date has been legislated.
There is no specific cookie consent law in Australia currently.
Brazil
The ANPD has issued early LGPD fines and orders.
The first-ever LGPD sanction hit Telekall Infoservice, a micro-company telecom, with BRL 14,400 for processing data without legal basis and failing to appoint a DPO.
ANPD suspended Meta's use of Brazilian user data for AI training in July 2024, threatening BRL 50,000 per day.
Cookie Consent by Jurisdiction
Default to the highest standard (EU opt-in) when user location is unclear.
EU
Strict Opt-InBlock all non-essential cookies before consent. Refusing must be as easy as accepting. Granular options are required, and withdrawal must be one click.
UK
Opt-In, With ExceptionsSome low-risk cookie uses no longer need consent under the Data (Use and Access) Act, with strict conditions. Check the ICO's cookie guidance before you rely on one.
California
Opt-OutDisclose cookie use, provide "Do Not Sell or Share" link, and honor GPC signals.
Brazil
Opt-InFollows GDPR principles. Requires consent before setting non-essential cookies.
Australia
Notice OnlyNo specific cookie law currently. Informational notice is sufficient.
Fines in 2025: the CNIL fined Google EUR 325M and Shein EUR 150M on September 3, 2025. Google made refusal take more steps than acceptance, and it ran Gmail ads without consent. Shein set cookies before any banner interaction, and kept them running after reject all.
The banner must work before any tracker loads, and reject must be as easy as accept. A consent management platform can run the banner for you, but you still need to test the setup yourself. Compare vendors on their own pricing pages, because prices change.
The EU Cookie Reform Is Still a Proposal
The Digital Omnibus would change the cookie rules, but as of October 23, 2026 it is only a proposal. Council drafts keep the consent rule in ePrivacy Article 5(3). Until a reform passes, the current consent rule applies.
Privacy Policy Generators
A generator gives you a first draft. It does not know your data flows.
Generator prices change, so this page does not list them. Check each vendor's own pricing page before you buy.
A generated policy must match the real data flows in your code and the declarations you make in the Apple and Google stores. The Bookly outline in the next part shows what to check. Have a lawyer review the final text before launch.
Privacy Policy and Cookie Consent for Bookly
Bookly's Privacy Policy, Section by Section
Write each section from what the code does. A policy that describes features the app lacks is as wrong as one that leaves out data the app collects.
Bookly collects names, emails, phone numbers and booking history, so the policy must name each one. Update the policy when you add a new SDK, a new data type, or a feature that sends data to an AI service.
Match the Store Declarations
The policy, the Apple privacy labels and the Google Play Data safety form must describe the same data.
Apple lists a privacy policy URL as required in App Privacy Details, and Google Play also asks for a privacy policy link. Apple also accepts an optional Privacy Choices URL. A mismatch between the policy and the store labels can cause a rejection.
For Bookly, the store labels should list the same contact details, booking history and deposit data that the policy names. Keep one data list in the repository, and update the policy and both store forms from that list.
Sending Data to a Third-Party AI Needs Explicit Permission
Apple Guideline 5.1.2(i), revised in November 2025, requires you to disclose where personal data is shared with third parties, including third-party AI, and to get explicit permission first. Developer forums report rejections when an app sends data to an AI service without naming the service and asking first.
Bookly, as an illustration: if Bookly sends client notes to an LLM API, it needs a consent screen that names the AI provider. A line in the policy is not enough.
App Store Age Laws
Texas, Utah and Louisiana have app store age laws. Developers get a good-faith safe harbor for relying on the age signals that the store provides.
The Texas App Store Accountability Act (SB 2420) was enjoined on December 23, 2025. The Fifth Circuit stayed that injunction on May 28, 2026, so the law can be enforced while the case continues. Utah's law took effect May 7, 2026, and Louisiana's took effect July 1, 2026.
Bookly, as an illustration: if Bookly allows users under 18, read the age and parental-consent signals that the store provides, and act on them.
Cookie Consent Setup for Bookly
Set up the banner in this order. A tracker that loads early breaks the consent, even if the banner looks correct.
- In the EU, load no non-essential tracker before the visitor chooses. Only cookies that the booking itself needs may set before a choice.
- Put Accept and Reject on the same screen, with the same weight. Refusing must take no more steps than accepting.
- Test the banner in a fresh browser profile. Confirm that no non-essential cookie sets before the choice, and that none keeps running after reject all.
- For California visitors, show a Do Not Sell or Share link, and honor Global Privacy Control.
- Store each visitor's choice, and let the visitor change it later from the site.
Bookly, as an illustration: in the EU, the analytics tool loads only after the client clicks Accept. In the UK, the team checks the ICO's cookie guidance before it treats any analytics cookie as exempt.
Subscriptions, Deposits and Refunds
Click-to-Cancel: The Federal Rule Was Vacated
The FTC still enforces cancellation rules through other laws, and state auto-renewal laws add more.
The Eighth Circuit vacated the FTC's click-to-cancel Negative Option Rule in July 2025, on procedural grounds. The FTC still enforces through ROSCA and Section 5, and it has restarted rulemaking.
State auto-renewal laws often add a private right of action and stricter cancellation rules. Check the rules in each state where you sell.
Deposit and Refund Terms for Bookly
Bookly's deposit is a one-off payment. The terms must answer four questions before the client pays.
The salon owner can cancel or refund a booking. Write the rule the owner follows, and show it to the client before payment. Record every refund against the original payment.
If Bookly Sells a Renewing Package
A one-off deposit renews nothing. A package or membership that renews needs clear terms, an easy online cancel, and a reminder where state law requires one. Show the renewal date and price before the first charge.
Rules Differ by Place
Deposit, refund and renewal rules differ by country and state. Have a lawyer review these terms before you publish them.
AI Features and the EU AI Act
Using a Coding Agent Is Mostly Out of Scope
An app that only used a coding agent to write its code is mostly outside the EU AI Act. An app that ships a chatbot, or that generates content for EU users, must tell those users they are dealing with an AI system.
EU AI Act Dates
Dates from Regulation (EU) 2026/1744, the Digital Omnibus on AI, which moved several earlier deadlines.
Bookly, as an illustration: if the team adds an AI chatbot for client questions, EU users must be told they are talking to an AI system. Keep logs of what the app sends to the model provider, so you can show what the feature processed.
In the US, Colorado replaced its AI Act with SB 26-189 (signed May 14, 2026), a narrower automated decision-making framework effective January 1, 2027.
Data Handling & Accessibility
95.9% of Top 1M Homepages Fail WCAG 2
WebAIM Million 2026 analysis (February 2026 scan). WebAIM ties the rise in errors partly to frameworks and AI-assisted coding.
The average home page had 56.1 errors, up from 51 in 2025. Pages using ARIA attributes averaged 59.1 errors, against 42.0 for pages without them, about 41% more. WebAIM warns that this is a correlation, not proof that ARIA causes the errors. ARIA appears on 82.7% of pages.
Most target small businesses
About 64% of defendants in 2025 had under $25M in revenue, and 36% had more (UsableNet).
Widgets do not stop suits
About 1,416 suits in 2025 named sites that used accessibility widgets. UsableNet concludes that widgets do not materially reduce legal risk.
accessiBe fined $1M by FTC (Jan 2025)
False advertising about its accessibility overlay widget.
DOJ Title II Rule
Requires WCAG 2.1 AA conformance for state and local government sites only, not private apps. An interim final rule (April 2026) set the compliance date to April 26, 2027 for large public entities (population 50,000+), and April 26, 2028 for smaller entities.
European Accessibility Act (EAA)
Effective June 28, 2025. Applies to ANY organization providing covered services to EU consumers, regardless of headquarters location.
Micro-enterprise exemption: Fewer than 10 employees AND annual turnover not exceeding 2M EUR (for service providers). There is also an "undue burden" exemption.
Requires compliance with EN 301 549, which incorporates WCAG 2.1 Level AA. Build to WCAG 2.2 AA to satisfy both. Accessibility widgets or overlays alone are not sufficient for conformance.
Penalties must be "effective, proportionate, and dissuasive" and are set individually by each member state, so maximum fines vary widely across the EU. Market-surveillance authorities can also order non-compliant products withdrawn from the market. The first court ruling under a national EAA law came from the Tribunal judiciaire de Lille on May 5, 2026. Enforcement is complaint-driven and still early.
Privacy Nutrition Labels (App Stores)
Apple lists 16 data categories (35 data types) and 6 purposes. Declare each type your app collects.
Typical Vibe-Coded App (Auth + Analytics)
- Declare email address and user ID as "Data Linked to You" for App Functionality.
- Declare product interaction, crash data, and device ID as "Data Not Linked to You" for Analytics.
- If you use any ad SDK, declare device ID under "Data Used to Track You."
- Bookly: name, email and phone under Contact Info, and booking and deposit history under Purchases, linked to the client for App Functionality.
- Google Play requires a privacy policy link in Play Console and inside the app.
- Apps with accounts must offer in-app account deletion and a web deletion link. Deletion must remove the associated data, and temporary deactivation does not count.
- Disclose any security, fraud and legal-retention exceptions to deletion in the Data safety form.
GDPR Essentials
Cumulative fines reached about EUR 7.1 billion by January 2026
Consent: Cookie banners must offer equal Reject and Accept options, with no dark patterns. The CNIL fined Google EUR 325M and Shein EUR 150M in September 2025 for refusal paths that were harder than acceptance and for cookies set before any choice.
Deletion: "Delete Account" must actually delete data, not just set a deleted: true flag. Drop the rows.
Breach Notification: You have 72 hours to report a data breach to authorities. Document everything.
Data Minimization: Only collect data you actually need. If you don't need a phone number, don't ask for one.
CAN-SPAM & CCPA (US)
CAN-SPAM: Every marketing email needs a working unsubscribe link and a valid physical postal address. Violations cost up to $53,088 per separate email. Honor opt-outs within 10 business days, and keep the opt-out mechanism working for 30 days after you send.
Google/Yahoo 2024 Rules: SPF/DKIM/DMARC authentication required, one-click unsubscribe header mandatory, complaint rates must stay below 0.3%. These rules apply to bulk senders, so a low-volume app like Bookly needs a line on them, not a full program.
CCPA (California): Applies if you have more than $26,625,000 in annual revenue (adjusted from January 1, 2025), buy, sell or share the personal information of 100,000 or more California consumers or households, or earn 50% or more of revenue from selling or sharing personal information. Covered businesses that sell or share personal information must provide a "Do Not Sell or Share My Personal Information" option.
Children's Data: COPPA applies if any users are under 13. Requires verifiable parental consent. The amended COPPA Rule's full compliance deadline passed on April 22, 2026.
What Data to Store (And What Never to Store)
OK to Store
- Email addresses (with consent)
- Hashed passwords (bcrypt/argon2)
- Subscription status
- User preferences
- App-generated content
Minimize Storage
- Full names (only if needed)
- Phone numbers (only if needed)
- IP addresses (anonymize after use)
- Usage analytics (aggregate when possible)
- Location data (use coarse precision)
- Health data, only if the product needs it (HIPAA, HBNR and state health rules can then apply)
Never Store
- Plain-text passwords
- Full credit card numbers (let Stripe handle it)
- Government IDs / SSNs
- API keys in your database
"Delete My Account" Done Right
GDPR requires actual deletion, not just setting a flag. Here is the correct cascade order.
// Correct deletion cascade order
1. Delete user's posts, comments, uploads
2. Cancel active Stripe subscription
3. Remove from email provider (Resend, SendGrid)
4. Anonymize analytics data (replace userId with "deleted")
5. Delete auth account (Clerk, Supabase Auth)
6. Delete user row from database
7. Log deletion request for audit trail
On Google Play, an app with accounts must also offer in-app and web-linked deletion. The store section above lists the rules.
Keep Financial Records
Tax and accounting rules set minimum retention periods for financial records, and they vary by country. Anonymize the personal data but keep transaction amounts and dates for the period your rules require. Replace user attribution with "[deleted user]" on any content that must be retained.
Generate Your Privacy Policy with AI
"Generate a privacy policy for [app name], a [describe app]. We collect: [list data types]. We use [list services: Supabase, Stripe, Resend, etc.]. We operate in [countries/regions]. Include GDPR, CCPA, and CAN-SPAM compliance sections. Use plain language, not legalese."
Get a Lawyer Review
AI-generated privacy policies are a starting point. The policy must match what the app really does, including the data flows in the code and the declarations in the Apple and Google stores. Have a lawyer review it before launch.
WCAG 2.2 AA: The Four Principles in Plain English
Every WCAG requirement falls under one of these four principles. Here is what they actually mean for your code.
1. Perceivable
Users must be able to perceive all content through at least one sense.
- Every
<img>needs descriptivealttext (oralt=""for purely decorative images) - Videos must have captions and audio descriptions for meaningful visual content
- Color alone must never be the only way to communicate meaning (add icons, text, or patterns alongside color)
- Text must meet a 4.5:1 contrast ratio against its background. Large text needs 3:1. Large text is 18 point, or 14 point bold (about 24 px, or about 18.7 px bold).
2. Operable
Users must be able to operate all interface components using any input method.
- Every interactive element must be reachable and usable with keyboard alone (no mouse required)
- No keyboard traps: users must be able to Tab into and out of every component
- Provide a "Skip to main content" link as the first focusable element on each page
- Focus indicators must be clearly visible (never hide them with
outline: noneunless you provide a replacement)
3. Understandable
Users must be able to understand both the content and how the interface works.
- Set the page language with
lang="en"on the<html>element (screen readers use this for pronunciation) - Navigation must be consistent across all pages (same order, same labels)
- Form validation errors must be identified with text descriptions, not just a red border or color change
- Labels and instructions must appear before or alongside form inputs, not only as placeholder text
4. Robust
Content must work reliably across browsers, devices, and assistive technologies.
- Write valid HTML with no duplicate
idattributes (screen readers rely on unique IDs for label associations) - All custom interactive components need appropriate ARIA roles (e.g.,
role="tablist",role="dialog") - Dynamic status messages must use
role="status"(polite) orrole="alert"(urgent) so screen readers announce them - Use semantic HTML elements first (
<nav>,<main>,<header>) before reaching for ARIA attributes
What WCAG 2.2 Adds to 2.1
WCAG 2.2 is the current W3C Recommendation, dated December 12, 2024. These four AA criteria are new in it.
Bookly, as an illustration: a drag-only calendar slot picker, or a tiny tap target on the cancel button, fails WCAG 2.2 even if it passes 2.1.
4-Phase Accessibility Audit Process
A structured approach for finding accessibility issues. Run all four phases in order.
Automated Scanning
Start here because it's fast and free.
Tools
- axe DevTools (Chrome extension, free) - best starting point for most developers
- Lighthouse (built into Chrome DevTools, Audits tab) - includes accessibility scoring
- WAVE (browser extension) - provides visual overlay of issues directly on the page
What They Catch
- Missing alt text on images
- Contrast ratio violations
- Missing form labels
- Invalid ARIA attributes
What They Miss
- Whether alt text is actually meaningful (they only check if it exists)
- Logical focus order and tab sequence
- Whether interactive patterns are understandable to users
Keyboard Testing
Put your mouse away and Tab through the entire application.
Test These Interactions
- Can you reach every interactive element with Tab?
- Is the focus indicator visible on every focused element?
- Does Enter/Space activate buttons and links?
- Does Escape close modals and popups?
- Do arrow keys navigate within dropdowns, tabs, and menus?
Common Failures
<div onClick>used instead of<button>(divs aren't keyboard focusable by default)outline: noneapplied globally without a visible replacement focus style- Modal dialogs that have no Escape key handler and no focus trap
Screen Reader Testing
Test with at least one screen reader.
Free Screen Readers
- VoiceOver (macOS and iOS, built-in, free)
- NVDA (Windows, free and open-source download)
- TalkBack (Android, built-in, free)
What to Verify
- Headings announce their correct level (h1, h2, h3) and text
- Form labels are read aloud when the input receives focus
- Buttons and links have descriptive names (not just "button" or "click here")
- Dynamic content changes are announced (toast messages, loading states)
Common AI Failures
- Buttons announced as generic "button" instead of "Submit application"
- Images announced as "image" because alt text is missing or empty on meaningful images
- Form inputs without associated labels (screen reader says "edit text" with no context)
- Dynamic content not announced because
aria-liveregions are missing
Visual and Cognitive Testing
These are the problems automated tools and keyboard testing overlook.
Contrast
- Use the WebAIM Contrast Checker to verify all text meets 4.5:1 (or 3:1 for large text)
- Check contrast on focus indicators, icons, and form field borders too
Zoom and Reflow
- Zoom the browser to 200% and verify all content remains readable with no overlapping text
- Resize the browser window to 320px wide and verify there's no horizontal scrollbar
Motion and Animation
- Enable "Reduce motion" in your OS accessibility settings
- Verify all animations respect the
prefers-reduced-motionmedia query - No content should auto-play, flash, or move without user control
Fixing Common AI-Generated Accessibility Issues
These seven patterns show up often in generated code. Each one is a WCAG failure.
1. The Div-Soup Problem
AI wraps everything in <div> elements instead of using semantic HTML for interactive controls.
// Bad: div is not a button
<div onClick={handleSubmit}>
Submit
</div>
// Good: semantic button element
<button onClick={handleSubmit}>
Submit
</button>
2. Missing Form Labels
AI uses placeholder text as the only label. Placeholders disappear on focus and aren't announced by all screen readers.
// Bad: no label, placeholder only
<input placeholder="Email" />
// Good: explicit label association
<label htmlFor="email">Email</label>
<input id="email" type="email" />
3. Click Handlers on Non-Interactive Elements
A <div onClick> is invisible to keyboard and screen reader users. If you can't use a <button>, you need three additions.
// Bad: keyboard users cannot activate
<div onClick={toggle}>Menu</div>
// Good: keyboard accessible div
<div role="button" tabIndex={0}
onClick={toggle}
onKeyDown={(e) =>
(e.key === 'Enter' || e.key === ' ') && toggle()
}>Menu</div>
4. Images Without Alt Text
AI omits alt attributes entirely or sets them to the filename. Screen readers will read the full file path instead.
// Bad: no alt attribute
<img src="/team-photo.jpg" />
// Good: descriptive or empty alt
<img src="/team.jpg" alt="Team at 2025 summit" />
// Decorative image: empty alt
<img src="/divider.svg" alt="" />
5. Color-Only Indicators
AI marks errors with red text or borders alone. Users who are colorblind or using monochrome displays can't distinguish these.
// Bad: color is the only indicator
<span style={{color: 'red'}}>
Invalid email
</span>
// Good: icon + text + color
<span role="alert" className="text-red-500">
⚠ Error: Please enter a valid email
</span>
6. Focus Management in Modals
AI creates modal dialogs that lack focus trapping. Keyboard users Tab behind the modal into invisible page content.
// Bad: no trap, no escape, no role
<div className="modal">
<p>Confirm?</p>
</div>
// Good: role, label, escape handler
<FocusTrap>
<div role="dialog"
aria-labelledby="modal-title"
onKeyDown={(e) =>
e.key === 'Escape' && close()
}>
<h2 id="modal-title">Confirm</h2>
</div>
</FocusTrap>
7. Insufficient Contrast
AI selects colors for aesthetics, not accessibility. Light gray on white is a common failure.
// Bad: about 2.85:1 ratio (fails WCAG AA)
color: #999999;
background: #ffffff;
// Good: 7.0:1 ratio (passes AAA)
color: #595959;
background: #ffffff;
// Check: webaim.org/resources/contrastchecker
Accessibility Audit Prompt
Copy this prompt and paste it into your coding agent alongside your code to get a thorough accessibility review.
"Perform a complete WCAG 2.2 AA accessibility audit on my [framework] application. Test every component and page. For each failure: state the WCAG criterion number and name, the specific element that fails, the exact code fix needed, and priority (critical/high/medium/low). Pay special attention to: div/span elements used instead of semantic HTML, missing form labels, click handlers on non-interactive elements, images without alt text, insufficient color contrast, missing keyboard navigation, missing ARIA labels on custom components, no focus management in modals, and dynamic content that is not announced to screen readers. Group your findings by page and sort by priority within each page."
Four Steps for a First Pass
(1) Run an automated scanner like axe DevTools. (2) Test the entire app with keyboard only. (3) Test with a screen reader (VoiceOver, NVDA, or TalkBack). (4) Check color contrast with WebAIM Contrast Checker. Then use AI to generate fixes for everything you find.
Next step
Step 10 of 12 applies this method to one coding agent. The next page, Claude Code, covers its context file, skills, hooks and subagents. The privacy, license and consent rules on this page still apply to every task the agent runs.
Common Questions
Can you copyright AI-generated code?
In the US, only the parts a person wrote or meaningfully shaped. The Copyright Office protects human authorship, and code that an agent produced from prompts alone likely falls into the public domain. The Supreme Court declined the Thaler appeal on March 2, 2026. Keep a record of your design decisions, reviews and edits, because those human contributions are what you can claim.
How can you tell if code is AI generated?
No test proves that a block was written by AI, so do not rely on a detector. For legal risk, the useful question is where the code came from: software composition analysis tools with similarity detection flag code that matches an open-source project, so you can check its license. Keep your commit history, which shows which changes you reviewed and edited.
Do I need a privacy policy for my app?
Almost certainly. Google Play requires every app to post a privacy policy link in Play Console and inside the app. Apple requires a privacy policy link and the App Privacy label. Privacy laws such as the GDPR and US state laws also require a notice when you collect personal data, which a booking app like Bookly does from its first client.
Does the EU AI Act apply to a small app with a chatbot?
If EU users talk to it, Article 50 applies from August 2, 2026, so users must be told they are dealing with an AI system. Regulation (EU) 2026/1744 moved the high-risk rules to December 2, 2027 for stand-alone systems and to August 2, 2028 for systems embedded in products. A salon booking chatbot is normally not high-risk. Your main task is a clear disclosure, plus logs of what the app sends to the model provider.
Which US state privacy laws apply to a small app?
Thresholds vary. Rhode Island starts at 35,000 consumers. Connecticut also starts at 35,000 consumers, and it covers any business that processes sensitive data or sells personal data. California's law applies above $26,625,000 in annual revenue, or to businesses that handle data of 100,000 consumers or households, or that earn 50% of revenue from selling or sharing data. Design the opt-out and deletion flows once so they work in every state.
Do accessibility overlay widgets prevent ADA lawsuits?
Not reliably. UsableNet counted about 1,416 lawsuits in 2025 against sites that used accessibility widgets, and it concludes that widgets do not materially reduce legal risk. The FTC fined accessiBe $1 million in January 2025 over its claims about its overlay. The European Accessibility Act also says overlays alone do not give conformance. Fix the code instead: semantic HTML, labels, color contrast, keyboard use, and testing against WCAG 2.2 AA.