# IAM policy example: invoke Bedrock models with streaming, with a least privilege rewrite

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

Allows a role to call InvokeModel and InvokeModelWithResponseStream on two named foundation models and to list the available models. The original uses a wildcard resource on all foundation models, so a new model is allowed on release. The names and the account ID 111122223333 are AWS documentation placeholders.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "InvokeAnyModel",
      "Effect": "Allow",
      "Action": [
        "bedrock:InvokeModel",
        "bedrock:InvokeModelWithResponseStream"
      ],
      "Resource": "arn:aws:bedrock:*::foundation-model/*"
    },
    {
      "Sid": "ListModels",
      "Effect": "Allow",
      "Action": "bedrock:ListFoundationModels",
      "Resource": "*"
    }
  ]
}
```

## What it allows

- Allows invoking any foundation model in any Region, with or without streaming, and listing models.

- Allows 2 actions (bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream) on arn:aws:bedrock:*::foundation-model/*.
- Allows 1 action (bedrock:ListFoundationModels) on every resource.

Checks:
- No flags.

New models become callable the day they appear in the account, before anyone has reviewed cost or data handling.

## Least privilege rewrite

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "InvokeTwoModels",
      "Effect": "Allow",
      "Action": [
        "bedrock:InvokeModel",
        "bedrock:InvokeModelWithResponseStream"
      ],
      "Resource": [
        "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-haiku-20240307-v1:0",
        "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-text-express-v1"
      ]
    },
    {
      "Sid": "ListModels",
      "Effect": "Allow",
      "Action": "bedrock:ListFoundationModels",
      "Resource": "*"
    }
  ]
}
```

The rewrite names two model ARNs in one Region. A new model needs a policy change before anyone can call it.

- Allows 2 actions (bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream) on arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-haiku-20240307-v1:0, arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-text-express-v1.
- Allows 1 action (bedrock:ListFoundationModels) on every resource.

Checks:
- No flags.

- [Paste it into the workbench](/)
- [Every Bedrock action and its access level](/actions/bedrock/)

## Related pages

- [IAM policy example: let EC2 assume a role](/examples/trust-policy-ec2-instance-role/)
- [IAM policy example: let Lambda assume an execution role](/examples/trust-policy-lambda-execution-role/)
- [IAM policy example: cross-account role with external ID](/examples/trust-policy-cross-account-external-id/)
- [All of them](/examples/)

## Sources

- Amazon Bedrock User Guide: identity-based policy examples: https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples.html (read 16 Nov 2026)
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026): https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/examples/bedrock-invoke-with-streaming/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
