Why Supabase tokens have two metadata blocks
Supabase splits token metadata into two blocks specifically to model trust. `app_metadata` can only be written by code that holds the service role key — your backend or an admin script — so its contents are trustworthy for authorization decisions. `user_metadata` is writable by the authenticated user themselves via the public API, which means anything in there is attacker-controlled.
The most common multi-tenant security bug is reading `user_metadata.tenant_id` and using it for Row Level Security. A user can update that to any value they like, bypassing tenant isolation entirely. This debugger highlights both blocks so the distinction is visible.