#32369 [Bug]: _rotate_master_key skips callback_vars in verification tokens & teams โ decryption errors after master key rotation (LIT-1531)
## Bug: `_rotate_master_key` skips callback_vars in verification tokens & teams
### Summary
When a proxy admin rotates the master key via `POST /key/regenerate` with `new_master_key`, the `_rotate_master_key()` function in `litellm/proxy/management_endpoints/key_management_endpoints.py` re-encrypts:
1. โ `LiteLLM_ProxyModelTable` โ litellm_params (provider API keys) 2. โ `LiteLLM_Config` โ environment_variables 3. โ `LiteLLM_MCPServerTable` โ credentials 4. โ `LiteLLM_MCPUserCredentials` โ user-scoped BYOK/OAuth2 tokens 5. โ `LiteLLM_MCPUserEnvVars` โ per-user env vars 6. โ `LiteLLM_CredentialsTable` โ credential_values
But it does **NOT** re-encrypt:
7. โ `LiteLLM_VerificationToken.metadata` โ `logging[*].callback_vars` (e.g. `LANGFUSE_SECRET_KEY`, `LANGSMITH_API_KEY`) 8. โ `LiteLLM_TeamTable.metadata` โ `logging[*].callback_vars` and `callback_settings.callback_vars` 9. โ Config rows for `vantage_settings` / `cloudzero_settings` 10. โ SSO config table
After rotation, the proxy starts using the new master key for decryption but those values are still encrypted with the old key, producing the recurring error every 30 seconds:
``` Error decrypting value for key: api_key, Did โฆ