Skip to content

fix: update LiteLLM and handle Bedrock HTTPS endpoints - #820

Merged
chrisknvidia merged 13 commits into
mainfrom
feat/christopherk/dependency-security-litellm
Nov 20, 2026
Merged

chrisknvidia merged 13 commits into
mainfrom
feat/christopherk/dependency-security-litellm

Conversation

@chrisknvidia

@chrisknvidia chrisknvidia commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Raise the optional LiteLLM range to >=1.110.2,<1.111.0.dev0 and refresh its boto3 and botocore dependencies.
  • Set the optional boto3 minimum to 1.44.0 and require HTTPS for Bedrock bearer endpoint overrides in catalog preflight and host inference. Preserve IAM credential lookup when the bearer token is blank.

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes
  • Ran make lint
  • Ran make test
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

Lint, builds, installed dependency checks, and focused provider and packaging tests passed. A fresh Tier 3 wheel rejected an older boto3 pin and installed with boto3 and Botocore 1.44.0. The loopback checks covered trusted HTTPS, rejected HTTP overrides, and the environment loaded by LiteLLM on first import.

Full local make test on c3f7089: 43,367 passed, 11 failed. All 11 failures are in tests/test_harbor_local_environment.py (macOS ._* AppleDouble files in the download and export tests) and they fail the same way on main, so none come from this change. The hosted macOS check identified a blank-token regression in an earlier revision. The targeted missing-credential and HTTPS cases passed after restoring the prior blank-token behavior. Review follow-ups (8fd18ed, add793b, 536727d, 8976915, 96a78b8) make host inference treat a whitespace-only Bedrock bearer token like preflight does, including on the Bedrock Responses route, where host inference blanks the variable for the duration of the call and then restores it. They also put the HTTPS requirement in the preflight failure text and extend the HTTPS check in host inference to every endpoint override that carries the bearer token. The Bedrock, inference and preflight tests pass on them with the locked dependencies (344 and 1,116 passed), and I did not rerun the full suite on those commits. A later commit (6f13bc6) keeps the Bedrock route endpoints and GPT model capabilities correct for the new routes. GitHub checks pass on the final head.

Release Impact

  • Updated CHANGELOG.md

@chrisknvidia
chrisknvidia marked this pull request as ready for review November 20, 2026 07:38
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

… is blank

A blank or whitespace-only AWS_BEARER_TOKEN_BEDROCK is treated as absent and
the IAM credentials are validated, but Botocore still selects bearer
authentication for any set value and sends "Authorization: Bearer <blank>".
Pin SigV4 on both Bedrock clients in that case, without touching os.environ,
and cover it with a real-client test against a loopback TLS endpoint.

Signed-off-by: Christopher Kevin <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reproduced a difference between Bedrock preflight and host inference for a whitespace-only token.

Comment thread src/skillevaluator/inference/client.py Resolved
chrisknvidia and others added 2 commits November 20, 2026 10:38
A whitespace-only AWS_BEARER_TOKEN_BEDROCK now counts as no token in host
inference, the same as in the Tier 3 preflight. The HTTPS-only endpoint check
no longer fires for it, and LiteLLM signs with the IAM credentials instead of
sending a blank Bearer header. The blank-token check lives in one shared
helper used by both paths.

Signed-off-by: Christopher Kevin <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified the Converse fix and reproduced one remaining issue in Bedrock Responses.

Comment thread src/skillevaluator/inference/client.py Resolved
…lank

LiteLLM's Bedrock Responses route takes its token from the api_key argument or,
when that is empty, from AWS_BEARER_TOKEN_BEDROCK. A whitespace-only value
therefore still became a Bearer header and the request failed before it was
sent. Host inference now blanks the variable for the duration of the call when
it holds only whitespace, and puts the exact value back afterwards. Overlapping
calls share one blanked window. Real tokens and other Bedrock routes are
unchanged.

Signed-off-by: Christopher Kevin <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chrisknvidia for this contribution! I reviewed add793b3ca: I read the change and its callers, ran probes on the head, and checked the tests and docs. I left 3 inline comments (3 P3); please take a look.

Comment thread CHANGELOG.md Resolved
Comment thread src/skillevaluator/inference/client.py Resolved
The preflight raised InvalidConfigError, but only the exception class name
reached the result detail, so the cause was hidden. Return the failure
directly with a constant detail that names the HTTPS requirement and keeps
the token and endpoint out of the output.

Signed-off-by: Christopher Kevin <[email protected]>
Add a Fixed entry for the preflight and host inference now using IAM
credentials when AWS_BEARER_TOKEN_BEDROCK is empty or whitespace-only.

Signed-off-by: Christopher Kevin <[email protected]>
…he bearer token

Host inference only checked AWS_BEDROCK_RUNTIME_ENDPOINT, so the mantle route
(BEDROCK_MANTLE_API_BASE) and the hosted-platform route could still send the
bearer token over HTTP. Check all of those overrides with one helper, and only
when a real bearer token is set.

Signed-off-by: Christopher Kevin <[email protected]>
@chrisknvidia
chrisknvidia merged commit 2b82038 into main Nov 20, 2026
25 checks passed
@chrisknvidia
chrisknvidia deleted the feat/christopherk/dependency-security-litellm branch November 20, 2026 21:32
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.

2 participants