Skip to content
vibecoder.expert

GUIDE / 2026-07-26

Vibe Coding Security Cheat Sheet (Copy-Paste Commands)

By Published Updated

TL;DR

  • This is the scannable version of the full checklist: the exact commands to verify the failures that most often sink vibe-coded apps.
  • The four that cause real damage: API keys in client code, disabled Supabase RLS, no per-record authorization, and secrets in git history. Check those first.
  • Every command here is copy-paste and takes seconds. Run them before real users, and again before every release.
  • A clean scan is necessary but not sufficient — the two-account authorization test at the end catches what no scanner can.

This is the fast version — the full checklist has the reasoning, this has the commands. Keep it open in a tab and run down it before you put a vibe-coded app in front of real users, and again before every release. Everything is copy-paste and takes seconds.

Priority order matters: the four checks in the first two sections cause almost all the real damage. If you only have ten minutes, do those.

Secrets — do these first

Find keys leaked into your built bundle (anything here is public):

npm run build
grep -rEo "sk-[a-zA-Z0-9_-]{20,}|sk_live_[a-zA-Z0-9]+|AIza[0-9A-Za-z_-]{35}" dist/ \
  && echo "LEAKED — rotate these keys" || echo "clean"

Scan git history for secrets (a deleted .env is still in history):

# was a .env ever committed?
git log --all --oneline -- ".env*"

# full scan
brew install gitleaks && gitleaks detect --source . -v

Confirm .env is ignored:

grep -qE '^\.env' .gitignore && echo "ignored ✓" || echo "ADD .env TO .gitignore"

Rule: if a key can spend money or bypass permissions, it must never reach the browser. No secrets in VITE_ / NEXT_PUBLIC_ variables — those are compiled into public JavaScript.

Database — Supabase RLS

Find exposed tables (run in the Supabase SQL editor):

select tablename, rowsecurity
from pg_tables
where schemaname = 'public' and rowsecurity = false;
-- any rows = tables the public anon key can read/write

Enable RLS and lock a table to its owner (repeat per table):

alter table your_table enable row level security;

create policy "own rows" on your_table
for all to authenticated
using ((select auth.uid()) = user_id)
with check ((select auth.uid()) = user_id);

Full patterns (public-read, team access, admin-only) are in the RLS guide.

Dependencies

npm audit --omit=dev     # list known CVEs in prod deps
npm audit fix            # auto-fix the safe ones

Auth — test it, don’t assume it

Hit a protected route logged out (should be 401/403, not 200):

curl -i https://yourapp.com/api/your-protected-route

The check everyone skips — test with a second account:

1. Sign up a second user in an incognito window.
2. Note a record ID that belongs to user #1.
3. As user #2, request that record directly (edit the ID in the URL / API call).
4. If you get user #1's data back → broken authorization. Fix before launch.

No scanner catches this one. It’s the most common serious bug in AI-built apps.

Deploy & headers

Force HTTPS (should redirect, not serve):

curl -I http://yourapp.com   # expect 301 -> https://

Grade your live headers: paste your URL into securityheaders.com and observatory.mozilla.org. Aim for A. Minimum headers to set: Content-Security-Policy, X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy: strict-origin-when-cross-origin.

Rate-limit the endpoints that cost money — login and anything calling a paid API. One unprotected AI endpoint plus one abuser equals a four-figure bill.

The 60-second triage

CheckCommand / actionPass =
Keys in bundlegrep dist/ for key patternsno matches
Git historygitleaks detectno findings
Supabase RLSpg_tables queryno rows returned
Dependenciesnpm audit --omit=devno criticals
Logged-out routecurl -i protected URL401/403
Second-account testmanual, two userscan’t see others’ data
HTTPScurl -I http://301 redirect
Headerssecurityheaders.comgrade A/B

Work top to bottom. Fails in the first four sections are stop-ship; the rest can be fixed within the week.

Turn this into a scored report

When you want more than a scan — a tallied PASS/FAIL verdict you can paste into an issue tracker or hand to your AI tool as a work order — run the interactive security checklist; it covers all 20 items and exports as markdown. The security tools guide explains each scanner in depth. And if you’d rather a human run all of this against your actual codebase, that’s the production audit — bring your cheat-sheet results and it goes faster.

Section / FAQ

Questions people ask

What should I check first when securing a vibe-coded app?
Secrets, in two places: your built JavaScript bundle (grep it for key patterns) and your git history (run gitleaks). Leaked API keys are the most common and most immediately expensive failure, so they're worth 60 seconds before anything else. Then check Supabase RLS, because an exposed database is the next most common critical finding.
How do I know if my API keys are exposed?
Build your app and grep the output for key patterns: run `npm run build` then search dist/ for strings like sk-, sk_live_, and AIza. Anything that appears in the built bundle is public — visitors can read it in browser dev tools. Real secrets must live server-side, behind a backend route or edge function, never in a VITE_ or NEXT_PUBLIC_ variable.
Is a security cheat sheet enough, or do I need the full checklist?
The cheat sheet covers the highest-impact checks fast — it's what to run when you have ten minutes. The full checklist adds the reasoning, the auth and reliability items, and an interactive score. Use the cheat sheet for speed and the checklist tool when you want a complete PASS/FAIL report you can act on.
What's the one check people always skip?
Testing authorization with a second account. Everyone tests their app logged in as themselves, where everything works. The bug hides in the gap: log in as a different user and try to open the first user's data by changing an ID in the URL. If it returns data, you have the most common serious vulnerability in AI-built apps — and no automated scanner will catch it.

Free tool

Run the interactive security checklist →

Turn this cheat sheet into a scored PASS/FAIL report you can copy as markdown.