Five agent authorization patterns scope an agent: a role per agent, a role per tool, a session policy, a token exchange and a conditioned resource policy
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
Five authorization patterns scope an AI agent in a cloud account: a dedicated role per agent, a role per tool, session policies that scope down credentials, on-behalf-of token exchange, and resource-based policies with conditions. Each has a documented mechanism in AWS, Azure or Google Cloud, read on 16 Nov 2026.
The five patterns at a glance
| Pattern | AWS mechanism | Azure mechanism | Google Cloud mechanism |
|---|---|---|---|
| Dedicated role per agent | One IAM role per agent, trust scoped to the service and source ARN | One Entra agent identity per agent, created with the agent in Foundry | One agent identity principal per agent, instead of a shared service account |
| Role per tool | A separate execution role for each Lambda function that implements a tool | RBAC assigned to the identity each tool uses | A service account chosen per tool (documented for Dialogflow CX tools) |
| Session policy or scoped credentials | Session policy passed to AssumeRole, up to 10 managed policies | Role assignment at resource scope, with a condition | Scoped OAuth delegation for the user's access |
| On-behalf-of token exchange | AgentCore Gateway token exchange; GetWorkloadAccessTokenForJWT | Entra on-behalf-of flow with delegated scopes | Delegated identity with 3-legged OAuth |
| Resource policy with conditions | Resource-based and endpoint policies with condition keys | Azure ABAC role assignment conditions | Deny policies and IAM conditions |
A dedicated role per agent
The pattern: each agent runs as its own identity, so a grant to one does not reach another and the logs name it. On AWS, a Bedrock agent runs under a service role whose trust policy names bedrock.amazonaws.com (AWS: service role for Bedrock Agents), and the Q Business plugin role example scopes its trust policy with aws:SourceAccount and aws:SourceArn conditions (AWS: plugin role). On Azure, Microsoft documents that creating a Foundry agent provisions a unique agent blueprint and an identity for its default instance. On Google Cloud, Google recommends the per-agent identity over the shared default service agent. See the own-identity check and the trust check.
A role per tool
The pattern: the agent's own identity can invoke tools but holds no data permissions, and each tool function runs under a narrow role of its own. AWS documents that a Lambda function runs under its execution role (AWS: Lambda execution role), so a tool built as a function can carry its own. Google documents that a Dialogflow CX tool can authenticate as a service account that you create and grant roles (Google Cloud: Dialogflow CX tools). The compromise of the agent then does not hand over what the tools hold. The cost is more roles to review. The per-tool role check covers the setup, and self-hosted agents on AWS show the Lambda case.
Session policies and scoped-down credentials
The pattern: when the agent obtains temporary credentials, the request itself carries a smaller policy. AWS documents that session policies are passed as a parameter when creating a temporary session, that the session's permissions are the intersection of the role's identity-based policies and the session policies, and that a call can pass one inline document or up to 10 managed policy ARNs (AWS: policies and permissions in IAM). This lets an orchestrator hand each task only what that task needs. A per-call session policy parameter on Azure or Google Cloud: none found on 16 Nov 2026 in the pages read. The documented moves there are narrow scopes and conditions on the role assignment or binding.
On-behalf-of token exchange
The pattern: the agent trades the user's inbound token for a downstream token that carries both identities. AWS documents this as the token exchange grant in AgentCore Gateway: the exchanged token carries the user's identity and the agent's identity, so downstream services can authorize at every hop without more consent flows (AWS: Gateway outbound authorization). Microsoft's on-behalf-of flow passes the user's identity and uses delegated scopes only (Microsoft: on-behalf-of flow). Google describes a delegated identity that combines the user and the agent (Google Cloud: identity delegation architecture). The user-or-agent check decides which tools use it.
Resource-based policies with conditions
The pattern: the data side refuses calls that do not match, whatever the agent's role holds. AWS documents resource-based policies, including S3 bucket policies, and VPC endpoint policies that restrict which principals can use an endpoint (AWS: VPC endpoint policies). Microsoft documents role assignment conditions that can require, for example, a blob to carry a specific tag (Microsoft: Azure ABAC). Google documents deny rules whose conditions decide whether a rule applies (Google Cloud: deny policies). See the condition check and the authorization page.
Related pages
Sources
- AWS: policies and permissions in IAM, read 16 Nov 2026
- AWS: VPC endpoint policies, read 16 Nov 2026
- AWS: AgentCore Gateway outbound authorization, read 16 Nov 2026
- AWS: create a service role for Amazon Bedrock Agents, read 16 Nov 2026
- AWS: IAM role for Amazon Q Business plugins, read 16 Nov 2026
- AWS: Lambda execution role, read 16 Nov 2026
- Microsoft: agent identity concepts in Foundry, read 16 Nov 2026
- Microsoft: Azure ABAC and role assignment conditions, read 16 Nov 2026
- Microsoft: OAuth 2.0 on-behalf-of flow, read 16 Nov 2026
- Google Cloud: agent identity on Agent Runtime, read 16 Nov 2026
- Google Cloud: identity delegation architecture, read 16 Nov 2026
- Google Cloud: deny policies, read 16 Nov 2026
- Google Cloud: Dialogflow CX tools, read 16 Nov 2026
Last reviewed 16 Nov 2026.