AI app builders have made it possible to go from idea to working product in a weekend. That is genuinely great. The catch is that an AI assistant optimises for "it works", not "it's safe". It will happily make a feature function by loosening a permission, moving a key into the browser or skipping a check on the server, and it rarely tells you it did.
The good news: AI-built apps tend to go wrong in the same predictable places. If you check these seven areas before launch, you remove most of the easy wins an attacker would look for. This is guidance, not a guarantee — but it is the list we start with on every review.
1. Secrets in the browser
What goes wrong: a secret key (database service role key, Stripe secret key, OpenAI or other API key) ends up in front-end code or a VITE_/NEXT_PUBLIC_ environment variable. Anything shipped to the browser can be read by anyone.
How to check in 5 minutes: open your live site, open DevTools → Sources (or view the JS bundle) and search for "sk_", "secret", "service_role", "api_key" and the first few characters of each key you use. Also check your public Git repository history.
What good looks like: only publishable/anon keys reach the browser. Secret keys live in server-side secrets and are only used inside server functions. Any key that was ever exposed has been rotated — deleting it from code is not enough.
2. Database access rules that are off or too broad
What goes wrong: row-level security (RLS) is disabled, or a policy like "authenticated users can read all rows" was added to make an error go away. The result is that any signed-in user — often any visitor — can query every customer's data straight from the browser using your public key.
How to check in 5 minutes: list every table and confirm RLS is enabled. Read each policy and ask "who exactly can see this row?". Then sign up as a second test user and try to read or edit the first user's records.
What good looks like: every table has RLS on, and policies tie rows to the owner or their organisation (for example user_id = auth.uid()). Nothing sensitive is readable by anon.
3. Server functions and API routes with no caller check
What goes wrong: the AI creates an endpoint for an admin action, export or email send, and the only protection is that the button is hidden in the UI. Webhook routes accept any request without verifying the signature, so anyone can fake a "payment succeeded" event.
How to check in 5 minutes: list every API route and server function. For each, ask: does it check who is calling, and are they allowed to do this? Try calling one with curl while signed out.
What good looks like: every server function verifies the session and the user's permission on the server. Webhooks verify the provider's signature (for example Stripe-Signature) before doing anything.
4. Roles stored where users can edit them
What goes wrong: an is_admin flag or role column lives on the user's own profile row, which the user is allowed to update — or the app decides who is an admin purely in front-end code.
How to check in 5 minutes: find where roles are stored. As a normal user, try updating your own profile with role = 'admin' through the browser console.
What good looks like: roles live in a separate table users cannot write to, and the database and server check them — never just the UI.
5. Public file storage
What goes wrong: an upload bucket is set to public so images load easily, and then invoices, ID documents or private attachments go into the same bucket with guessable paths.
How to check in 5 minutes: list your storage buckets and their visibility. Open a private file's URL in an incognito window.
What good looks like: only genuinely public assets are in public buckets. Private files use access policies scoped to the owner and short-lived signed URLs.
6. Made-up or outdated packages
What goes wrong: AI tools sometimes suggest package names that don't exist (attackers register those names), or pin old versions with known vulnerabilities. OWASP's LLM Top 10 lists supply chain risk for exactly this reason.
How to check in 5 minutes: run npm audit (or your package manager's equivalent), and look up any unfamiliar package on the registry — check its age, downloads and repository.
What good looks like: every dependency is one you recognise and actually use, lockfiles are committed, and high/critical advisories are patched.
7. Headers, redirects and error messages
What goes wrong: no Content-Security-Policy or clickjacking protection, login redirects that accept any URL (?next=https://evil.example), and error messages that print stack traces, SQL or internal IDs to the user.
How to check in 5 minutes: check your live site's response headers in DevTools or a free header scanner. Try a redirect parameter pointing at another domain. Trigger an error and read what's shown.
What good looks like: sensible security headers (CSP, HSTS, X-Content-Type-Options, frame-ancestors), redirects limited to your own paths, and generic error messages with details only in server logs.
Pre-launch security checklist
- No secret keys in front-end code, public env vars or Git history; exposed keys rotated
- RLS enabled on every table; policies scoped to the owner or organisation
- Tested with a second account: can't read or edit another user's data
- Every server function and API route checks the caller and their permission
- Webhooks verify the provider's signature
- Roles stored in a table users can't write to and checked on the server
- Private files in private buckets, served by short-lived signed URLs
- Dependencies audited; no unknown or abandoned packages
- Security headers set; redirects limited to your own site; no stack traces shown to users
When to get a second pair of eyes
- You take payments, or store health, financial or identity information.
- Your app has more than one kind of user (customers, staff, admins, organisations).
- You are about to sell to businesses who will send you a security questionnaire.
- You are raising money or onboarding your first paying customers.
None of this means you should stop building with AI. It means treating security as one more thing to review before launch — the same way you'd check the app works on mobile.
Sources
About the author
StrikeWard is a practitioner-led security guidance company based in Australia. This article is general guidance, not legal advice, and does not guarantee any security outcome.
Want a security engineer to run these checks for you? Our Quick Check covers all seven and gives you copy-paste fixes.
Book a Quick Check from A$199