# Service role key

> A service role key is the Supabase API key that bypasses row-level security and gives full access to the data in a project, so it belongs only in server-side code.

Source https://rareagentics.com/glossary/service-role-key

## Why does it matter to a buyer?

It exists for trusted backend jobs, such as an administrator task or a scheduled import. If it reaches browser code or a public repository, every row in the database is exposed and the key must be replaced. Supabase now calls the newer form of this key a secret key.

## An example

For example, a server function that sends a nightly report can use the service role key, while the page a customer loads must only ever hold the anon key.

## Related terms

- [Anon key](https://rareagentics.com/glossary/anon-key)
- [Secret key](https://rareagentics.com/glossary/secret-key)
- [Row-level security](https://rareagentics.com/glossary/row-level-security)
- [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.
