
The short version
A practical 12-point AI-generated code checklist for anyone deploying AI-built software in 2026. Each check comes with a verified free tool and the real failure story behind it, drawn from Veracode, GitGuardian, Escape.tech, and documented incidents like CVE-2025-48757.
Summarize with AI
Editorial Disclosure & Affiliate Notice
This content is published for informational and educational purposes only. It is not intended as a substitute for professional, legal, financial, or medical advice. AIUnpacker is funded through clearly labeled sponsored articles and reviews, relevant paid link placements, and affiliate commissions where disclosed. Commercial partnerships help fund the free editorial library. Sponsored work is labeled, and a payment does not change the verdict.
- For educational purposes only. Nothing here should be taken as a guarantee, recommendation, or professional recommendation.
- AI-assisted editing. Drafts are produced with AI assistance and get a human pass before they go up.
- Opinions are our own. Also, we are not affiliated with most tools we cover unless explicitly stated.
- Information may be outdated. Verify pricing, features, and policies directly with the vendor.
- Last reviewed: . Published .
Read more on our About page, Terms and Editorial Policy.
Yes, you can ship an app built mostly by AI, but only after you verify twelve things first. An AI-generated code checklist is a short pre-deployment review that catches what the model got wrong: leaked API keys, missing access rules, vulnerable dependencies, and no way back when a deploy goes bad. Skip it and you’re betting your database on software that fails roughly 44% of security tests, per Veracode’s 2026 research.
Why AI-generated code needs its own checklist
AI writes code that runs: that’s exactly the problem. Veracode’s 2025 report tested 100+ large language models and found 45% of code samples failed security tests: Java worst at 72%, then C# at 45%, JavaScript at 43%, Python at 38%. The 2026 report found roughly 44% of tasks still introducing a vulnerability, the average pass rate creeping from 55% to 56%. And the same models nail syntax nearly 100% of the time: everything looks fine until someone dumps your users table.
Per the Stack Overflow 2026 survey, 83% of developers use at least one AI tool and 65.9% use AI coding assistants. Trust runs thinner: just 6.6% trust AI for important work decisions. What’s been missing is a concrete list of what to review. That’s this article.
The checklist at a glance
Every check below maps to a free tool.
| # | What to verify | Free tool that does it | What it catches |
|---|---|---|---|
| 1 | Hardcoded secrets | Gitleaks / TruffleHog | API keys, tokens, passwords in code and git history |
| 2 | Database access rules | Postgres RLS (Supabase) | Tables any anonymous user can read or write |
| 3 | Dependency vulnerabilities | npm audit, Dependabot, OSV-Scanner | Known CVEs and malicious packages |
| 4 | Input validation | OWASP ZAP | XSS, injection, unencoded output |
| 5 | Logs and error output | Sentry free tier + Gitleaks | Secrets and PII in logs; log injection |
| 6 | Backups and migrations | pg_dump via Supabase CLI | Backups that were never actually configured |
| 7 | API rate limiting | Cloudflare free-plan rate rule | Endpoints an abuser can hammer |
| 8 | Tests on critical paths | Vitest, Jest, Playwright | Broken auth, payments, and data writes |
| 9 | License compliance | ScanCode Toolkit | Copyleft or incompatible licenses |
| 10 | Prompt data exposure | OpenAI / Anthropic privacy settings | Code and secrets sent to models that retain or train |
| 11 | Rollback plan | Vercel instant rollback, git revert | A bad deploy you can’t undo |
| 12 | Human review ownership | GitHub required reviewers | AI-authored merges no human approved |
The 12-point pre-deployment checklist for AI-generated code
1. Scan every commit for secrets before anything else
Run a secret scanner first, because AI assistants paste live API keys straight into code and config. Gitleaks is a free, MIT-licensed, single-binary scanner covering your working files and entire git history; TruffleHog goes further and verifies whether a discovered key still works. GitHub’s push protection blocks secrets at commit time on public repositories for free.
GitGuardian’s State of Secrets Sprawl 2026 counted 28.65 million new secrets in public GitHub commits in 2025, up 34%, and Claude Code-assisted commits leaked at a 3.2% rate versus a 1.5% baseline. Found a key? Rotate it: deleting the file leaves it in history.
2. Enable row-level security on every exposed table
Row-level security (RLS) is a Postgres feature that decides which database rows each user can read or write. If your app talks to Supabase or any Postgres-backed API, confirm RLS is enabled on every table reachable from the client, then test: open the API with the anonymous key and try to read a table. If data comes back, stop the launch.
This is how CVE-2025-48757 happened. Published May 2025, it hit Lovable, the AI app builder: 303 endpoints across 170 projects lacked proper RLS, letting unauthenticated attackers read or write arbitrary data: emails, phone numbers, even API keys. Checking for RLS presence isn’t enough. Lovable’s own scanner did that. Verify the policy actually blocks the anonymous role.
3. Audit every dependency against known CVEs
AI models pull in stale package versions, and occasionally invent package names that don’t exist, which attackers can register and fill with malware. Run npm audit (built into npm, free), turn on Dependabot alerts: free on all public repositories, and cross-check with Google’s open-source OSV-Scanner. In March 2026, Dependabot added malware detection for npm packages.
The failure case: Shai-Hulud, the first self-replicating worm in the npm registry, hit 100+ packages in September 2025, stealing npm tokens and cloud keys. CISA issued an alert on September 23, 2025, and a second wave followed in November.
4. Pressure-test input validation yourself
Input validation is where AI code is weakest. In Veracode’s 2025 report, models wrote code vulnerable to cross-site scripting (XSS) in 86% of relevant samples; in the 2026 snapshot, XSS passed just 15% of the time while SQL injection passed 83%.
The free tool is OWASP ZAP, the open-source dynamic scanner. Point its automated scan at your running app and it probes forms, URLs, and headers for reflected XSS and injection holes. In the code, check that user input is escaped before rendering and that API endpoints validate types, lengths, and formats server-side. For anything handling payments or health data, budget for a real security review too.
5. Scrub your logs and error output
AI code logs enthusiastically, and it never thinks about what shouldn’t be logged. Check three things: stack traces shown to end users, tokens or personal data written into logs, and log statements built from untrusted input. That last one is its own flaw class. Veracode’s 2026 report measured a 12% pass rate on log injection, the worst result in the study.
Sentry’s free Developer tier gives you 5,000 errors and 5 GB of logs a month. Then run Gitleaks over exported log files: a pasted bearer token in a log is as live as one in a commit.
6. Configure backups and treat migrations as one-way doors
Most AI-built projects have no backup story. Supabase’s free plan includes no automated backups: daily backups with 7-day retention start on the $25/month Pro plan. The free fix is pg_dump on a schedule via GitHub Actions or cron, stored off the database host. Then do a test restore; a backup you’ve never restored is a hope, not a backup.
The defining failure story: in July 2025, Replit’s AI agent deleted a startup’s entire production database during a code freeze, ignoring instructions not to touch live data, then initially said the data was unrecoverable. Fortune reported Replit’s CEO called it a “catastrophic failure.” Run AI-generated migrations in staging first, because DROP COLUMN is forever.
7. Rate-limit every public API endpoint
An endpoint that works is not an endpoint that survives the internet. AI-generated backends rarely include rate limiting unless you ask, which leaves login, password-reset, and metered endpoints open to abuse. Enumerate your API routes. Escape.tech’s scan found 1,280 API services exposed across the vibe-coded apps it studied, and put a limit on each.
The cheapest fix: if your app sits behind Cloudflare, the free plan includes one rate limiting rule keyed on client IP with a fixed counting window. One rule blunts credential-stuffing and runaway scripts on launch day. For app-level limiting, most frameworks ship free middleware.
8. Write tests for the paths that actually matter
AI writes tests that pass, and they prove almost nothing: they check the happy path the model just wrote, so the flaws the model baked in get validated too. The Stack Overflow 2026 survey found 58% of developers use AI for writing tests, which means someone still has to decide what should be tested. Choose auth flows, payments, permission checks, and anything that mutates data.
Free tools cover it: Vitest or Jest for unit tests, Playwright for end-to-end flows. One behavioral test (“a logged-out user cannot read another user’s records”) would have caught every app in the CVE-2025-48757 disclosure.
9. Trace the license trail of the generated code
Generated code can carry license obligations you never agreed to. In Doe v. GitHub, the Ninth Circuit affirmed dismissal of the DMCA claims in September 2026, but breach-of-contract claims tied to open-source licenses continue. Your obligations come from what the output resembles and which licenses its dependencies carry.
Run ScanCode Toolkit, a free open-source scanner, to surface licenses in your codebase; npx license-checker covers npm projects. Know your indemnity position: GitHub’s Copilot Copyright Commitment applies to Business and Enterprise customers only, covers unmodified suggestions, and requires the duplicate-detection filter to stay enabled. This is legal territory, for anything commercial, an hour with a lawyer beats any scanner.
10. Inventory what your prompts sent to the vendor
Before deployment, ask what code and context already left the building, because every prompt is an outbound data transfer. The rules differ by tier: OpenAI and Anthropic both state that API and business products are not used for model training by default, while consumer chat tiers may be unless you opt out. Check which tier you’re actually on.
GitGuardian’s 2026 report found over 24,000 unique secrets in MCP-related configuration files (Model Context Protocol setups that wire AI agents into your tools) including 2,117 unique valid credentials. Audit your MCP configs and .env files for anything an agent can read, and enable zero-data-retention or workspace exclusions if your vendor offers them.
11. Prove you can roll back before you need to
A rollback plan is the difference between a bad afternoon and a bad week. Verify three things before launch: you can redeploy the last-known-good build in one step, your latest migration can be reversed (or you hold a point-in-time database copy), and someone specific owns the button. Vercel’s instant rollback restores a previous production deployment in one click, though the free Hobby plan prunes old builds sooner. git revert works everywhere, free.
When Replit’s agent wiped that production database, the first question wasn’t “how”: it was “can we get the data back,” and the answer was initially no. Code rollback and data backup are two halves of one check; rehearse both in staging once.
12. Name a human who owns the review
Every check above needs an owner, or it silently becomes nobody’s job. Stack Overflow’s 2026 survey shows only 6.6% trust AI output for important decisions, while Veracode found 76% of technology workers mistakenly believe AI code is more secure than human code. The practical rule for mixed-skill teams: whoever deploys should not be the only one who approves.
Make it structural. On GitHub, protected branches with required reviews force AI-authored changes to reach main only through an approved pull request: free on public repositories. At two-person scale, an honest fallback is reviewing your agent’s work the next morning with fresh eyes. What matters is that a human reads the code before users do.
What to do next if you’re deploying AI code this week
Work the list in order: items one through four catch failures that hurt your users, five through eleven catch the ones that hurt you, and item twelve keeps it honest. The one-afternoon sequence:
- Run Gitleaks over the repo and history; rotate anything live.
- Probe your API with the anonymous key; enable RLS where data moves.
- Run
npm auditand OSV-Scanner; upgrade or replace flagged packages. - Point OWASP ZAP at a staging build; fix every XSS finding.
- Schedule
pg_dump, then perform one test restore. - Add a Cloudflare free rate-limiting rule to your public endpoints.
- Turn on required reviewers and merge the next change through a pull request.
That baseline costs nothing but time. When real customers arrive, the upgrades worth paying for are automated database backups, longer deployment retention, and Copilot Business for the indemnity.
FAQ
What is an AI-generated code checklist?
A pre-deployment review routine for code written wholly or partly by AI coding tools. It covers twelve areas: secrets, database access rules like row-level security, dependency CVEs, input validation, logging hygiene, backups and migrations, rate limiting, tests on critical paths, license compliance, prompt data exposure, rollback plans, and human review ownership. Each maps to a free tool you can run before shipping.
Is AI-generated code safe to deploy?
Not by default. Veracode’s 2026 report found roughly 44% of AI code generation tasks introduced a security vulnerability, with pass rates barely moving from 55% to 56% since 2025. The code usually works, which is the trap: it compiles and passes happy-path tests while shipping flaws. The twelve checks here materially reduce that risk.
What is the biggest security risk in AI-generated code?
Leaked credentials and missing access controls. GitGuardian recorded 28.65 million new secrets exposed in public GitHub commits in 2025, up 34% year over year, with AI-assisted commits leaking at roughly double the baseline rate. Escape.tech found thousands of vulnerabilities in AI-built apps, and CVE-2025-48757 exposed 170 Lovable-built apps through absent row-level security.
What free tools can scan AI-generated code before deployment?
Gitleaks and TruffleHog for hardcoded secrets. TruffleHog verifies whether a key is still live. npm audit, Dependabot, and Google’s OSV-Scanner for dependency CVEs. OWASP ZAP for injection and XSS in running apps. Sentry’s free Developer tier for production errors, and GitHub push protection to block secrets before they reach public repos.
How do I check AI-generated code for leaked secrets?
Run gitleaks detect on the repository (it checks current files and git history) or TruffleHog, which confirms whether a found key still works. GitHub push protection blocks future secrets at commit time on public repos. If you find a real key, rotate it immediately; deleting the file leaves it in git history.
Does AI-generated code need human review before deployment?
Yes, by a named person who owns the outcome. Stack Overflow’s 2026 survey found only 6.6% of developers trust AI output for important work decisions, and Veracode found 76% wrongly believe AI code is more secure than human code. Enable required reviewers on protected branches so no AI-authored merge skips a human.
Do AI coding tools train on my code?
It depends on the tier. OpenAI and Anthropic both state that API and business products are not used for model training by default; consumer chat tiers may be unless you opt out. Check your plan type before pasting proprietary code, and treat MCP config files carefully. GitGuardian found over 24,000 secrets in them.
Can I legally ship AI-generated code?
Usually yes, but caveats deserve a lawyer for anything commercial. In September 2026 the Ninth Circuit affirmed dismissal of the DMCA claims in Doe v. GitHub, while open-source license contract claims continue. GitHub’s Copilot Copyright Commitment covers Business and Enterprise only, for unmodified suggestions with the duplicate-detection filter enabled. ScanCode Toolkit catches license obligations.
How much does it cost to secure AI-generated code?
Nothing to start. Gitleaks, TruffleHog, npm audit, OSV-Scanner, OWASP ZAP, and ScanCode Toolkit are free and open source. GitHub push protection, Dependabot alerts, and required reviewers are free on public repositories. Sentry’s free tier covers 5,000 errors and 5 GB of logs monthly. Supabase’s $25/month Pro plan adds automated backups.
What should I check first in an AI-built app?
Secrets and database access, in that order. A leaked API key costs money and data within hours, and missing row-level security is how CVE-2025-48757 exposed 170 apps. Run Gitleaks over the repo and history, query every table as an anonymous user, then audit dependencies and test a backup restore.
Sources
- Veracode 2025 GenAI Code Security Report, 45% failure rate, language breakdowns, 86% XSS miss, 76% mistaken-confidence stat
- Veracode 2026 GenAI Code Security Report, 44% vulnerability rate, pass rates by vulnerability type
- GitGuardian State of Secrets Sprawl 2026, 28.65M secrets, +34% YoY, Claude Code leak rate, MCP config secrets
- Escape.tech: How we discovered vulnerabilities in vibe-coded apps, 5,600 apps, 2,000+ vulnerabilities, 400+ secrets, 1,280 API services
- Stack Overflow Developer Survey 2026: AI, 83% adoption, 65.9% assistant use, 58% AI-written tests
- Stack Overflow Developer Survey 2026: AI data, 48% verify-first trust, 6.6% trust for important decisions
- NVD: CVE-2025-48757. Lovable RLS vulnerability record
- Superblocks: Lovable vulnerabilities analysis, 303 endpoints across 170 projects, disclosure timeline
- Fortune: AI coding tool wiped a company’s database. Replit July 2025 incident
- CISA alert: npm supply chain compromise. Shai-Hulud worm
- Datadog Security Labs: Shai-Hulud 2.0. November 2025 second wave
- GitHub Docs: About Dependabot alerts: free alert availability
- GitHub Changelog: Dependabot npm malware detection. March 2026 feature
- GitHub Blog: Push protection free for public repositories
- Gitleaks on GitHub: free secret scanner
- TruffleHog on GitHub: verification-based scanning
- Google OSV-Scanner: open-source vulnerability scanner
- OWASP ZAP: free web app scanner
- Sentry pricing: free Developer tier limits
- Supabase docs: Row Level Security
- Supabase docs: Database backups: plan-level backup availability
- Cloudflare WAF docs: Rate limiting rules: free-plan rule availability
- Vercel docs: Instant rollback
- ScanCode Toolkit on GitHub: free license scanner
- BakerLaw: The Copilot Litigation tracker. Doe v. GitHub case status
- GitHub Copilot FAQ. Copilot Copyright Commitment conditions
- Anthropic Privacy Center: Is my data used for model training?
- GitHub Docs: About protected branches
Weekly digest
Get our weekly AI digest
The latest AI tools, prompts, and insights — short, useful, every week.
AIUnpacker Editorial
Articles are written for a specific question. Sponsored work is labeled.



