Lock Down Exposed API Keys & Database Row-Level Security (RLS)
When you ask an AI coding assistant to "make the feature work", it takes the shortest path—often dropping secret keys directly into frontend components or turning off database permission checks so errors disappear. Open your browser Network tab and inspect your bundled JS files for any leaked keys [1].
Any environment variable prefixed with VITE_ or NEXT_PUBLIC_ is shipped publicly to every browser. Move all secret calls to server API routes [1].
Enable Row-Level Security on every table and verify policies with an unauthenticated curl request before going live.
Why this matters: A single exposed OpenAI or Stripe secret key in a client bundle can rack up £5,000+ in automated bot abuse overnight or expose your entire customer list under UK GDPR [4].



