Security guides for people who build apps with AI tools, in plain words. Four so far: a review of what the studies found, a checklist to run before launch, how to get your coding tool to fix a problem, and which kind of scanner you need.
Using an AI coding tool? Paste this prompt
Paste it into your AI coding tool (for example Claude Code, Cursor, Codex or Windsurf), in your project.
Help me check my app for security problems with Epherem, a free, open-source scanner that runs on my own computer. Read the instructions at https://raw.githubusercontent.com/Kirtikklz/epherem-scanner/main/README.md first, then guide me through it. Don't upload my code anywhere, and don't change any of my files unless I say yes.
Running it yourself
You need Node.js 20 or later. In your project folder, run:
Independent researchers have now audited thousands of AI-built applications. The same handful of failures keeps appearing, and none of them is exotic. They are ordinary web-security mistakes, at ordinary trust boundaries.
Authorization and data access. The largest category in the 2026 academic study: 530 of 1,471 validated vulnerabilities (36.0%), with at least one access-control flaw in 75.5% of the 200 deployed applications audited.
Database permissions and Row-Level Security. Escape's study of more than 5,600 live apps named misconfigured permissions, particularly Supabase RLS policies, as its primary cause. A separate scan of 1,072 Supabase-backed apps found 172 that allowed records to be deleted without authentication.
Secrets reaching places they should not. 400+ exposed secrets and 175 instances of exposed personal data in Escape's sample. Xint found unsafe secrets behind 11 of its 23 critical findings.
Security that only exists in the browser. Wiz found apps whose "authentication" was a value in localStorage. The academic study found authentication failures in 42.5% of audited repositories.
Unsafe input and injection. 17.7% of validated vulnerabilities. Significant, but current models increasingly reach for ORMs and prepared statements on their own, so it is not the dominant risk.
Missing rate limits and resource controls. The largest single category in Xint's 434 findings (93, or 21%), appearing in nearly every project tested.
Applications that were never meaningfully private. RedAccess found more than 5,000 vibe-coded apps with virtually no authentication; close to 2,000 appeared to expose private information.
What is not at the top: dependency vulnerabilities were 0.6% of validated vulnerabilities in the academic dataset. The largest root cause was hidden security requirements (43.9%): the user asked for functionality and never stated the security properties it also needed.
What the research actually says about AI-generated code, and the fourteen checks worth running before real users arrive. Start with authorization, credentials and attacker-controlled input, then move outward into configuration and hardening.
Never expose privileged secrets to the client. Database credentials, Stripe secret keys, JWT signing secrets, Supabase service_role keys. A publishable key in the browser is expected; a service-role credential there is potentially catastrophic. If one has leaked, rotate it.
Treat .env as storage, not protection. A committed, publicly served or bundled .env is still exposed. The question is always what the value lets an attacker do.
Protect the database itself: RLS and data authorization. "Is RLS enabled?" is not enough. Which tables are exposed, what anon and authenticated may do, and what each policy allows for SELECT, INSERT, UPDATE and DELETE. The policy is the security model.
Authenticate sensitive backend routes. Hiding the Admin button protects nothing. If the endpoint is called without the interface, the server itself has to reject the request.
Verify ownership, not just login. A valid session does not prove order 123 belongs to the requester. Changing IDs between two test accounts is still one of the most valuable manual tests you can run.
Validate input on the server, including business logic.-500 is an integer too. Four of the five coding agents Tenzai tested accepted a negative order quantity.
Watch server-side URL fetching for SSRF. Link previews, importers and "fetch this website" features make the server request a URL the user chose. All five agents in Tenzai's link-preview scenario introduced SSRF.
Apply CSRF protection where the authentication model requires it. Cookie-authenticated state changes need it; a stateless API with an explicit bearer token has a different threat model.
Rate-limit the endpoints attackers would abuse. Login, sign-up, OTP, password reset, payments, expensive AI generation, using an identity signal the attacker cannot trivially manipulate.
Security headers are useful, but hardening is not exploitation. A missing Content-Security-Policy is not the same as an endpoint exposing another customer's records.
Analyse CORS, don't pattern-match it. CORS is not authentication. An attacker does not have to use a browser.
Do not leak internal errors into production. Controlled responses for users; full diagnostics kept securely for operators.
Treat temporary, demo and bypass logic as suspicious. TODO, mock, skip auth, fallback passwords, hardcoded admin roles, commented-out checks. The danger is unfinished security surviving into production.
Passing these checks does not prove an application is secure. The goal is to catch the failures that are both common and dangerous before an attacker finds them first, and to ask the questions again every time the application changes.
Why the same AI that helped create vulnerable code can still be useful for repairing it, once a separate security system has found the problem first.
Separate the jobs. Building software, finding vulnerabilities and repairing a known vulnerability are three different tasks. "Make my application secure" asks for discovery. A concrete finding asks for a bounded engineering problem.
"Review your own code" is not enough. On SecureAgentBench's 105 repository-level tasks, the best agent and model combination reached a 15.2% correct-and-secure rate, and adding explicit security instructions did not significantly help.
A precise finding changes the task. In PATCHEVAL, telling models where the vulnerability was raised successful repairs from 46.3 to 54.3. A location more than five lines off dropped them to 42.7, worse than no location at all.
Bad guidance is worse than none. 1Password's study of more than 6,000 AI-generated patches: 65.0% fix success with correct guidance, 50.4% with none, 15.2% with incorrect guidance. The model followed the premise it was given.
An AI fix is not self-certifying. Only 26.0% of those patches fully resolved the vulnerability without changing behaviour. The coding agent saying "done" is not proof the vulnerability is gone.
The loop: build, scan, repair, test, rescan. With feedback from security and functionality tests, Gemini 2.5's successful repairs in PATCHEVAL rose from 52 to 134.
Why Epherem points to the problem rather than prescribing the patch. Each finding carries the file, the line, what someone could do, a suggested fix and a prompt for your coding agent. Treat the fix and the prompt as a starting point: the coding agent has the repository context and decides how the code changes. Uncertain findings stay marked "needs checking".
No source-code scanner finds every vulnerability, and a clean rescan does not prove an application has none. The realistic promise is a practical way for a non-coder to discover security problems, get them repaired in the tool they already use, and check the result again.
There are two kinds of security scanner for apps built with AI tools. One tests your live site from the outside; one reads your code. They catch different things, and most people are better off running one of each.
A URL scanner sees what an attacker sees. It loads your deployed app, reads the JavaScript the browser downloads, tries the public database endpoint and checks headers, cookies and certificates. It can't see code that never reaches the browser.
A source-code scanner sees what the next deploy will ship. It reads routes, queries, policy files, settings and the package list: a login check missing from one route, an ownership check never written, a key in a file that gets bundled, a package with a published advisory. It can't see how the live site behaves.
Run one of each. Live and never scanned: URL scanner first, then a source-code scanner. Not live yet, or built with Cursor or Claude Code: a source-code scanner is the one you can run now. Built with Lovable: its built-in scans and Supabase's Security Advisor first, then a source-code scanner on the synced repo.
Twelve tools, side by side, not ranked. Platform built-ins, URL scanners and source-code scanners, with what each reads, what is free, what it costs and whether the vendor's own page says a model reads your code. Every cell was checked on the vendor's site on the date shown, and the page lists where.
Where Epherem fits. It is a source-code scanner that runs on your own computer: deterministic checks, the full report free with nothing hidden, no AI in the scan. It does not test your live site and reads JavaScript and TypeScript better than Python.
Neither kind of scanner can tell you your app has no problems. Both can show you things to fix.