Once a managed secret is stored in the developer portal, the next step is to “issue” a grant on it — a per-principal access path identified by aDocumentation Index
Fetch the complete documentation index at: https://docs.alterauth.com/llms.txt
Use this file to discover all available pages before exploring further.
grant_id. The same secret can be issued as separate grants to different users, groups, agents, or as a system grant.
This page covers the SDK surface. The portal’s UI does the same thing — pick whichever fits the workflow.
When to use the SDK vs the portal
| Portal | SDK |
|---|---|
| One-off provisioning by an operator | Programmatic provisioning (onboarding, multi-tenant) |
| A click-through audit trail is preferred | Grants need to spin up per agent / per tenant in code |
| Binding to many users at once | Issuing from inside a deployment workflow |
Issuing a grant
create_managed_secret_grant() is available on both App (operator) and Agent (workload) — but agents can only issue grants for themselves.
Principals
| Principal | Required fields | Notes |
|---|---|---|
UserPrincipal | user_token, label | Resolves to a single end user via the IDP JWT. |
GroupPrincipal | external_group_id, idp_id, label | Resolves to any member of the IDP group. |
SystemPrincipal | — | No caller identity. Server-to-server / cron-style. |
AgentPrincipal | — | Resolves the calling agent from the API key on the request. Carries no agent_id. |
new).
managed_secret_id is the secret’s identifier from the developer portal. principal decides who owns the resulting grant. label is the human-readable name shown in the wallet and in audit logs.
Setting a grant policy (TTL)
Passgrant_policy= to bound the grant’s lifetime:
Agent-issued grants
Agents (theAgent class) can issue grants — but only for themselves. The backend resolves the calling agent from the HMAC-verified API key on the request.
Listing managed-secret grants
Managed-secret grants appear inlist_grants() alongside OAuth grants — they’re returned as ManagedSecretGrantItem objects (vs OAuthGrantItem for OAuth grants). The discriminator field is grant_kind (Python) / grantKind (TypeScript):