Delegation lets an end user (not an operator) authorize an agent to USE the user’s existing managed-secret access — both direct user grants and group-derived grants. The agent never holds the credential; at runtime the backend resolves the user’s grant via the delegation and injects the credential as if the agent were the user. For credentials provisioned for agents directly, use anDocumentation Index
Fetch the complete documentation index at: https://docs.alterauth.com/llms.txt
Use this file to discover all available pages before exploring further.
AgentPrincipal grant instead. Delegation only applies when the access right belongs to a user.
When to use delegation
- An AI agent should be able to call a third-party API as the user (e.g. “Use my Stripe key for these analytics”).
- The user is the right person to consent — not the operator on their behalf.
- Multiple agents should share the same source access without duplicating credentials.
How it works
App opens Connect
Application backend calls
create_managed_secret_connect_session() with the user’s IDP JWT and the agent identifier. Gets back a connect_url.User consents
User opens
connect_url in a browser. The Connect UI shows the eligible grants the user already has access to (direct or via group). User picks one, optionally tightens the TTL, and clicks Approve.Delegation row written
Backend writes a delegation row binding
(agent_id, source_grant_id, app_user_id). The delegation has its own delegation_id and expiry.Agent uses the credential
Agent calls
app.request(..., grant_id=delegation_id). Backend re-validates the chain on every call (delegation active, source grant active, user still owns the source / still in the bound group), retrieves the user’s credential, and injects it.Eligibility
The Connect UI lists every grant the user can authorize on. A grant is eligible when:- It is on the template the application requested.
- The user is bound to the grant directly OR is an active member of the bound group AND the template allows group-source delegation (operator-controlled per template).
- The grant is active.
TTL
Every delegation has anexpires_at. The effective TTL is the minimum of:
- The caller-suggested
requested_ttl_seconds. - The user-chosen value on the Connect TTL slider.
- The template’s
max_delegation_ttl_days(set per template by the operator). - The source grant’s own
expires_at(the delegation cannot outlive the access it borrows). - The 90-day default.
Revocation
Five paths revoke an active delegation:| Trigger | Effect |
|---|---|
| User revokes via the wallet | Delegation flips to revoked; other agents on the same source grant unaffected. |
| Source grant revoked | All delegations on that grant cascade-revoke. |
| User leaves the bound group (group-source delegation) | User’s delegations under that group cascade-revoke. Other members keep theirs. |
| Managed secret deleted | All delegations on that secret cascade-revoke. |
| Agent revoked / user deprovisioned | All matching delegations cascade-revoke. |