Skip to content

feat: filter model list by permissions #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clorichel
Copy link

The bedrock:ListFoundationModels and bedrock:ListInferenceProfiles IAM permission model requires resource to be *, so in effect all available models are returned in the list.

But the user/role listing those models could actually be limited to invoke only a subset of those, through resources like arn:aws:bedrock:*::foundation-model/anthropic.claude-3-7-sonnet-20250219-v1:0 and arn:aws:bedrock:*:ACTUAL_ACCOUNT_ID:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0

These changes automatically filter out any model that is available, but which the user couldn't invoke anyway with their current permissions.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The `bedrock:ListFoundationModels` and `bedrock:ListInferenceProfiles` IAM permission model requires resource to be `*`, so in effect all available models are returned in the list.

But the user/role listing those models could actually be limited to invoke only a subset of those, through resources like `arn:aws:bedrock:*::foundation-model/anthropic.claude-3-7-sonnet-20250219-v1:0` and `arn:aws:bedrock:*:ACTUAL_ACCOUNT_ID:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0`

These changes automatically filter out any model that is available, but which the user couldn't invoke anyway with their current permissions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant