Code that runs as a managed agent uses theDocumentation Index
Fetch the complete documentation index at: https://docs.alterauth.com/llms.txt
Use this file to discover all available pages before exploring further.
Agent class. This page covers the runtime surface; for provisioning and key management, see Creating agents and Keys and rotation.
Constructing an Agent
Two ways:Identifying the agent at runtime
me() returns the agent’s AgentInfo. Useful for self-introspection in tools that need to display “who am I” without a separate config plumbing step. Only available on Agent, not App.
Tracing a run
trace() binds a run_id to every request inside its scope. The run ID flows into the audit log so a multi-call workflow can be reconstructed:
context={...} for per-call metadata — trace() for the run-level ID, context for tool name / step name.
To attach run/tool/thread metadata without using trace(), pass context={"run_id": ..., "tool": ...} directly on vault.request(...).
Bootstrapping a grant from the agent
Agents can runvault.connect() and vault.authenticate() the same way an App can — useful for self-service flows where the agent obtains its own delegation rather than waiting for an operator to bind one:
Self-revoking a delegation
When an agent decides it should no longer hold a delegation:App.revoke_grant() — see Managing grants.
Identity-blending rules
- Per-agent key +
user_tokenis rejected. Returns HTTP 400. Agents do not impersonate users. - For agent code that runs inside a user session, use
App(caller=AGENT_UUID, user_token_getter=...)instead ofAgent. See Agents overview.
See also
- Agents overview
- Approvals — human-in-the-loop confirmation for sensitive calls.
- SDK → Client reference