In plain words
A secret key lets your code act as you on a service like Stripe or OpenAI, so anyone who copies it can spend your money or read your data.
Where you see it
Most services hand you two kinds of key. Stripe's publishable key (pk_live_...) is safe in the browser and its secret key (sk_live_...) is not; Supabase has a publishable (anon) key and a secret (service_role) key that skips every access rule.
What goes wrong
- Swapping in the secret key to make an error go away
A query fails on permissions, so the agent switches to the service_role key. The error stops because every access rule is now skipped, sometimes in code that ships to the browser.
- Deleting a leaked key from the code and calling it fixed
The key is still in your git history and in any copy someone already made. Revoke it at the provider and create a new one.
- Pasting keys into chats, screenshots and logs
A key in a support thread, a screen recording or a console.log line is as leaked as one on GitHub.
console.log("stripe key", process.env.STRIPE_SECRET_KEY);
What to tell your agent
Quick check
Sign in to earn +10 XP for itYou find your OpenAI key in a public GitHub commit from last month. What do you do first?