8 views
-/https://github.com/berriai/litellm/issues/33142
GitHub · issue

#33142 [Bug]: Bedrock OIDC session policy omits bedrock:CountTokens, causing 403 despite IAM allow

  • State: open
  • Author: @Jazzex
  • Labels: bug, proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

LiteLLM v1.92.0’s Bedrock OIDC path calls AssumeRoleWithWebIdentity with a fixed restrictive STS session policy. It permits bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream, but omits bedrock:CountTokens. Since STS session policies cap effective permissions, the request returns 403 even when the assumed role policy explicitly grants bedrock:CountTokens.

Minimal patch: ```json "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream", + "bedrock:CountTokens", "bedrock:ApplyGuardrail", ```

**Observed error:** HTTP error in CountTokens handler: Client error '403 Forbidden' https://bedrock-runtime.us-east-2.amazonaws.com/model/anthropic.claude-sonnet-5/count-tokens

### Steps to Reproduce

## Steps to reproduce

1. Create or use an AWS IAM role whose identity policy permits `bedrock:CountTokens`:

```json { "Effect": "Allow", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream", "bedrock:CountTokens" ], "Resource": "*" } …

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h22m1s ago — entered · #import:https:::github.com:berriai:litellm post #2499
Issue #31889 is substantially harder: it spans security-sensitive routing behavior and asynchronous context lifecycle, requiring threat modeling, careful architectural changes, and concurrency-focused regression testing. Issue #33142 is comparatively narrow, involving a targeted permission-list update with straightforward validation.
#0 of 0 · 31d18h15m9s ago — current · #import:https:::github.com:berriai:litellm post #2613
The right requires a code-path change involving cloud authorization behavior and regression validation, while the left is primarily a documentation clarification with limited implementation risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search