Supabase anon key vs service-role key: what can be public?
Supabase anon and publishable keys are intended for public clients; service-role and secret keys are privileged and must stay on trusted servers. A public key is safe only within an application whose authorization policies protect the intended data.
Check your app free, first fix freeClassify the key before treating its visibility as an incident. Browser configuration needs a public project key, while privileged backend operations need protected server credentials and authorization. If a privileged key shipped publicly, rotate it and review activity. Hiding the old string or editing its prefix does not revoke access.
Separate project identity from user permission
A public client key lets a browser identify the Supabase project. It is not a password for an individual user's account and it does not make every database operation safe. The effective authorization still depends on the caller's session, table grants and row-level policies.
The older anon key is JWT-shaped. Newer publishable keys use a different visible format. Neither fact should lead a scanner to treat ordinary client configuration as an administrator credential. By contrast, a service-role JWT or a secret key is intended for privileged server use and can bypass the protection you expected from RLS.
Check which code receives the credential
Trace imports and serialized responses as well as environment-variable names. A value stored in a host's secret configuration can still be exposed if server code returns it in JSON or injects it into a public page. A client-visible prefix can publish a value during the build even if the original environment file never leaves the server.
Browser client:
project URL + public anon/publishable key
signed-in user token when the user authenticates
Trusted server:
private secret/service-role credential only when required
explicit authorization for every privileged operationDo not put a secret behind an unrestricted proxy and call the architecture fixed. If any anonymous caller can make the server perform the privileged operation, the key is hidden but the authority is still exposed.
Decode locally, without mistaking decoding for verification
Reading a JWT payload can reveal a role label, but decoding does not establish that the token is signed correctly, currently accepted or safe to use. Do not upload a real privileged key to a public decoder or paste it into an assistant conversation.
ProofForge includes a browser-local Supabase JWT-role decoder for classification. The public scanner can recognize supported credential patterns and role signals, but it does not use discovered secret keys to authenticate requests. Its evidence should remain masked so the report does not become another distribution channel for the credential.
Respond differently to the two cases
If the visible value is a public key, review policies and intended anonymous operations. A publicly readable catalog might be deliberate. A private table with public access is a separate defect that changing the public key will not reliably fix.
If the visible value is privileged, rotate or revoke it through the project's supported process and review logs and usage. Update legitimate server consumers carefully, then redeploy. Check old public assets and repository history without treating their deletion as a substitute for revocation.
Finally, run owner and non-owner controls. A system that uses a privileged server client needs particularly clear authorization tests because the database may not enforce the same per-user rule for that client.
Turn the check into a release decision
Keep a small record of the production URL, the time you checked it, the exact finding and the action you took. A local preview and a deployed application can have different environment variables, response headers and database projects. After a repair, deploy the intended version and check the public address again. Do not assume that changing a repository file changed the live system.
Read coverage as carefully as the score. A timed-out asset, an ambiguous backend configuration or a request that could not safely establish access should remain unknown. It should not disappear from your release notes merely because there is no red finding. If a check was not completed, decide who will review it and what additional evidence is needed.
ProofForge's free report includes the first fix. The $9 Fix Report unlocks all findings' available repair guidance and builder prompts, with a PDF and private report link. Fix + Guard costs $29 once and adds builder rules, on-demand deploy-hook scans for 30 days and four weekly rechecks you start yourself. These are different deliverables, not different promises that an application is completely secure.
Keep private report URLs out of public issues and commits. If you need shareable evidence, use the owner-verification and publication flow for an eligible receipt. A signature protects the recorded assessment against undetected changes; it does not make the assessment exhaustive, prove a business outcome, or show that a later deployment still matches an earlier result.
Questions builders ask
Is a publishable key a secret?
Can I hide service_role by changing its variable name?
Does JWT decoding prove a token is valid?
Related checks and fixes
Continue with a related guide
Sources
Scan your app free
See what your live app ships to every visitor, with the first fix free. A clean scan is not a full audit. Run it only on an app you own or have permission to test.
Scan your app free