How it works
Agent A mints a JWT signed with its own Ed25519 private key and includes it in the message envelope’sdelegationToken field. At each hop:
- The receiver verifies the JWT signature against the issuer’s published public key
- Checks that the current skill is in the token’s
scope - Decrements
maxDepth— rejects the call if depth reaches 0 - Checks
exp— rejects expired tokens
Minting a token
token as delegationToken in your AgentClient.call() options (or handle it at the envelope level for custom clients).
Token structure
act claim follows RFC 8693 and records the original actor in chained delegation — so a chain of A → B → C is auditable at each hop.
Depth enforcement
maxDepth: 2 means Agent B can sub-delegate to Agent C (depth becomes 1), and Agent C can further delegate to Agent D (depth becomes 0). Agent D cannot delegate further — DELEGATION_EXCEEDED is returned.
Setting maxDepth: 1 means no sub-delegation is allowed past the first recipient.
Scope enforcement
Agent B can only invoke skills listed inscope. Attempting to call an out-of-scope skill returns DELEGATION_EXCEEDED with a message indicating the scope violation.
Verifying a token (SDK internals)
The SDK verifies tokens automatically before invoking handlers. The verification result is available in the handler’sctx.delegationToken if you need to inspect it: