Vercel + Supabase Pre-Launch Security Check
Published · Updated
A one-hour security pass before you share your app's link: tested scripts find leaked keys, missing Supabase Row Level Security, unprotected API routes and server actions, plus the dashboard settings that stop a runaway bill.
Download free (.zip)Feedback / Report a problemFree, no sign-up. Want the week's best kits by email? Get the weekly roundup (optional).
What's in the kit
scan-secrets.mjs, scan-routes.mjs and rls-audit.sql (Node 18+, no installs), Cursor rules + /security-check command, Claude Code commands (/security-check, /check-keys, /check-rls, /check-routes, /check-bills), an optional Claude Code settings.json that blocks .env reads and destructive commands, a CLAUDE.md block, a .cursorignore, copy-paste prompts for v0, Lovable, Bolt, Replit and chat tools, a one-page checklist, guardrails with key-rotation steps, setup for each tool, real example output and troubleshooting.
- A secret scanner that checks your repo, git history, the next.config env block, your built JavaScript and your live site
- A read-only Supabase SQL audit for RLS, risky policies, definer views/functions and who can read storage files
- A route scanner that flags API routes and server actions with no real auth check, public routes that call a paid API with no verified rate limit, and CORS * in next.config / vercel.json
- Drop-in Cursor and Claude Code rules and commands that run the check read-only and ask before anything destructive
- Runaway-bill checks for Vercel, Supabase and AI providers, with exact dashboard paths
Free sample: The pre-launch security checklist
Copy it right here, or download the whole kit above. This is the actual text from the kit.
# Pre-launch security checklist (Vercel + Supabase)
<!-- @botpantry-kit-file -->
Work top to bottom. Anything in **bold** is a launch blocker.
## Before you start
- [ ] **First make sure `.env*` is in `.gitignore`** (`git check-ignore .env.local` prints the name if it is). Then commit or checkpoint your code and work on a branch. Never `git add -A` with an unignored `.env` file in the folder.
- [ ] The app builds locally. Look at `build`/`prebuild`/`postbuild` in `package.json` first: if they run migrations (`prisma migrate deploy`, `drizzle-kit push`, `supabase db push`), use `npx next build` instead. Missing env vars? Put them in `.env.local` (never commit it), or skip the build and use `--url`.
## A. Keys and env vars
- [ ] `node scripts/security/scan-secrets.mjs .` shows **0 HIGH**.
- [ ] `node scripts/security/scan-secrets.mjs . --url https://<your-app>` shows **0 HIGH** (checks what the live site actually ships).
- [ ] **No secret uses a `NEXT_PUBLIC_` / `VITE_` / `EXPO_PUBLIC_` name.** Only the Supabase URL + publishable (or anon) key are public.
- [ ] **No secret in the `env` block of `next.config.*`.** Next.js copies everything there into browser JavaScript, prefix or not.
- [ ] **The Supabase secret / service_role key is only used in server files that `import 'server-only'`.**
- [ ] `.env*` is in `.gitignore`; no `.env` ever committed (or every key in it was rotated).
- [ ] **Every key that ever leaked (git, bundle, live site, screenshot, chat) is rotated.**
- [ ] Vercel env vars: keys are type **Secret**, public values **Config**; production values differ from preview/dev.
- [ ] Moving to new Supabase keys? `sb_publishable_` in the browser, `sb_secret_` on the server; disable legacy keys only after "last used" shows nothing depends on them.
## B. Supabase Row Level Security
- [ ] `scripts/security/rls-audit.sql` in SQL Editor returns **no CRITICAL or HIGH rows**.
- [ ] Advisors → Security Advisor shows **no ERRORs** (CLI: `supabase login`, `supabase link --project-ref <ref>`, `supabase db advisors --linked --type security`).
- [ ] Every WARN row reviewed: public-read tables really are public; public buckets hold only public files.
- [ ] **Storage reads:** no `select` policy for `anon` (or `using (true)`) on a private bucket; signed-in users can read only their own folder.
- [ ] Every migration that creates a table also has grants (for `anon`/`authenticated` as needed **and `service_role`** if server code uses the secret key) + `enable row level security` + policies (needed for new tables after 2026-10-30).
- [ ] Tested by hand: signed out sees only public data; user A cannot see or edit user B's rows or files.
## C. Routes and server actions
- [ ] `node scripts/security/scan-routes.mjs .` shows **0 HIGH**, and every MEDIUM is fixed, "meant to be public", or checked: for `confirm-auth-gate` / `auth-helper-unverified`, open the gate and confirm it refuses a signed-out request before the write (run the "How to check" test the finding gives: usually a `curl` with no cookies that must answer 401/403, `Bearer undefined` for cron routes, a bad signature for webhooks, a signed-out try for server actions). INFO `auth-flow` (Supabase sign-in / sign-up / sign-out) needs no fix. For "calls X, which the scanner didn't follow", open X: if it writes, the route needs a login check. Clean only means every write route reached a gate the scanner fully verified; it is not proof, so do the next item by hand too.
- [ ] **Every route and server action that reads private data or writes checks auth itself** (`getClaims()` / `getUser()`, and `return`s/throws when there is no user: `return NextResponse.json(…, { status: 401 })`, not just `NextResponse.json(…)`; no `&& something` that can switch it off; not `getSession()`, not only `proxy.ts`). Try it: call the route signed out and as a second user.
- [ ] Writes check ownership of the record, not just login.
- [ ] Input validated on the server; responses contain only needed fields.
- [ ] **Routes that call AI / email / SMS have a rate limit that runs before the paid call** (per user, or per IP on a route that is public on purpose) and a low `maxDuration`. `scan-routes.mjs` shows no HIGH `paid-api-no-rate-limit`, and every MEDIUM `paid-api-rate-limit-unverified` is checked: more requests than the limit allows get 429 and never reach the provider. A limit set only as a Vercel Firewall rule in the dashboard is invisible to the scanner: also call `checkRateLimit()` in the route.
- [ ] **No `Access-Control-Allow-Origin: *` on `/api` or on every path** in `next.config` `headers()`, `vercel.json` or `proxy.ts` (the scanner reports `cors-wildcard-config`); use your own origin. Never `*` together with `Access-Control-Allow-Credentials: true`.
- [ ] **Next.js ≥ 16.4.1 (or 15.5.28)**, redeployed after upgrading. On 15.x, `npm ls sharp` shows 0.35.5 or later. (Floor current as of the 2026-10-14 security release.)
## D. Runaway-bill limits
- [ ] Vercel: on Hobby, or on Pro with **Spend Management on + Pause production deployments on** (on by default for Pro; check it), budget below your real max. It doesn't cover Marketplace integrations: Supabase billed through Vercel needs Supabase's own Spend Cap.
- [ ] Vercel Firewall: rate-limit rule on `/api/*` (or `checkRateLimit` in AI routes).
- [ ] You know the emergency switch, **Attack Mode**: free on all plans (Hobby, Pro, Enterprise), blocked requests don't count toward usage. Project → **Firewall** → **Bot Management** → under **Attack Mode**, **Enable**. Only during an attack: standalone APIs, mobile apps and unrecognized automated callers may fail the challenge.
- [ ] `next.config` images: only your own hosts.
- [ ] Supabase: Spend Cap on (Pro); Auth CAPTCHA on; Auth rate limits reviewed; phone/SMS sign-in off unless needed.
- [ ] **AI providers: one key per app, budget with a hard limit** (OpenAI project hard limit, Anthropic workspace limit), auto-recharge off.
## After launch (weekly, 5 minutes)
- [ ] Re-run both scripts and the SQL after big AI-generated changes.
- [ ] Glance at Vercel Usage and Supabase Usage pages; check Security Advisor.
Questions about this kit
Is the Vercel + Supabase Pre-Launch Security Check kit free?
Yes. It's a free .zip download ($0) with no account and no email required. Bot Pantry is paid for by clearly labeled sponsors, not by selling kits.
Who is this kit for?
Beginners and vibe coders who built a Next.js app on Vercel and Supabase with an AI tool and want to check it before launch.
Which tools does it work with?
It's written for: Cursor; Claude Code; v0; Lovable; Bolt; Replit; Supabase; Vercel; Node.js 18+; ChatGPT, Claude, or Grok. The kit is a .zip of files (prompts, templates, guides and checklists) that you use with those tools. Bot Pantry has no app or account to sign up for.
How long does setup take?
About 45-90 min. That setup time was checked when the kit was reviewed before publishing.
How do I start?
Download the .zip, unzip it and open README.md first. It explains what each file is for and walks you through setup (about 45-90 min). The free sample above is a real file from the kit.
Will the AI act on its own?
No. Like every Bot Pantry kit, it is set up so the AI drafts or suggests and you decide. It should not send, post, delete or spend anything on its own.
More free kits for vibe coders
Free AI agent kits for vibe coders · Browse the full kit library
Where this kit fits: Vibe coding launch checklist: 4 free kits, in order