Back to blog

AI Agent IAM Architecture: Diagramming Identity, Auth & RBAC for AI Agents (2026)

How to diagram AI agent identity and access management (IAM). Covers non-human identity, OAuth token exchange, scoped agent roles, delegation chains, and audit trails for autonomous agents — with prompt templates.

R
Ryan·Senior AI Engineer
·

AI agent IAM is the practice of treating an autonomous AI agent as a first-class identity — with its own scoped role, its own audit trail, and its own lifecycle — rather than a script running under a shared API key. As agents move from read-only assistants to systems that write to databases, call paid APIs, and initiate transactions, the "one shared service account with broad permissions" pattern that worked for early prototypes becomes a serious liability: nobody can tell which agent run did what, and a single leaked key grants far more access than any individual task needs.

An AI agent IAM architecture diagram shows exactly who the agent is, what it's allowed to do, and on whose behalf it's acting at every step. This guide covers the non-human identity model, scoped delegation, and prompt templates for generating agent IAM diagrams in seconds.

Three identities, not one

A common mistake is collapsing "the agent," "the user it's acting for," and "the permissions it has" into a single node on a diagram. A correct agent IAM architecture separates three distinct identities:

  • Agent identity: A registered, non-human identity in your IdP (a service principal in Entra ID, a workload identity in Okta, an IAM role in AWS) that uniquely identifies this specific agent — distinct from the LLM provider, the orchestration framework, and any other agent in the system.
  • Delegated user identity: The human (or upstream system) the agent is acting on behalf of for this specific task — carried through the request chain via a token exchange, not silently dropped once the agent takes over.
  • Effective permission set: The intersection of what the agent identity is allowed to do and what the delegated user is allowed to do — an agent should never be able to access more than the user it's acting for could access directly.

OAuth token exchange for agent-on-behalf-of flows

When an agent calls a downstream API on a user's behalf, the cleanest pattern is OAuth 2.0 token exchange (RFC 8693): the agent presents its own identity token plus the user's original access token to an authorization server, and receives back a new, narrowly-scoped token that encodes both "this is agent X" and "acting for user Y" as separate claims. Diagram this as an explicit exchange step between the agent's initial authentication and any downstream API call — not as the agent simply reusing the user's session token directly, which erases the distinction between human and agent action in every downstream audit log.

Scoped roles over standing broad access

Design agent roles around the narrowest task the agent performs, not the broadest system it touches. A support-ticket-triaging agent needs read access to tickets and write access to a "suggested category" field — it does not need write access to customer billing records, even if both live in the same database. Diagram each distinct agent capability (read tickets, tag tickets, escalate tickets) as a separate scope, and compose roles from those scopes rather than granting a single broad "support-agent" role that happens to include everything any support agent might ever need.

Delegation chains for multi-agent systems

When a supervisor agent spawns sub-agents or a agent calls another agent via A2A, the identity chain has to be preserved across the hop. Diagram each delegation as a link in a chain — supervisor agent identity → sub-agent identity → the original user identity that started the chain — with every downstream system able to see the full chain, not just the immediate caller. This is what makes it possible to answer "which human action ultimately caused this database write" three agent hops later during an incident review.

Prompt templates for AI agent IAM diagrams

Scoped on-behalf-of access for a document Q&A agent

"AI agent IAM architecture for an internal document Q&A agent. User authenticates to the chat interface via Okta SSO, receiving a standard OIDC access token. When the user asks a question, the chat backend exchanges the user's token plus the agent's own client credentials for a narrowly-scoped token via RFC 8693 token exchange, encoding both 'act-as: doc-qa-agent-v2' and 'on-behalf-of: user-4471' as claims. This exchanged token is presented to the document retrieval API, which filters results to only documents the original user (not the agent) has read access to — so the agent can never surface a document the human user couldn't already see directly. The agent identity itself is registered as a workload identity in Okta with a single scope: 'documents:read'. Every retrieval call logs the agent identity, the delegated user identity, and the specific documents returned to a centralized audit index queried by the security team."

Multi-agent delegation chain with scoped sub-agent roles

"AI agent IAM architecture for a supervisor agent that delegates to three specialized sub-agents: a research agent, a drafting agent, and a publishing agent. Supervisor agent authenticates as a registered workload identity with role 'orchestrator', scoped to only spawn and communicate with the three approved sub-agent identities. Each sub-agent has its own workload identity and minimal scope: research agent gets 'web:search' and 'internal-kb:read' only; drafting agent gets no external access, only the research agent's output as input; publishing agent gets 'cms:write' scoped to draft status only, never 'cms:publish'. The original requesting user's identity is threaded through every sub-agent call as an 'on-behalf-of' claim, so the CMS write from the publishing agent is attributed to 'publishing-agent, acting for user-2201, via orchestrator-run-88a3' in the audit log. A human editor must authenticate separately and use their own elevated 'cms:publish' scope to move the draft live — no agent identity in this chain is ever granted publish rights."

Design principles for agent IAM diagrams

  • Never conflate agent and user identity: Draw them as separate nodes joined by an explicit delegation relationship, even when the agent is acting almost entirely autonomously.
  • Scope to the task, not the system: An agent role should reflect the narrowest set of actions the agent actually performs, composed from individual scopes rather than granted as one broad role.
  • Preserve the chain across delegation: In multi-agent systems, every hop should carry forward the originating identity, not just the immediate caller's identity.
  • Log identity, not just action: Every audit entry should capture which agent identity, acting for which user identity, took the action — this is the difference between an auditable system and a debugging nightmare after an incident.

Frequently asked questions about AI agent IAM architecture

Why can't an agent just reuse the user's session token?

Reusing the user's raw token means every downstream system sees the request as coming directly from the human, with no way to distinguish agent-initiated actions from ones the user took themselves. This breaks auditability (you can't tell which agent run caused a given write), makes it impossible to scope the agent's access more narrowly than the user's full permissions, and prevents you from revoking an individual agent's access without revoking the user's own session. Token exchange solves this by minting a new token that encodes both identities as distinct claims.

What is a non-human identity (NHI)?

A non-human identity is a registered identity in your identity provider that represents a machine, service, or agent rather than a person — with its own lifecycle (provisioning, rotation, deprovisioning), its own scoped roles, and its own entries in the audit log. Treating agents as NHIs rather than shared API keys is what makes it possible to apply the same governance (least privilege, periodic access review, revocation) to agents that already applies to human accounts.

How do I diagram permission scoping without listing every individual permission?

Group related permissions into named scopes (e.g., "tickets:read", "tickets:tag") and show roles as compositions of scopes rather than enumerating individual API calls. This keeps the diagram readable while still making the boundary of what each agent can do explicit — a reviewer should be able to look at the role composition and immediately tell what the agent cannot do, which is usually the more important question in a security review.

Related guides: AP2 agent payments architecture, agentic AI security architecture, zero trust architecture diagrams, and AI SRE architecture.

Ready to try it yourself?

Start Creating - Free