Agent Delegation
This guide shows how to model orchestrator to sub-agent delegation with ZeroID using RFC 8693 token exchange.
The key rule is that sub-agents do not borrow the orchestrator's identity. They receive their own token, with their own identity, plus a verifiable record of who delegated authority to them.
The Delegation Model
At issuance time:
the orchestrator proves it currently holds a valid credential
the sub-agent proves its own identity using a signed assertion
ZeroID issues a new token where:
subis the sub-agentact.subis the orchestratorscopesare downscoped to an allowed intersection
This gives you clear attribution without shared credentials.
Before You Start
You need:
a registered orchestrator agent
a registered sub-agent
a valid access token for the orchestrator
a private key for the sub-agent
a registered
public_key_pemfor the sub-agent identity
Step 1: Register the Orchestrator
Python:
Step 2: Register the Sub-Agent With a Public Key
Python:
If you are using jwt_bearer or token_exchange, register the sub-agent with a real public key so it can sign an assertion with its private key.
Step 3: Get an Orchestrator Access Token
Step 4: Build the Sub-Agent Assertion
The sub-agent signs a short-lived JWT assertion with:
iss = sub-agent WIMSE URIsub = sub-agent WIMSE URIaud = ZeroID issuer
Example shape:
Step 5: Exchange the Token
If your client was initialized with the orchestrator API key, the Python SDK can use the cached access token automatically:
If you want to call the token endpoint directly:
Step 6: Inspect the Result
The delegated token should reflect:
subas the sub-agentact.subas the orchestratorgrant_typeastoken_exchangedelegation_depthincremented from the parent token
That lets downstream systems answer two questions independently:
Who is acting right now?
Who delegated that authority?
Scope Attenuation
ZeroID does not let the orchestrator mint arbitrary power for a sub-agent.
The delegated scope must fit inside:
the scopes currently held by the orchestrator
the allowed scopes configured for the sub-agent
any applicable credential policy
That is what makes delegation safe to automate.
Design Recommendations
Use a separate identity for each operational role:
one identity for the orchestrator
one identity for each tool-facing or specialized sub-agent
Do not:
reuse the orchestrator identity for all downstream work
pass the orchestrator's token directly to the sub-agent
skip registering public keys for identities that should prove themselves cryptographically
Failure Modes To Expect
Common reasons for token exchange to fail:
invalid or expired
subject_tokenmalformed or invalid
actor_tokenunknown sub-agent identity
missing or incorrect
public_key_pemrequested scope exceeds what can be delegated
policy blocks the grant type or delegation depth
What's Next?
Read Credential Policies to control delegation depth and allowed grant types.
Read Downstream Authorization to verify delegated tokens in your services.
Last updated