Granting and Restricting Access to Amazon Bedrock Models
This lesson explains how access to Amazon Bedrock models is enabled, and how IAM policies, service control policies and API keys control which principals can use which models.
Learning outcomes
After completing this lesson, you will be able to:
- Describe how serverless model access is enabled on first invocation and its prerequisites.
- Explain how IAM policies and SCPs restrict access to specific models and inference profiles.
- Distinguish short-term from long-term Amazon Bedrock API keys.
- Describe how access to agents and developer tools is authenticated and monitored.
How model access is enabled
Amazon Bedrock once required each model to be requested on a Model access page. In commercial Regions that page has been retired: serverless models are enabled automatically the first time they are invoked in an account. Some prerequisites remain, as the following list describes.
- Models sold through AWS Marketplace need a subscription, which Bedrock creates on the first call. That call must come from a principal with
aws-marketplace:Subscribe,aws-marketplace:Unsubscribeandaws-marketplace:ViewSubscriptions; afterwards, other principals can invoke the model without those permissions. - Anthropic models need a one-time use case submission, made in the console or with the
PutUseCaseForModelAccessAPI. A submission from the organisation's management account is inherited by member accounts. GetFoundationModelAvailabilityreports whether the agreement for a model isAVAILABLEor stillPENDING, which explains anAccessDeniedExceptionjust after the first call.
Because invoking a model is enough to enable it, access is no longer controlled by who clicks a request button. It is controlled by who is allowed to call bedrock:InvokeModel on which resources.
Least-privilege IAM policies
An application's role is allowed to invoke only the models it uses. Two actions cover inference: bedrock:InvokeModel, which also authorises the Converse API, and bedrock:InvokeModelWithResponseStream, which also authorises ConverseStream. When the application calls a cross-Region inference profile, the policy allows the profile's ARN and the foundation model in each Region the profile can route to, as in the following policy.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream"],
"Resource": [
"arn:aws:bedrock:us-east-1:111122223333:inference-profile/us.amazon.nova-micro-v1:0",
"arn:aws:bedrock:*::foundation-model/amazon.nova-micro-v1:0"
]
}]
}Across an organisation, a service control policy blocks unapproved models in every account by denying the invoke actions on everything except an approved list. Denying aws-marketplace:Subscribe alone is not enough, because Bedrock starts the subscription automatically during the first invocation; the deny must be on the Bedrock actions. Other Bedrock resources are restricted in the same way, for example by allowing bedrock:Retrieve only on one knowledge base ARN.
Grant model access
Amazon Bedrock API keys
Amazon Bedrock API keys let tools that expect a bearer token call Bedrock without Signature Version 4 signing. There are two kinds, which differ in how long they last and what they are tied to.
Code that runs on AWS compute does not need either kind, because the SDK signs requests with the compute's IAM role. When a key is used, it is stored in Secrets Manager rather than in code or environment variables, and IAM policies can deny the creation of long-term keys.
Which credential?
Access to agents and developer tools
The same principles apply to other AI services. Callers of an AgentCore Runtime agent authenticate with IAM (SigV4) or with a JSON Web Token from an identity provider such as Amazon Cognito, configured as the runtime's inbound authorisation. Kiro users sign in with AWS Builder ID, a social login or the organisation's identity provider, and administrators of enterprise subscriptions control which models and MCP servers users may use and whether headless API keys can be created.
Access is monitored as well as granted. AWS CloudTrail records every Bedrock API call with the caller's identity, so unexpected principals or models stand out, and CloudWatch metrics such as Invocations and token counts per model show unusual usage.
One approved model family
A company allows only Amazon Nova models in development accounts, and the reporting service may use only Nova Micro.
The security team attaches an SCP to the development organisational unit that denies bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream with a NotResource list containing the Nova foundation model and inference profile ARNs. The reporting service's role allows the two actions only on the Nova Micro profile and model, as in the policy above.
A developer who tries another provider's model receives AccessDeniedException from the SCP, even with administrator rights in the account, and CloudTrail shows the denied call. Removing the model from a Marketplace subscription would not have achieved this, because the next invocation would subscribe again.
A team denied aws-marketplace:Subscribe to stop developers using a model, but the model still works. Why?
Show answer
Bedrock starts the Marketplace subscription automatically during the first invocation, and once a model is enabled, invoking it needs no Marketplace permission. Denying bedrock:InvokeModel on the model's ARN is what blocks it.
Exam Tips
Remember for the exam
- Models are enabled on first invocation; restrict them by denying bedrock:InvokeModel.
- First call to a Marketplace model needs aws-marketplace:Subscribe; Anthropic models need the use case form.
- bedrock:InvokeModel also covers Converse; cross-Region profiles need the profile and model ARNs.
- Prefer IAM roles; if an API key is needed, prefer a short-term key.