private_key_jwt, or the client secret for client_secret_basic. The agent, its grants and its owner do not change. (Native agent secrets are retired; the old agent rotate-secret route returns 410 Gone.)
Rotate a signing key (private_key_jwt)
A client can hold more than one registered key, so you can rotate without downtime:
- Register the replacement public JWK for the client (
POST /api/v2/oauth/clients/{client_id}/keys, or the portal). Keep the private key in your environment; never upload it. - Activate it by completing the proof-of-possession challenge (
.../keys/{key_id}/activate). A registered key confers nothing until it is activated. - Switch the workload. Point
MUDRAID_PRIVATE_KEY_PATHandMUDRAID_KEY_ID(or your prefix’s equivalents) at the new key, recreate the SDK client — the loader reads the key at construction — and verify a token exchange and a protected request. - Retire the previous key (
.../keys/{key_id}/retire). The last active key of a live client cannot be retired this way, so activate the replacement first.
signer= owns its own key lifecycle; register and activate its public key the same way.
Rotate a client secret (client_secret_basic)
POST /api/v2/oauth/clients/{client_id}/rotate-secret (an organization admin action, also in the portal) mints a new secret and shows it exactly once. The previous secret keeps working for a bounded overlap window, reported as overlap_until, so you can update MUDRAID_CLIENT_SECRET and redeploy without a gap. An expired secret gets no overlap. In production, rotation re-checks the organization’s compatibility approval.
Consider moving the client to private_key_jwt instead — it is the recommended production method, and the private key never leaves your environment.

