The two credentials
Think of the
api_key_id as a username and the secret as a password — except the secret is exchanged for short-lived tokens rather than sent to the services your agent calls.
Registration
When an agent is registered, MudraID:- Generates the
api_key_id. - Generates the
secret. - Stores only a one-way hash of the secret.
- Returns the plaintext secret to you once.
Why you can’t retrieve the secret later
This is deliberate, and it’s what protects you if MudraID’s database is ever stolen. MudraID stores a one-way hash of your secret — with a server-side secret value (a “pepper”) mixed in — never the secret itself. A hash can’t be reversed back into the secret. So even a full copy of the database doesn’t yield a usable credential — there’s nothing in it to replay. Verification is also constant-time: checking a secret takes the same amount of time whether it’s almost right or completely wrong, so an attacker can’t measure timing to recover it piece by piece.Storing your credentials
- Keep both values in environment variables or a secrets manager — never in source code.
- Add
.envto.gitignore. - The
api_key_idis safe to log; thesecretmust never be logged. - Grant each agent only the scopes it needs. A narrowly scoped agent is a smaller problem if it’s ever compromised.

