Secret key exposed in public code
A secret credential is in code that anyone can download from your site. Attackers scan for these automatically and can run up bills, read your data or take over accounts. Treat the key as compromised.
Evidence · OpenAI key sk-proj…f3Qa in /assets/index-8f2c.js
Fix prompt for Lovable / Bolt / Cursor / Replit / v0
In this project, remove the exposed secret key from all frontend/client code. Move the API call that uses it into a server-side function (e.g. a Supabase Edge Function, Next.js API route or server action) that reads the key from a server-only environment variable, and have the frontend call that function instead. Never prefix this variable with NEXT_PUBLIC_ or VITE_. Explain what you changed, and don't change unrelated code. IMPORTANT: also revoke/rotate the key in the provider's dashboard now, because it has already been exposed.