Skip to content

Commit 804e041

Browse files
jariy17Local E2E
andauthored
docs: add bedrock:CountTokens to IAM policy examples (#1181)
Strands SDK uses bedrock:CountTokens to estimate token usage before model calls, enabling proactive context window management. Users running Strands-based agents need this permission in their IAM policies. Co-authored-by: Local E2E <ci@local>
1 parent df27f12 commit 804e041

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/policies/iam-policy-boundary.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"Sid": "BedrockModelAccess",
66
"Effect": "Allow",
7-
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream"],
7+
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream", "bedrock:CountTokens"],
88
"Resource": ["arn:aws:bedrock:*::foundation-model/*", "arn:aws:bedrock:*:ACCOUNT_ID:*"]
99
},
1010
{

docs/policies/iam-policy-user.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
{
117117
"Sid": "BedrockModelInvocation",
118118
"Effect": "Allow",
119-
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream"],
119+
"Action": ["bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream", "bedrock:CountTokens"],
120120
"Resource": "*"
121121
},
122122
{

0 commit comments

Comments
 (0)