Secrets in client bundles
Anything in a client bundle is public. Build tools inline VITE_, NEXT_PUBLIC_, and PUBLIC_ variables into the JavaScript file.
Ship Sentinel flags, and redacts:
- Supabase service_role JWTs and sb_secret_ keys
- Stripe secret, restricted, and webhook keys
- OpenAI and Anthropic keys
- GitHub, AWS, Slack, and Resend tokens
- PEM private keys
The fix is the same shape every time. Revoke the key. Remove it from client code. Put the replacement in a server secret. Call the provider from a Worker, Edge Function, or other server you control.
The anon key, an sb_publishable_ key, and a Firebase web API key are not treated as leaked secrets. They are designed to ship in the client. The check that matters for those is whether the data rules are closed.