Before you ship an app built with an AI tool, check fifteen things in five areas: secrets, access rules, user input, infrastructure and monitoring. As of November 2026, AI tools produce code that compiles almost every time, but they still regularly leave out the checks that stop one user reading another user's data. Those gaps never show up in a demo. Below, each check gets a plain-language explanation and a test you can run yourself, followed by an honest account of where a checklist stops being enough.
Why AI-built apps fail security checks in predictable ways
An AI coding tool gets judged on what you can see. The page loads and the form submits, so the job looks done. Security lives in the part you cannot see, which is the question of who is allowed to ask for which data.
Veracode, a software security company, tests AI models on the same coding tasks a few times a year. Its 2026 GenAI Code Security Report, published in July, found that more than 100 models averaged a 56% security pass rate, barely up on 2025, while nearly all the code compiled. (The security pass rate is the share of tasks where the code contained none of the vulnerabilities being tested for.) An October 2026 update put the average at 62%, with vulnerable output down from 44% to 38% of tasks. Veracode's own caveat matters: the numbers come from its chosen tasks, with no security instructions in the prompt, and should not be read as a defect rate for real codebases. Even so, close to four tasks in ten produced code that worked and was unsafe.
The useful part for a founder is that the failures repeat. When I read breach postmortems (the write-ups companies publish after an incident), the cause is rarely clever. Usually a secret was left somewhere public, or a database answered anyone who asked. Saltzer and Schroeder described the principle being broken back in 1975 (Saltzer, J. H. and Schroeder, M. D., 1975, "The Protection of Information in Computer Systems"): deny access by default and grant it explicitly. They called it fail-safe defaults. The paper says this better than I can, and it is worth an evening.
Keep secrets and API keys out of reach
A secret is any value that lets your app act on your behalf: the database password, the payment provider's key, the key for the AI model you pay for per request. API keys are the commonest kind (technically bearer credentials, meaning whoever holds one is treated as you). A leaked key is a spare house key taped to the front door.
Check 1: no secret keys in anything the browser downloads. A visitor can read every file your app sends to their browser. Open your live site, right-click, choose Inspect, and search the Sources tab for secret, sk_ and key. Some keys are meant to be public, such as a payment provider's publishable key. If you find a secret key, a database connection string or an AI provider key, treat it as already copied.
Check 2: secrets live in environment variables, and never in your code history. An environment variable is a setting stored on the server and read by the app when it starts. Confirm your .env file is listed in .gitignore so it never gets uploaded. Then search the repository's full history, because a key you deleted last week still sits in every older version.
Check 3: rotate exposed keys and keep each key narrow. Rotating means issuing a new key and switching off the old one. Do it for any key you have pasted into an AI chat, shown in a screenshot or committed by mistake. Use separate keys for testing and production, and give each the least access it needs. A key that reads invoices has no business issuing refunds.
Make sure users can only see their own data
Authentication is proving who you are, usually by logging in. Authorisation is deciding what you may touch once you are in. Think of a hotel: reception confirms you are a guest, and your key card opens room 412 and nothing else. When I explained this to my teenage daughter, she said most AI-built apps check the guest list properly and then hand everyone a master key. She has a point.
CVE-2025-48757 shows what that looks like. (A CVE is a numbered public record of a known security flaw.) In May 2025 a researcher scanned 1,645 apps on the public showcase of a popular AI app builder and found 170, about 10%, whose database tables anyone could read or write using the app's public key, the one every visitor's browser receives. Row Level Security had never been switched on. Row Level Security is a database feature that checks, row by row, whether the person asking may see that row (in practice a policy the database applies to every query, so it holds even when the app's own code forgets).
Check 4: every table holding user data denies access by default. If you use Row Level Security, confirm it is on for every table and that each policy ties rows to their owner. A policy letting any logged-in user read every row protects very little.
Check 5: permission checks run on the server. Hiding the Delete button from non-admins is good design, but anyone can send the delete request without the button. The server has to confirm, on each request, that this user may do this.
Check 6: test with two accounts. Log in as user A, open one of A's records and note the ID in the address bar. Log in as user B and paste in A's ID. If the record opens, you have an insecure direct object reference: the app trusted the number in the URL. At the fintech, nothing shipped until someone had spent an afternoon logged in as one merchant trying to reach another merchant's data. It was dull work, and it found more than any other review we ran.
Check 7: the edges of login hold up. Reset links should expire after one use. Logging out should end the session on the server, so an old token stops working. Admin pages need a role check on the server, since someone will eventually guess the address.
Treat everything users send you as untrusted
Every form field, upload and URL parameter arrives from someone you have never met. Most of it is harmless. Your server should check all of it anyway.
Check 8: validate input on the server. Validation means confirming that what arrived is what you expected, such as an email address in the email field or a positive number in the quantity field. Browser-side checks help honest users and stop nobody else, because a request can be sent directly. Run the same rules on the server.
Check 9: user input never becomes code. SQL injection happens when text typed into a form is run as a database command (in engineering terms, unescaped input concatenated into a query string). Parameterised queries prevent it by sending the command and the user's text to the database separately. Cross-site scripting happens when something a user submits, a comment for example, runs as code in other users' browsers. Escaping output prevents it by always displaying text as text. Cross-site scripting has been among the weakest categories in Veracode's tests, so ask your tool how it handles both, then post a comment containing <script>alert(1)</script> and see whether a pop-up appears.
Check 10: accept less and keep less. Restrict upload file types and sizes, and store uploads where they cannot run. Collect only the personal data the product uses. For Indian founders this is about to carry legal weight: India's Digital Personal Data Protection Rules were notified on 13 November 2025, and the main obligations, including security safeguards and breach reporting, apply from 13 May 2027, roughly six months away. Trimming your signup form is the cheapest compliance work available.
Lock down the infrastructure before launch day
Infrastructure means the servers, the database and the network settings that connect them. I cook slow Awadhi dishes on Sundays, and the ones that fail are the ones where I rushed the prep. Infrastructure is prep work. Guests never see it, and they all taste the result when it is skipped.
Check 11: traffic is encrypted and only your site can call your backend. Every page and request should use HTTPS, the padlock in the address bar. Then look at your CORS setting. CORS (cross-origin resource sharing) decides which other websites may call your backend from a visitor's browser. Generated code sometimes sets it to a wildcard that allows any site, so change it to your own domain.
Check 12: rate limits on anything that can be abused or that costs money. A rate limit caps how many requests one user or address can make in a period. Login, signup and password reset need one, so nobody can try ten thousand passwords in an hour. So does every feature that calls a paid service such as an AI model or an SMS gateway.
Check 13: separate test from production, and restore a backup before launch. Test and live databases should be separate, with separate credentials, so an experiment never touches a customer. Take a backup and restore it somewhere, once. GitLab's postmortem of its January 2017 database outage explains why: production data was deleted by mistake, and several backup methods failed when they were needed. I have never dropped a production table by accident. I have watched colleagues do it, which is why I restore-test everything.
Know when something goes wrong
Something will break eventually. How bad it gets depends mostly on how soon you notice.
Check 14: logs and alerts for you, plain error messages for users. Logs are the server's record of what happened and when. Log failed logins, refused permissions and server errors, and set an alert for sudden spikes. Keep passwords, card numbers and API keys out of the logs, since logs get passed around far more casually than databases. I keep a ranked list of the worst production error messages I have seen, and "An error has occurred" is on it. Showing users a raw database error or stack trace (the list of code locations a program passed through before failing) is worse, because it hands an attacker a map. Users get a short, honest message. The detail goes to your logs.
Check 15: a one-page incident plan, written before launch. It should name who gets alerted and explain how you will rotate the keys from check 3, sign every user out and tell people what happened. Indian founders have a clock to plan around: from May 2027, the DPDP Rules require you to inform the Data Protection Board and affected users of a personal data breach, and to send the Board a detailed report within 72 hours. That time disappears fast while you are still working out what broke.
What this checklist cannot replace
A checklist catches common mistakes, and attackers make a living from the uncommon ones. A penetration test is a paid, professional attempt to break into your app the way an attacker would (formally, a scoped and authorised adversarial assessment that ends in a report of findings ranked by severity). If your app takes payments directly, stores health information or holds data that would badly hurt users if leaked, budget for one before launch. These fifteen checks give a typical MVP a sensible baseline. They do not certify it as secure.
Your platform also decides how many checks start already ticked. With a real backend layer, meaning a server and database sitting between the browser and your data, permissions can be checked on the server for every request. When the browser talks straight to the database, every database rule has to be exactly right, and that is the gap CVE-2025-48757 fell through. Before committing to any tool, ask where your secrets will live and where permissions get checked, and whether you can read the code that does both.
I reviewed Mayson's architecture out of professional curiosity. It generates a real backend with a database and authentication instead of mocking them for a demo (see [how Mayson builds the backend for you] (verify URL: mayson.dev product page)), which puts permission checks on the server where check 5 wants them. Which of the fifteen checks a Mayson-generated app passes by default: [PLACEHOLDER: which of the 15 checks Mayson-generated apps pass by default, confirmed by BackStract engineering]. BackStract's own account is at [Mayson's security approach] (verify URL: [PLACEHOLDER: confirm a security or trust page exists]).
Mayson does not take secrets handling or access-rule review off your plate. You still decide who sees what, rotate any key you expose and run the two-account test yourself. No platform can know that a clinic receptionist should see appointment times and not diagnoses until you write that rule down and test it. For the wider question of launch readiness, I have written about [what production-ready actually means] (verify URL: Navya's deployment/infrastructure explainer).
Frequently asked questions
Is code written by AI less secure than code a developer writes?
Do I need a penetration test before launching my MVP?
How do I check if my API keys are exposed?
Can other users see my users' data if I built my app with AI?
Does India's data protection law apply to my small app?
Who is responsible if my AI-built app gets hacked?
Navya is a senior backend engineer with more than 15 years in production systems. She studied computer science at IIT Kanpur, spent five years on payment infrastructure at a large product company in Bangalore, and was a tech lead at a fintech startup as it grew from thousands to millions of transactions a day. She now does staff-level consulting and writes plain-language explainers on how software is built and how it breaks.






