Lock Down Your Vibe-Coded App

Fix the three mistakes behind most vibe-coded app hacks, then let your coding agent check your app for all ten.

  1. 1Copy the security check prompt
  2. 2Paste it into your agent
  3. 3Fix what it finds
1

Copy the security check prompt

Check my app for security problems before real users find them.

Work through these ten checks in order. For each one: look at my code and config, tell me if it passes or fails, show me the exact file and line, and explain the risk in plain words.

1. Secret keys in the browser. Search everything that ships to the browser (front-end code, bundled env vars, public config) for secret keys: OpenAI, Anthropic, Stripe secret keys, Supabase service_role, and any other private key. Move them to server-side code or env vars that never reach the client.
2. Database security rules. If I use Supabase, check that row-level security is on for every table and that each policy only lets users see and change their own rows: https://supabase.com/docs/guides/database/postgres/row-level-security
   If I use Firebase, check my Firestore and Storage rules the same way: https://firebase.google.com/docs/rules
3. Rate limits. Find every endpoint that costs money (AI calls, emails, SMS) plus login and sign-up, and add rate limits so one person can't call them thousands of times.
4. Login checked on the server for every private page and API route, not only in the front end.
5. A second user. Check whether account B could read or change account A's data by changing an ID in a request.
6. Exposed keys. If any key was ever in the browser, in git history, a screenshot or a chat, list it so I can rotate it.
7. User input. Check that forms, uploads and URL parameters are validated and safe from injection.
8. Admin and debug. Make sure no admin, debug or test pages are live, and that errors don't show stack traces or secrets.
9. Who can call my backend. Check CORS so only my own domain can call my API, and that everything runs on HTTPS.
10. Packages. Run npm audit (https://docs.npmjs.com/cli/commands/npm-audit) and list outdated packages with known problems.

Use the OWASP Top 10 as your reference: https://owasp.org/Top10/

When you're done, give me a short pass/fail list of all ten. Then fix the failures one at a time, starting with the most dangerous, and ask me before changing anything.
2

Paste it into your agent

Open your project in Claude Code, Codex, or Cursor and paste the prompt.

3

Fix what it finds

It gives you a pass or fail for each check, then fixes the failures one at a time.

The three big ones

Most vibe-coded app hacks come down to one of these. You can check each in a minute yourself.

1API keys inside your app

Anything that runs in the browser can be read. If your OpenAI, Claude, or Stripe key is in there, someone copies it and you pay the bill.

Check
Open your live site, then DevTools → Sources and press Cmd+Option+F. Search for sk-, sk_live and service_role.
Fix
Move the call to your server or a serverless function, read the key from a server-only environment variable, and rotate any key that was ever exposed.

2A database with no security rules

Without rules, anyone with your public database URL can read every user's data.

Check
Supabase: open Advisors → Security Advisor, which flags every table without row-level security. Firebase: your rules should never say allow read, write: if true.
Fix
Turn on row-level security for every table, with policies so each user can only read and change their own rows.

3No rate limits

One person can hit your app thousands of times a minute and run up your AI, email, or SMS bill.

Check
Find every route that calls a paid API or sends a message, plus login and sign-up. If nothing limits how often one person can call it, it's open.
Fix
Add a per-user or per-IP limit (Upstash Ratelimit or your host's firewall rules), and set a monthly budget alert in your OpenAI or Anthropic billing settings.

Run the prompt again before every big launch, and any time you add a new feature that touches user data or paid APIs.

Hi, I'm Rahul. I'm documenting what I learn while building products.