Identity-based policy examples for Amazon Bedrock Agents - Amazon Bedrock

Identity-based policy examples for Amazon Bedrock Agents

Select a topic to see example IAM policies that you can attach to an IAM role to provision permissions for actions in Automate tasks in your application using conversational agents.

Required permissions for Amazon Bedrock Agents

For an IAM identity to use Amazon Bedrock Agents, you must configure it with the necessary permissions. You can attach the AmazonBedrockFullAccess policy to grant the proper permissions to the role.

To restrict permissions to only actions that are used in Amazon Bedrock Agents, attach the following identity-based policy to an IAM role:

{ "Version": "2012-10-17", "Statement": [ { "Sid": "Amazon Bedrock Agents permissions", "Effect": "Allow", "Action": [ "bedrock:ListFoundationModels", "bedrock:GetFoundationModel", "bedrock:TagResource", "bedrock:UntagResource", "bedrock:ListTagsForResource", "bedrock:CreateAgent", "bedrock:UpdateAgent", "bedrock:GetAgent", "bedrock:ListAgents", "bedrock:DeleteAgent", "bedrock:CreateAgentActionGroup", "bedrock:UpdateAgentActionGroup", "bedrock:GetAgentActionGroup", "bedrock:ListAgentActionGroups", "bedrock:DeleteAgentActionGroup", "bedrock:GetAgentVersion", "bedrock:ListAgentVersions", "bedrock:DeleteAgentVersion", "bedrock:CreateAgentAlias", "bedrock:UpdateAgentAlias", "bedrock:GetAgentAlias", "bedrock:ListAgentAliases", "bedrock:DeleteAgentAlias", "bedrock:AssociateAgentKnowledgeBase", "bedrock:DisassociateAgentKnowledgeBase", "bedrock:GetKnowledgeBase", "bedrock:ListKnowledgeBases", "bedrock:PrepareAgent", "bedrock:InvokeAgent" ], "Resource": "*" } ] }

You can further restrict permissions by omitting actions or specifying resources and condition keys. An IAM identity can call API operations on specific resources. For example, the UpdateAgent operation can only be used on agent resources and the InvokeAgent operation can only be used on alias resources. For API operations that aren't used on a specific resource type (such as CreateAgent), specify * as the Resource. If you specify an API operation that can't be used on the resource specified in the policy, Amazon Bedrock returns an error.

Allow users to view information about and invoke an agent

The following is a sample policy that you can attach to an IAM role to allow it to view information about or edit an agent with the ID AGENT12345 and to interact with its alias with the ID ALIAS12345. For example, you could attach this policy to a role that you want to only have permissions to troubleshoot an agent and update it.

{ "Version": "2012-10-17", "Statement": [ { "Sid": "Get information about and update an agent", "Effect": "Allow", "Action": [ "bedrock:GetAgent", "bedrock:UpdateAgent" ], "Resource": "arn:aws:bedrock:aws-region:111122223333:agent/AGENT12345" }, { "Sid": "Invoke an agent", "Effect": "Allow", "Action": [ "bedrock:InvokeAgent" ], "Resource": "arn:aws:bedrock:aws-region:111122223333:agent-alias/AGENT12345/ALIAS12345" }, ] }