The 5-minute security self-check for AI-built apps

Seven checks you can run on your own app right now — no tools to install, no expertise needed. These are the exact issues we find most often when auditing apps built with AI tools on Next.js + Supabase or Firebase. If your app fails even one, it is worth a closer look.

Run these only against apps you own. That is also our rule: we never test anything without the owner's written OK.

1. Can a stranger read your database with your public key?

Your Supabase anon key is public by design — it ships in your frontend. What protects your data is Row Level Security. Test it: open a terminal and run this against a table that should be private (replace the placeholders):

curl "https://YOUR-PROJECT.supabase.co/rest/v1/YOUR_TABLE?select=*" -H "apikey: YOUR-ANON-KEY" -H "Authorization: Bearer YOUR-ANON-KEY"

Good: an empty list [] or a permission error. Bad: actual rows come back — anyone on the internet can read that table, no login needed. Fix: enable RLS on the table and add policies scoped to auth.uid().

2. Is your service_role key anywhere near the browser?

The service_role key bypasses all row-level rules — it is a master key. Search your repo and your deployed site for it:

Bad: the master key appears in anything the browser can download. Fix: move it to server-only code (API routes / Edge Functions), and rotate it in the Supabase dashboard — once it has shipped, rotating is the only safe option.

3. Can anyone list your storage bucket?

Public buckets serve files by direct URL, but listing should be off unless you mean it. Try opening:

https://YOUR-PROJECT.supabase.co/storage/v1/object/list/YOUR-BUCKET

as a POST with your anon key, or simply check the bucket's policies in the Supabase dashboard (Storage → Policies).

Bad: a policy lets the public role SELECT/list the whole bucket — every user's uploads become enumerable, including "private" files nobody was supposed to find. This is the single most common critical finding in our audits. Fix: scope SELECT policies to the file owner, and keep sensitive buckets private with signed URLs.

4. Is your .env file in your public repo?

On GitHub, open your repository and search for .env files (.env, .env.local, .env.production). AI coding tools create them; one wrong commit publishes them.

Bad: an env file with real keys is committed — even if you later deleted it, it lives in git history. Fix: rotate every key in it, add .env* to .gitignore, and treat history rewriting as a cleanup, not a cure.

5. Does your admin area trust the browser?

Log in as a normal (non-admin) user, then open your admin URL directly. Then try again in a private window with no login at all.

Bad: the admin page loads, or admin actions work, based on anything the browser controls (a flag in local storage, a header like x-admin: true, a hidden-but-reachable route). We have seen apps where the only "admin check" was exactly that header. Fix: enforce the role check on the server, on every admin route and API endpoint, from the session — never from client-supplied data.

6. Do your sessions ever expire?

In Supabase: Authentication → Settings — check the JWT expiry. In Firebase: session cookies / token settings. Then check your own login flow: after you "log out", does the old token still work if you replay it?

Bad: tokens valid for weeks, or still valid after logout and password change. Fix: shorten access-token lifetime (an hour is typical), rely on refresh-token rotation, and invalidate sessions on password change.

7. Are your AI endpoints rate-limited and capped?

Every route that calls a paid AI API — chat, image generation, text-to-speech, embeddings — spends your money on each request. Check each one: does it require a signed-in user? Is there a per-user or per-IP rate limit in the code? And in your provider's dashboard, is there a hard monthly spending cap?

Bad: an endpoint anyone can call, as fast as they can script it, with no cap behind it — one script can run it all night, and you find out from the invoice. Fix: require authentication on AI-calling routes, add rate limits, and set a hard spending cap with your provider.

Failed one? The Go-Live Check covers the expensive ones — in 24 hours

This list covers what is visible from the outside. The Go-Live Check runs the four fatal checks — open database rules, keys in the browser, unlimited AI endpoints, public buckets — across your whole codebase, and gives you plain-English findings with file-and-line evidence and fix prompts you can paste straight into Cursor. Report within 24 hours of read-only access.

Get the Go-Live Check — $199 See a sample report

Not sure yet? Email us your app URL and we will tell you honestly whether a checkup makes sense for your stack: shisanyue950901@gmail.com