mudraid-sdk is how an agent authenticates itself. It’s a drop-in replacement for the requests library: you swap the client, and every call your agent makes is signed with a short-lived MudraID token. No decorators, no boilerplate, no secrets in your request code.
When to use it
Use the SDK on the agent side — in the program that makes API calls. If you’re on the receiving side (an API that agents call), you want the FastAPI middleware instead.What it does per call
- Resolves the URL’s host to the right MudraID platform. It learns your agent’s platforms once, on first use.
- Mints a short-lived token for that platform, then caches it in memory until shortly before it expires.
- Attaches the token as an
Authorization: Bearerheader. - Forwards the request and returns the response unchanged.
401 because a token expired in flight, the SDK refreshes once and retries — so expiry never surfaces in your code.
Built so your secret can’t leak
Internally the SDK keeps two separate connection pools: one for talking to MudraID, one for outgoing platform calls. They never share connections. Your agent’s secret is used only against MudraID and can’t accidentally ride along on a request to a platform — that separation is structural, not a convention.Install
During the v0.1 alpha the package isn’t on PyPI yet. From the repo root:
pip install -e sdks/mudraid-sdk-python.The request surface
Agent mirrors requests.Session, so your existing call sites barely change:
requests keyword arguments work — params, json, data, headers, timeout, stream, files — and you get back a real requests.Response. The SDK is a thin authentication shim, not a client framework, so it doesn’t change how you read responses or handle platform errors.
Next
- Configuration — settings, precedence, environments.
- Errors — the exception hierarchy.
- Diagnostics — logging the trust loop.
- Quickstart — a guided first integration.

