Rotating Anon, Service, and JWT Secrets

Last edited: 1/8/2026

Have you ever accidentally committed a service key to a public repo? Or maybe rotating keys is just something you regularly do for security compliance. Whatever the reason, here's how to rotate the keys for your Supabase project.

If you haven’t migrated to asymmetric JWT signing keys:

  1. Go to Project SettingsJWT Keys in the Supabase Dashboard
  2. Navigate to the Legacy JWT Secret tab
  3. Click on Change Legacy Secret
    • Click on Generate a random secret to let Supabase decide the JWT secret.
    • Click on Create my own secret to enter a custom JWT secret
  4. You will see a Confirmation dialog. Read it through and confirm to proceed.

If you have migrated to new symmetric JWT signing keys:

  1. Go to Project SettingsJWT Keyss in the Supabase Dashboard
  2. Navigate to the JWT Signing Keys tab.
  3. Click on Rotate Keys. This will move the current key to “Previously used keys”
  4. Select the three-dot icon (action icon) of your previously used key and click “Revoke”. If you do not “Revoke” the key, older keys will still be valid.

Further readings