AID-H-004.008: AI Workload Identity Permission Scoping at Downstream Services
A prompt-injected or compromised agent, and anyone who obtains its credential, can call these services directly. Such a call never passes through the agent's tool dispatcher, so tool-level authorization does not bound it. Deployment tooling that generates one broad role for every agent, and published research in which one agent's role could read other agents' memory and pull their container images, anchor this control.
This applies when a deployed agent, agent runtime, inference service, or other AI workload that the organization runs holds an identity or credential that a downstream service accepts directly; a workload that holds no such credential is NOT_APPLICABLE. PASS requires that, for every such identity, the downstream service serves the calls the workflow needs and refuses a direct call for another agent's or tenant's resource and for an action the workflow does not use. An out-of-scope call that succeeds is FAIL. An identity whose effective permissions cannot be read or tested is INSUFFICIENT_DATA, and a failed policy read or test run is ERROR.
Pillars: infra
Lifecycle: building, validation, operation
Scope boundary
Owns the effective authorization of each deployed agent or AI workload identity at the downstream services that accept its credential directly: one identity per agent, grants limited to named resources and required actions, and a direct-call test that proves the limit. It covers cloud roles, service accounts, and the API keys or tokens the workload holds for third-party services. It does not authenticate the workload, decide tool calls inside the agent, or cover training-job roles, release-pipeline identities, MCP upstream delegation, or the connection identities of agents published on vendor-hosted low-code platforms.
AID-H-004.002: AID-H-004.002 proves which workload is calling, and for hosted AI-service calls it already restricts model entitlements, Regions, and invocation routes at the provider IAM boundary; AID-H-004.008 owns the grant for everything else the identity can reach: memory, registries, secrets, data stores, and other agents. A correctly authenticated identity that holds a broad grant on those resources passes AID-H-004.002 and fails this control.
AID-H-004.001: AID-H-004.008 scopes what each agent's own identity may do with the resources its workflow uses; AID-H-004.001 sets the organization-level ceiling on who may enable, expand, or reconfigure a hosted AI service. The ceiling bounds every identity in the account; it does not separate one agent's resources from another's.
AID-H-004.006: AID-H-004.006 owns the connector and trigger identities of agents published on vendor-hosted and low-code platforms, including the comparison of a connection account's permissions with the agent's audience; AID-H-004.008 owns the identities of agents and AI workloads the organization deploys in its own cloud accounts and infrastructure.
AID-H-018.002: AID-H-004.008 is enforced by the downstream service against the identity's own credential; AID-H-018.002 decides model- or agent-triggered operations at the tool adapter. A caller that uses the credential directly never reaches the adapter, so only the downstream grant bounds that call.
AID-H-017.002: AID-H-017.002 owns the agent's tool surface and verifies the backend permissions behind each tool as part of that surface; AID-H-004.008 owns the grant of the workload identity itself at each downstream service and the direct-call test, which also covers what no tool exposes. Where a tool's backend credential is the agent's own identity, AID-H-004.008 is the primary owner of that grant and AID-H-017.002 consumes its result.
AID-M-009.003: AID-M-009.003 registers the agent identity and its intended credential scope as context for enforcement; AID-H-004.008 puts that scope into the downstream service policy and tests it.
AID-H-007.001: AID-H-007.001 owns least-privilege roles and store-side read limits for training jobs; AID-H-004.008 owns the same question for deployed agents and serving workloads.
AID-H-023: AID-H-023 owns the permissions of release and publishing workflows in CI; AID-H-004.008 does not cover CI job tokens.
AID-H-034.002: AID-H-034.002 owns token audience, resource binding, and upstream delegation for MCP servers; AID-H-004.008 does not score those MCP delegation checks again.
AID-H-003.005: AID-H-003.005 scans infrastructure code for over-broad grants before deployment; AID-H-004.008 owns the effective grant of the running identity and its direct-call test. A clean scan does not show what the deployed role can do after console edits, attached managed policies, or resource-based policies.
AID-I-004.002: AID-I-004.002 partitions persistent memory behind a retrieval policy gate; a workload that calls the memory service API directly bypasses that gate and is bounded only by the grant owned here.
Implementation guidance
- AID-H-004.008-G001: Give each agent its own identity and grant it only its own named resources at each downstream service.
- AID-H-004.008-G002: Prove the limit with the identity's own credential and refuse later changes that widen it.
AID-H-004.008-G001
Why the grant at the downstream service is the boundary
An agent reaches its memory, registry, secrets and data through a credential. Whoever controls the agent, through prompt injection, a compromised dependency or code execution in its runtime, can use that credential to call the same services directly. Those calls do not pass through the agent's tool dispatcher, so the checks in AID-H-018.002 and AID-H-018.004 never see them. What the downstream service is willing to do for that identity is the only limit left.
Deployment tooling often creates one broad role so that a first deployment works. Unit 42 reported in April 2026 that the execution role generated by the Amazon Bedrock AgentCore starter toolkit allowed GetMemory and RetrieveMemoryRecords on arn:aws:bedrock-agentcore:*:memory/*, image pulls on arn:aws:ecr:*:repository/*, and InvokeAgentRuntime on every runtime. One compromised agent could pull another agent's image, read its memory ID from the image, and read or poison that agent's conversation history. AWS's statement in the same report is that the auto-created roles "should never be used in a production system".
Reference environment
An AWS account that runs agents on Amazon Bedrock AgentCore Runtime, AWS CLI v2, and an administrator who can read and attach IAM policies. The same steps apply to any agent that runs under an IAM role. Action names, resource types and command names below were checked on 2026-11-29 against the Service Authorization Reference for Amazon Bedrock AgentCore, the AgentCore Runtime execution role documentation and the AWS CLI reference. The policies were checked for JSON syntax. Nothing here was run against an AWS account. Account ID, Region, agent name, repository and memory ID are placeholders; read the real values from your deployment.
Step 1: Write down what each agent identity needs
List the deployed agents from the platform that runs them, and take each one's registered identity and intended scope from AID-M-009.003.
aws bedrock-agentcore-control list-agent-runtimes \
--query 'agentRuntimes[].[agentRuntimeName,agentRuntimeId]' --output text
# For each runtime ID: the role it runs as
aws bedrock-agentcore-control get-agent-runtime --agent-runtime-id "$RUNTIME_ID" \
--query roleArn --output textFor each agent record the exact resources its workflow uses: its own image repository, its own memory, its own secrets path, its own log group, the models it calls, and any other agent it is meant to invoke. Two agents that share a role cannot be limited separately, so the first finding is usually a shared or auto-created role. A resource that two agents both need is listed for both by name; it is not a reason for a wildcard.
Step 2: One role per agent, with named resources
Create one execution role per agent, under an IAM path reserved for agent roles such as /agents/, and attach a policy whose resource lines name that agent's own resources. The statements below replace the wildcard statements in the generated role. In the log group resource, the runtime name is followed by a hyphen, as in the AWS example; runtime names cannot contain hyphens, so support_agent-* does not also match another agent's log group. Keep the logging, tracing, model-invocation and workload-identity statements from the AWS documentation linked above, and narrow their resource lines in the same way where they name an agent.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PullOwnImageOnly",
"Effect": "Allow",
"Action": ["ecr:BatchGetImage", "ecr:GetDownloadUrlForLayer"],
"Resource": "arn:aws:ecr:us-east-1:123456789012:repository/support-agent"
},
{
"Sid": "RegistryLogin",
"Effect": "Allow",
"Action": "ecr:GetAuthorizationToken",
"Resource": "*"
},
{
"Sid": "OwnMemoryOnly",
"Effect": "Allow",
"Action": [
"bedrock-agentcore:CreateEvent",
"bedrock-agentcore:GetEvent",
"bedrock-agentcore:ListEvents",
"bedrock-agentcore:RetrieveMemoryRecords",
"bedrock-agentcore:GetMemoryRecord",
"bedrock-agentcore:ListMemoryRecords"
],
"Resource": "arn:aws:bedrock-agentcore:us-east-1:123456789012:memory/support_agent_mem-EXAMPLE123"
},
{
"Sid": "OwnLogStreamsOnly",
"Effect": "Allow",
"Action": ["logs:CreateLogStream", "logs:PutLogEvents"],
"Resource": "arn:aws:logs:us-east-1:123456789012:log-group:/aws/bedrock-agentcore/runtimes/support_agent-*:log-stream:*"
},
{
"Sid": "OwnSecretsOnly",
"Effect": "Allow",
"Action": "secretsmanager:GetSecretValue",
"Resource": "arn:aws:secretsmanager:us-east-1:123456789012:secret:agents/support-agent/*"
}
]
}There is no statement for InvokeAgentRuntime or InvokeCodeInterpreter. Add one only for an agent whose workflow calls another agent or a code interpreter, and name that runtime or interpreter ARN. The memory actions listed accept the memory resource type, so the ARN limits them. Before you add any other action, confirm in the Service Authorization Reference that it accepts the resource type you intend to name.
Step 3: Actions that cannot be limited to a resource
Some actions accept only *. ecr:GetAuthorizationToken is one: it returns a registry login and grants no repository by itself, so it can stay. For any other such action, first ask whether the workflow needs it and remove it if not. If it is needed and it exposes other agents' resources, for example a list call that enumerates every runtime or memory, put agents of different sensitivity in separate accounts or projects so that * covers only their own resources. Do not keep a wildcard because a tool wrote it.
Step 4: Keep tooling from recreating a broad role
Pass the role you created to the deployment tool. The starter toolkit takes it as agentcore configure --execution-role <role ARN> (toolkit CLI reference); without it the toolkit creates the role. Then make the broad path fail at the identity that deploys agents. Creating a runtime requires iam:PassRole on its execution role, so allow that identity to pass only the reviewed agent roles, and only to the AgentCore service:
{
"Sid": "PassOnlyReviewedAgentRoles",
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "arn:aws:iam::123456789012:role/agents/*",
"Condition": {"StringEquals": {"iam:PassedToService": "bedrock-agentcore.amazonaws.com"}}
}Give the deploying identity no permission to create roles or to write or attach role policies; agent roles and their policies change only through the reviewed process in AID-H-004.008-G002. The AWS documentation lists iam:CreateRole, iam:CreatePolicy and iam:AttachRolePolicy on the service-role paths as what a console user needs for the console to auto-create an execution role: do not grant them. A deployment that falls back to a generated role then fails at role creation or at iam:PassRole, which is the intended result.
Deployments through CDK or CloudFormation. The AWS documentation linked above says the AgentCore CLI deploys through AWS CDK and AWS CloudFormation. On that path the role that creates and passes the agent role is CloudFormation's execution role, not the person or pipeline that runs the deployment, so the two limits above do not reach it. By default cdk bootstrap gives that role AdministratorAccess; the --cloudformation-execution-policies option replaces it with policies you supply (CDK guide). Bootstrap the accounts that hold agents with a policy that covers what the stacks create, allows iam:PassRole only as above, and allows iam:CreateRole only on role/agents/*. A role created under that path can still carry a broad policy, so run the Access Analyzer check from AID-H-004.008-G002 Step 3 on the agent role policy in the synthesized template (cdk synth) before every deployment.
Other clouds and other kinds of credential
Google Cloud. Unit 42's Vertex AI research found that the Google-managed service agent attached to a deployed agent had excessive permissions granted by default, and reports Google's advice to replace it with a custom, dedicated service account (Bring Your Own Service Account). Run each agent under its own service account and grant roles on the specific buckets, datasets and secrets it uses.
Azure. Give each agent its own managed identity and assign roles at the scope of the individual resource. Azure accepts role assignments at four scope levels: management group, subscription, resource group and resource; an assignment at any of the first three reaches every resource beneath it.
API keys and tokens for third-party services. The same rule applies to a provider API key, a model-hub token or a SaaS grant that the agent holds. Issue one per agent instance, so that one can be revoked without touching the others, and limit it where the service allows: a Hugging Face fine-grained token can be restricted to specific repositories with read access. A job that publishes needs write access; keep it in a separate job with a separate token.
AID-H-004.008-G002
What has to be shown
A policy file that looks narrow is not the result. The result is that the downstream service refuses the agent's own credential when it asks for something outside its scope, and still serves what the workflow needs. Run the three checks below for every agent identity. The CLI commands were checked against the AWS CLI reference on 2026-11-29 and were not run against an AWS account. The probe in Step 2 was run with stubbed responses under boto3 1.44.13, which validates each request against the service model, and the same check rejects a misspelled parameter name; it made no AWS call. Names and ARNs are placeholders.
Step 1: Simulate the role against its own resources, another agent's, and an unused action
ROLE=arn:aws:iam::123456789012:role/agents/support-agent
OWN=arn:aws:bedrock-agentcore:us-east-1:123456789012:memory/support_agent_mem-EXAMPLE123
OTHER=arn:aws:bedrock-agentcore:us-east-1:123456789012:memory/billing_agent_mem-EXAMPLE456
OTHER_RUNTIME=arn:aws:bedrock-agentcore:us-east-1:123456789012:runtime/billing_agent-EXAMPLE321
check() { # one action on one resource per call; prints the decision
printf '%-40s %s ' "$1" "${2##*/}"
aws iam simulate-principal-policy --policy-source-arn "$ROLE" \
--action-names "$1" --resource-arns "$2" \
--query 'EvaluationResults[0].EvalDecision' --output text
}
check bedrock-agentcore:RetrieveMemoryRecords "$OWN" # allowed
check bedrock-agentcore:CreateEvent "$OWN" # allowed
check bedrock-agentcore:RetrieveMemoryRecords "$OTHER" # implicitDeny
check bedrock-agentcore:CreateEvent "$OTHER" # implicitDeny
check bedrock-agentcore:DeleteMemory "$OWN" # implicitDeny: not used by the workflow
check bedrock-agentcore:InvokeAgentRuntime "$OTHER_RUNTIME" # implicitDeny: not used by the workflowEach line must print the decision in its comment: the agent's own memory is allowed for the actions its workflow uses; the other agent's memory is implicitDeny; and an action the workflow does not use, here deleting its own memory or invoking another agent's runtime, is implicitDeny as well. Add a line for each action and resource your workflow uses, and for each one it must not. Make one call per resource: when several resource ARNs are given in one call, the simulator returns a single result per action, and its decision is the most restrictive across all of them, so a correct policy would print a denial on every line (AWS CLI reference). The simulation evaluates the role's identity policies and does not make the call, so it can be run for every agent pair. It does not show access granted by a resource-based policy on the target, such as a bucket policy or a key policy; Step 2 does.
Step 2: Make the calls as the agent
The execution role's trust policy admits only the AgentCore service, with source-account and source-ARN conditions, so a person cannot assume it; do not widen the trust to test. Run the test as the agent instead. In a test account, create three empty stand-ins for another agent's resources: a memory, an image repository and a secret with a dummy value. A failed control then touches nothing real, and a refusal cannot be explained by a resource that does not exist. Add the function below to a test build of the agent, deploy that build under the execution role you are testing, and invoke it once.
# File: scope_probe.py -- call scope_probe() from a test build of the agent, then remove it
import datetime
import boto3
from botocore.exceptions import ClientError
OWN_MEMORY = "support_agent_mem-EXAMPLE123"
# Stand-ins for another agent's resources, created empty in the test account.
CANARY_MEMORY = "scope_canary_mem-EXAMPLE789"
CANARY_REPOSITORY = "scope-canary"
CANARY_SECRET = "agents/scope-canary/db"
ACTOR, SESSION = "scope-probe", "scope-probe-session"
def outcome(call, **kwargs):
try:
call(**kwargs)
return "allowed"
except ClientError as exc:
error = exc.response["Error"]
return f'{error["Code"]}: {error.get("Message", "")}'
def scope_probe():
memory = boto3.client("bedrock-agentcore")
session = dict(actorId=ACTOR, sessionId=SESSION)
event = dict(session, eventTimestamp=datetime.datetime.now(datetime.timezone.utc),
payload=[{"conversational": {"content": {"text": "scope probe"}, "role": "OTHER"}}])
return {
"identity": boto3.client("sts").get_caller_identity()["Arn"],
"own_write": outcome(memory.create_event, memoryId=OWN_MEMORY, **event),
"own_read": outcome(memory.list_events, memoryId=OWN_MEMORY, **session),
"canary_read": outcome(memory.list_events, memoryId=CANARY_MEMORY, **session),
"canary_write": outcome(memory.create_event, memoryId=CANARY_MEMORY, **event),
"canary_image": outcome(boto3.client("ecr").batch_get_image, repositoryName=CANARY_REPOSITORY,
imageIds=[{"imageTag": "latest"}]),
"canary_secret": outcome(boto3.client("secretsmanager").get_secret_value, SecretId=CANARY_SECRET),
}Read the returned record. identity must be the agent's role. own_write and own_read must be allowed; own_write leaves one test event in the test agent's own memory. The four canary_ entries must start with AccessDeniedException, and the message must name the action being tested; a denial of a different action, such as a key-service action on the secret's encryption key, does not show what the agent's own grant allows. If any of them is allowed, the control has failed for that agent: fix the grant and repeat. Any other error code, such as ResourceNotFoundException or ValidationException, is not a pass: correct the identifier and repeat until the answer is a decision about access. If an own-resource call is denied, the policy is too narrow for the workflow; correct it now, because a policy that breaks the agent gets replaced by a broad one.
Step 3: Refuse policy changes that widen the scope
Keep each agent policy in version control and check every proposed change before merge. IAM Access Analyzer's policy check answers whether a policy document grants a given access:
aws accessanalyzer check-access-not-granted \
--policy-document file://support-agent-policy.json \
--policy-type IDENTITY_POLICY \
--access '[{"actions":["bedrock-agentcore:RetrieveMemoryRecords","bedrock-agentcore:GetMemoryRecord","bedrock-agentcore:CreateEvent"],"resources":["arn:aws:bedrock-agentcore:us-east-1:123456789012:memory/billing_agent_mem-EXAMPLE456"]}]' \
--query result --output textThe command prints PASS when the policy does not grant the listed access and FAIL when it does; fail the pipeline on anything other than PASS, including a command error. List, for each agent, the other agents' resources it must never reach. Review IAM Access Analyzer's unused-access findings for agent roles on the schedule your policy sets and remove permissions the agent has not used. A change made in the console bypasses this check, so also alert from CloudTrail on IAM CreateRole under the agent role path, and on PutRolePolicy, AttachRolePolicy, CreatePolicyVersion, SetDefaultPolicyVersion and UpdateAssumeRolePolicy events that touch an agent role or its policies, when they do not come from the pipeline's identity. A runtime can also be switched to another role with AgentCore's UpdateAgentRuntime; confirm once that your trail records that call, and alert on it the same way.
What these checks do not show
An agent that is compromised keeps everything inside its own scope: its own memory, its own secrets, the actions its workflow needs. Abuse inside that scope is the subject of AID-D-011.004, and removing the identity is AID-E-001.003. For API keys and tokens held for third-party services, run the same kind of test with that token against a repository, project or scope the agent should not reach.
Open-source tools
- AWS CLI v2 (iam simulate-principal-policy and accessanalyzer check-access-not-granted for agent role policies)
- Parliament (IAM policy linter)
- Policy Sentry (generates IAM policies limited to named resource ARNs)
- Cloudsplaining (reports IAM policies that allow actions without resource constraints)
Commercial / hosted tools
- AWS IAM Access Analyzer (custom policy checks and unused access findings)
- Amazon Bedrock AgentCore Runtime (per-agent execution roles)
- Hugging Face Hub fine-grained access tokens (repository-scoped tokens)
Threat mappings
MITRE ATLAS
- AML.T0012 Valid Accounts (a valid agent credential is limited to that agent's own resources at the downstream service)
- AML.T0091 Use Alternate Authentication Material
- AML.T0091.000 Use Alternate Authentication Material: Application Access Token (a stolen role session or API token cannot act outside the scope granted to that agent)
- AML.T0085 Data from AI Services
- AML.T0085.002 Data from AI Services: Conversation Context and Memory (direct reads of another agent's stored memory are refused by the memory service)
- AML.T0080 AI Agent Context Poisoning (stored context of other agents cannot be written with this agent's credential)
- AML.T0080.000 AI Agent Context Poisoning: Memory (a direct write to another agent's memory with this agent's credential is refused by the memory service)
- AML.T0101 Data Destruction via AI Agent Tool Invocation (When a tool acts with the scoped agent identity, the downstream service denies destructive operations or targets that the workflow is not authorized to use. A tool with a separate credential requires its own restrictions.)
MAESTRO
- Privilege Escalation (Cross-Layer)
- Lateral Movement (Cross-Layer)
- Lateral Movement (L4) (one compromised agent's identity cannot reach other agents' images, memory, or runtimes)
OWASP LLM Top 10 2026
- LLM03:2026 Excessive Agency (each agent identity holds only the downstream permissions its workflow uses)
OWASP ML Top 10 2023
- N/A
OWASP Top 10 for Agentic Applications 2026
- ASI03:2026 Identity and Privilege Abuse
- ASI06:2026 Memory & Context Poisoning (one agent's credential cannot write into another agent's memory store)
NIST Adversarial Machine Learning 2025
- NISTAML.039 Compromising connected resources (a hijacked agent's identity cannot act on connected resources outside its granted scope)
Cisco Integrated AI Security and Safety Framework
- AISubtech-14.1.2 Insufficient Access Controls
- AISubtech-2.1.2 Capability and Permission Overreach (targets and actions outside the workflow are not granted to the identity, so overreach stops at the grant)
- AITech-14.1 Unauthorized Access
- AITech-2.1 Excessive Agency
Google Secure AI Framework 2.0 - Risks
- RA: Rogue Actions (downstream grants bound what a hijacked agent identity can change)
- SDD: Sensitive Data Disclosure (other agents' and tenants' data is not readable with this agent's identity)
Databricks AI Security Framework 3.0
- Agents - Core 13.1: Memory Poisoning (direct writes to another agent's memory store are refused)
- Agents - Core 13.3: Privilege Compromise