Writing Least-Privilege Policies for Amazon Bedrock
This lesson covers Bedrock permissions and condition keys, which decide which principals can invoke which models, use which knowledge bases and change which guardrails.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the IAM actions and resources for each Bedrock operation.
- Enforce guardrails with bedrock:GuardrailIdentifier and organisation policies.
- Choose credentials for FM access, including Bedrock API keys.
Actions and resources
Least privilege for Amazon Bedrock starts with knowing which IAM actions each operation needs. Invoking a model uses bedrock:InvokeModel, which also covers the Converse API, and bedrock:InvokeModelWithResponseStream, which also covers ConverseStream. Knowledge bases use bedrock:Retrieve and bedrock:RetrieveAndGenerate on knowledge base ARNs, and agents use bedrock:InvokeAgent on agent alias ARNs.
These actions can be limited to specific resources: foundation model ARNs, in the form arn:aws:bedrock:REGION::foundation-model/MODEL_ID, inference profile ARNs, provisioned model ARNs, custom model ARNs and prompt ARNs. When a request uses a cross-Region inference profile, the policy must allow both the profile and the foundation model in each Region the profile can route to. A least privilege policy lists only the actions and specific ARNs a role needs, never bedrock:* on all resources, as the following policy shows.
{
"Version": "2012-10-17",
"Statement": [
{"Sid": "InvokeApprovedModelsViaEUProfile",
"Effect": "Allow",
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream"],
"Resource": [
"arn:aws:bedrock:eu-central-1:111122223333:inference-profile/eu.amazon.nova-pro-v1:0",
"arn:aws:bedrock:eu-*::foundation-model/amazon.nova-pro-v1:0"]},
{"Sid": "RequireApprovedGuardrail",
"Effect": "Deny",
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream"],
"Resource": "*",
"Condition": {"StringNotEquals": {"bedrock:GuardrailIdentifier": "arn:aws:bedrock:eu-central-1:111122223333:guardrail/gr-abc123:4"}}}
]
}A least-privilege Bedrock policy
Condition keys and organisation controls
Condition keys refine permissions beyond actions and resources. bedrock:GuardrailIdentifier can require that every invocation applies a specific guardrail, and a specific version of it, which enforces safety policy through IAM instead of trusting each application to remember it. Global condition keys add further limits: aws:SourceVpce requires calls to arrive through a specific VPC endpoint, aws:RequestedRegion limits the Regions that may be used, and aws:PrincipalTag or resource tags implement attribute-based access control (ABAC), where access follows tags such as a team or project.
At the organisation level, service control policies in AWS Organizations can deny unapproved models in every account, whatever individual IAM policies allow, and permissions boundaries cap the permissions of roles that developers create themselves.
IAM Access Analyzer validates policies, finds resources shared outside the account and generates least privilege policies from CloudTrail activity, which helps tighten broad policies used during development.
The following diagram shows an IAM deny statement deciding two model calls, one with the approved guardrail and one without.

Controls for Bedrock access
Credentials for FM access
Applications running on AWS should call Bedrock with IAM roles, which provide temporary credentials that rotate automatically. Amazon Bedrock API keys offer an alternative bearer-token form of access for tools that cannot sign requests. Short-term keys, derived from an IAM session, expire with that session and suit temporary use. Long-term keys are tied to an IAM user and suit only exploration, because a leaked long-term key remains valid until someone revokes it. Organisations can restrict or disable API key use with IAM and SCP conditions.
When a gateway also calls models from third-party providers, their API keys belong in AWS Secrets Manager, with rotation configured, and are retrieved at run time rather than stored in code or configuration. The following table summarises the controls.
| Control | Enforces |
|---|---|
| Specific model and profile ARNs | Only approved models can be invoked |
| bedrock:GuardrailIdentifier condition | Every invocation uses an approved guardrail |
| aws:SourceVpce condition | Calls only through a private endpoint |
| SCPs | Organization-wide model and Region restrictions |
| Permissions boundaries | Maximum permissions for developer-created roles |
| IAM Access Analyzer | Policy validation and least privilege generation |
Enforcing guardrails everywhere
A security team requires that all model invocations in production accounts apply the corporate guardrail. Some teams forget to pass it.
Checking application code cannot guarantee compliance. An IAM policy or SCP statement that denies InvokeModel and InvokeModelWithResponseStream unless bedrock:GuardrailIdentifier matches the approved guardrail ARN enforces it: calls without the guardrail fail with AccessDeniedException.
Does bedrock:InvokeModel permission allow streaming responses?
Show answer
No. Streaming needs bedrock:InvokeModelWithResponseStream. InvokeModel also covers Converse.
Exam Tips
Remember for the exam
- InvokeModel permission covers Converse; streaming needs InvokeModelWithResponseStream.
- Scope permissions to specific model, inference profile and knowledge base ARNs.
- Enforce guardrails through IAM with the bedrock:GuardrailIdentifier condition key.
- Restrict models and Regions organization-wide with SCPs.