Delegation & Token Exchange¶
Delegation allows an agent to act on behalf of a user or organization with reduced permissions. This is done through OAuth 2.0 Token Exchange (RFC 8693).
When to Use Delegation¶
Use delegation when:
- An agent needs to perform actions for a user
- The agent should have limited, time-bound access
- You need audit trails showing both the user and agent
- You want the ability to revoke agent access independently
Token Exchange Flow¶
- User authenticates and receives an access token
- Agent authenticates and receives its own access token
- Agent exchanges both tokens for a delegated token
- Agent uses delegated token to act on user's behalf
Request Format¶
curl -sS "$SIGID_AUTH_ORIGIN/oauth/token" \
-u "$SIGID_CLIENT_ID:$SIGID_CLIENT_SECRET" \
-H "content-type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=urn:ietf:params:oauth:grant-type:token-exchange" \
--data-urlencode "subject_token=$USER_ACCESS_TOKEN" \
--data-urlencode "subject_token_type=urn:ietf:params:oauth:token-type:access_token" \
--data-urlencode "actor_token=$AGENT_ACCESS_TOKEN" \
--data-urlencode "actor_token_type=urn:ietf:params:oauth:token-type:access_token" \
--data-urlencode "requested_token_type=urn:ietf:params:oauth:token-type:access_token" \
--data-urlencode "audience=https://api.example.com" \
--data-urlencode "scope=limited:scope"
Delegated Token Design¶
| Field | Rule |
|---|---|
| Audience | Exact API or MCP server |
| Scope | Narrow tool or resource action |
Subject (sub) |
Acting agent's pairwise subject for this audience |
Actor chain (act) |
Grantor context and delegation IDs; nested for multiple delegation levels |
| Expiry | Task-bound and short-lived |
| Approval | Required for sensitive or irreversible actions |
Response¶
The delegated token contains:
The access token includes:
sub: The acting agent's pairwise subjectsubject_type:agentact: The grantor chain, including delegation IDsaud: The intended audiencescope: The reduced scope
For SigID-issued delegated tokens, the acting agent stays in sub; the
human or agent granting authority appears in act. Do not reverse these when
looking up the resource owner. See the exact shape in
Claims And Scopes.
Validation¶
Resource servers should:
- Verify the token signature and expiry
- Check
subject_type = agentand identify the acting agent fromsub - Validate the grantor and delegation context in
actagainst your resource policy - Verify
scopeis appropriately narrow - Enforce issuer, audience, tenant, lifetime, and resource-level access checks
The JavaScript validator rejects delegated tokens unless allowDelegation is
set. Enabling it permits the act claim; it does not validate your application's
delegation policy or prove fresh human approval. Apply those checks separately.
Revocation¶
Revoke the delegation to withdraw its authority. SigID cascades that revocation to descendant delegations and their bound token-exchange sessions, blocking further exchanges and refreshes through the revoked chain.
An external API that performs only local JWT verification cannot observe a revocation by checking the signature again: an already-issued token may remain cryptographically valid until expiry. Match token lifetimes and any supported live authorization checks to the resource's requirements. Revoking a login session is not a substitute for explicitly revoking delegated authority.
Agent-Initiated Device Ceremony¶
When the agent must obtain human AAL2 approval without a pre-existing user
token to exchange, use the device-style flow in
Agent Self-Serve Quickstart (POST /api/v1/agents/delegations/device
and the hosted /device/delegation/{user_code} page). That path creates the
delegation record and returns a delegated token with the human’s act
evidence. RFC 8693 exchange on this page remains the path when both a user
subject token and an agent actor token are already available.
See Also¶
- Agent Self-Serve Quickstart - Device-flow human approval
- Agent Authentication - Agent auth methods
- Verify Tokens - Validating delegated tokens