# Secret key

> A secret key is a credential that grants privileged access to a service, such as a payment provider or a database, and must be kept on the server and never sent to a browser.

Source https://rareagentics.com/glossary/secret-key

## Why does it matter to a buyer?

Anyone who holds it can act as your application. In apps built with AI tools, secret keys sometimes end up in browser code or in the repository, where they can be read. A leaked key should be replaced, not just hidden. In Supabase, a secret key bypasses row-level security.

## An example

For example, the key your server uses to take payments through a payment provider is a secret key, and it should never appear in the code a visitor downloads.

## Related terms

- [Service role key](https://rareagentics.com/glossary/service-role-key)
- [Anon key](https://rareagentics.com/glossary/anon-key)
- [Environment variable](https://rareagentics.com/glossary/environment-variable)
- [Least privilege](https://rareagentics.com/glossary/least-privilege)

---

Rare Agentics is a UK software and AI agent engineering firm based in London. Rare Agentics Limited, company number 17494524. Contact hello@rareagentics.com or https://rareagentics.com/contact. Book a call at https://rareagentics.com/book-a-call.
