# Ship-Safe checklist for AI-built apps (ArrayTechLabs)

Check these before you launch. Each item links to the official docs it comes from. This isn't a full
security review: it catches the leaks AI builders most often ship.

## Secrets
- [ ] No secret in a variable prefixed `NEXT_PUBLIC_` (Next.js) or `VITE_` (Vite). Those are bundled into
      the JavaScript every visitor downloads.
      [Next.js](https://nextjs.org/docs/app/guides/environment-variables) · [Vite](https://vite.dev/guide/env-and-mode)
- [ ] Open your live site, then DevTools → Sources, and search the bundle for `sk_`, `service_role`,
      `secret` and your API providers' key prefixes.
- [ ] `.env*` files are in `.gitignore` and were never committed (check the git history, not just the current tree).

## Supabase
- [ ] The secret key (or the legacy `service_role` key) is only used in server code, never in the browser
      or a shipped app. It bypasses every Row Level Security policy.
      [API keys](https://supabase.com/docs/guides/api/api-keys)
- [ ] Row Level Security is enabled on every table in an exposed schema (`public` by default).
      [RLS](https://supabase.com/docs/guides/database/postgres/row-level-security)
- [ ] Every table has policies that match who should read and write it. No `using (true)` on private data.
- [ ] Run the Supabase Security Advisor (Dashboard → Advisors) and fix what it flags.

## Stripe
- [ ] Webhook handlers verify the `Stripe-Signature` header with the endpoint's `whsec_` secret, using the
      raw request body. [Webhooks](https://docs.stripe.com/webhooks#verify-events)
- [ ] Access is granted from verified events (or by fetching the object from Stripe), never from data
      the browser sends.
- [ ] Event IDs are logged so duplicate deliveries aren't processed twice.

## The prompt
Paste into Claude Code from the root of your project:

> Audit this project for 4 leaks and show me each finding with the file and line before changing anything:
> (1) any secret in a NEXT_PUBLIC_ or VITE_ variable or otherwise bundled into client code;
> (2) a Supabase secret or service_role key used outside server code;
> (3) Supabase tables without Row Level Security enabled, or with policies that let anyone read or write;
> (4) Stripe webhook handlers that don't verify the Stripe-Signature header with the endpoint secret.
> Then propose a fix for each one and wait for my OK.

---
Made by ArrayTechLabs · websites + AI apps · IE · OC · LA · arraytechlabs.com
