Skip to content

[Fix] broaden RAG ingestion credential cleanup to AWS endpoint/identity fields - #26525

Merged
yuneng-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_rag_aws_endpoint_cleanup
Apr 25, 2026
Merged

[Fix] broaden RAG ingestion credential cleanup to AWS endpoint/identity fields#26525
yuneng-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_rag_aws_endpoint_cleanup

Conversation

@yuneng-berri

Copy link
Copy Markdown
Contributor

Relevant issues

Summary

Extends the cleanup logic in BaseRAGIngestion._load_credentials_from_config()
so caller-supplied aws_sts_endpoint and aws_web_identity_token are
removed when a litellm_credential_name is referenced and the stored
credential does not itself define those fields. Mirrors the existing
api_base handling.

Fix

The credential-overwrite loop already replaces caller-supplied entries on
keys that the stored credential defines, but the post-loop strip covered
only api_base. Generalize the strip to a tuple of three keys
(api_base, aws_sts_endpoint, aws_web_identity_token) so the resolved
vector_store_config cannot pair the credential's keys with caller-chosen
endpoint or identity values when the stored credential omits them.

Testing

  • uv run pytest tests/test_litellm/proxy/rag_endpoints/test_rag_endpoints.py tests/test_litellm/vector_stores/test_vector_store_registry.py tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py -v — 51 passed.
  • Manual API verification against the proxy with three scenarios:
    1. Stored credential + caller-supplied aws_sts_endpoint to a localhost listener → after the fix, the listener receives no traffic and the call routes to the real AWS STS.
    2. Stored credential, no malicious overrides → unchanged before/after.
    3. Caller-direct keys (no stored credential) + caller-supplied aws_sts_endpoint → unchanged before/after; caller remains in control of their own endpoint.

Type

🐛 Bug Fix

Screenshots

mateo-berri and others added 2 commits April 25, 2026 14:19
…s) (#26361)

* feat(azure): add azure/gpt-5.5 + azure/gpt-5.5-pro entries (+ dated variants)

Azure variants of OpenAI's GPT-5.5 family. Microsoft has not yet
shipped GPT-5.5 on Azure OpenAI (latest GA on the Foundry models page
is GPT-5.4 as of 2026-04-24), but adding the entries day-0 mirrors the
established precedent for azure/gpt-5.4* (which were in the cost map
before the Azure rollout) so cost tracking and capability flags work
the moment customers deploy.

Schema follows the existing azure/gpt-5.4* shape:
- Same base/long-context pricing as openai/gpt-5.5*: $5/$30 chat,
  $60/$360 pro per 1M, with priority tier 2x base
- Azure variants drop the flex/batches keys (Azure has no flex tier)
  but keep priority pricing, matching gpt-5.4* precedent
- mode=chat for the thinking model, mode=responses for pro

reasoning_effort capability flags mirror the OpenAI variants exactly
since Azure proxies the same API contract: minimal rejection on both
chat and pro, low/none rejection on pro. Once #26456 (which sets
supports_low_reasoning_effort + minimal=false on openai/gpt-5.5*)
lands, OpenAI and Azure flag profiles align.

Tests pin entry presence + pricing for all four Azure variants and
verify the live-API-derived reasoning_effort flags.

* test: register supports_low_reasoning_effort in cost-map JSON schema

azure/gpt-5.5-pro and azure/gpt-5.5-pro-2026-04-23 added in this branch
carry supports_low_reasoning_effort=false. The strict
'additionalProperties: false' schema in
test_aaamodel_prices_and_context_window_json_is_valid rejected the new
key. Register it alongside the other supports_*_reasoning_effort
entries.

Note: the runtime side of this flag (code that reads it) lands in
#26456. Until that PR merges the flag is inert for both Azure and
OpenAI pro entries, but having the schema accept it lets cost-map
tests pass on either merge order.
…ity fields

Mirrors the existing api_base handling in _load_credentials_from_config():
when a vector_store_config references litellm_credential_name and the stored
credential does not itself define aws_sts_endpoint or aws_web_identity_token,
any caller-supplied value on those keys is removed. Keeps endpoint and
identity fields aligned with the credential definition.
@CLAassistant

CLAassistant commented Apr 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@veria-ai

veria-ai Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Low: No security issues found

This PR adds Azure GPT-5.5 model pricing entries and broadens the RAG ingestion credential cleanup to also strip caller-supplied aws_sts_endpoint and aws_web_identity_token when a stored credential is resolved. The credential cleanup change is security-positive, preventing stale or attacker-injected AWS identity fields from overriding the stored credential definition.


Status: 0 open
Risk: 1/10

Posted by Veria AI · 2026-04-25T21:49:26.808Z

@greptile-apps

greptile-apps Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR has two independent parts: (1) a security fix in BaseRAGIngestion._load_credentials_from_config() that extends the post-credential-overwrite cleanup to strip caller-supplied aws_sts_endpoint and aws_web_identity_token when the stored credential doesn't define them (preventing SSRF via a rogue STS endpoint), and (2) new model_prices_and_context_window.json entries for Azure GPT-5.5 and GPT-5.5-pro (base and dated variants) with matching pricing and reasoning-effort tests. The credential-cleanup logic is correct and well-tested across all three documented scenarios.

Confidence Score: 5/5

Safe to merge; the credential-cleanup fix is correct and the only inline finding is a P2 test-coverage gap.

All P0/P1-level concerns from the prior review thread (missing reasoning-effort flags on dated variants) are pre-existing and already tracked. The new code in base_ingestion.py is logically sound and covers the three documented scenarios. The sole new finding is a P2 missing assertion for supports_low_reasoning_effort in the parametrized test, which does not affect production correctness.

model_prices_and_context_window.json — dated variant entries (azure/gpt-5.5-2026-04-23, azure/gpt-5.5-pro-2026-04-23) still lack reasoning-effort flags (tracked in prior review thread).

Important Files Changed

Filename Overview
litellm/rag/ingestion/base_ingestion.py Core security fix: generalises the post-credential-overwrite strip from api_base-only to also cover aws_sts_endpoint and aws_web_identity_token, preventing a caller from pairing a stored credential with attacker-controlled STS/identity endpoints.
model_prices_and_context_window.json Adds Azure GPT-5.5 / GPT-5.5-pro (and their 2026-04-23 dated variants). Dated variants are missing all reasoning-effort flags that their base counterparts define (flagged in a prior review thread).
tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py Adds pricing and reasoning-effort tests for Azure GPT-5.5 entries; reasoning-effort parametrize doesn't cover supports_low_reasoning_effort or dated variants.
tests/test_litellm/test_utils.py Adds supports_low_reasoning_effort to the JSON-schema validator — a necessary companion to the new azure/gpt-5.5-pro entry that first uses this field.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[__init__: vector_store_config\nloaded from caller ingest_options] --> B{litellm_credential_name\npresent AND credential_list set?}
    B -- No --> Z[Use caller config as-is]
    B -- Yes --> C[CredentialAccessor.get_credential_values]
    C --> D{credential_values\nempty?}
    D -- Yes --> Z
    D -- No --> E[Write all credential values\ninto vector_store_config\noverwriting caller keys]
    E --> F{For each key in\napi_base / aws_sts_endpoint /\naws_web_identity_token}
    F --> G{Key in vector_store_config\nAND key NOT in credential_values?}
    G -- Yes --> H[Delete key\nremoves caller-supplied\nendpoint / identity value]
    G -- No --> I[Keep value\nstored credential owns it]
    H --> J[Resolved vector_store_config\nfully controlled by credential]
    I --> J
Loading

Reviews (2): Last reviewed commit: "style: black formatting" | Re-trigger Greptile

Comment on lines +4754 to +4798
"input_cost_per_token": 6e-05,
"input_cost_per_token_above_272k_tokens": 0.00012,
"litellm_provider": "azure",
"max_input_tokens": 1050000,
"max_output_tokens": 128000,
"max_tokens": 128000,
"mode": "responses",
"output_cost_per_token": 0.00036,
"output_cost_per_token_above_272k_tokens": 0.00054,
"supported_endpoints": [
"/v1/batch",
"/v1/responses"
],
"supported_modalities": [
"text",
"image"
],
"supported_output_modalities": [
"text"
],
"supports_function_calling": true,
"supports_native_streaming": true,
"supports_parallel_function_calling": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": false,
"supports_system_messages": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_web_search": true,
"supports_none_reasoning_effort": false,
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false,
"supports_low_reasoning_effort": false
},
"azure/gpt-5.5-pro-2026-04-23": {
"cache_read_input_token_cost": 6e-06,
"cache_read_input_token_cost_above_272k_tokens": 1.2e-05,
"input_cost_per_token": 6e-05,
"input_cost_per_token_above_272k_tokens": 0.00012,
"litellm_provider": "azure",
"max_input_tokens": 1050000,
"max_output_tokens": 128000,
"max_tokens": 128000,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Dated variants missing reasoning-effort flags

azure/gpt-5.5-2026-04-23 and azure/gpt-5.5-pro-2026-04-23 omit all supports_*_reasoning_effort flags that their base counterparts define. Any caller querying these dated model keys via get_model_info will get None for those capabilities instead of the correct values, potentially causing incorrect request building (e.g., no guard against unsupported effort levels).

azure/gpt-5.5-2026-04-23 should include:

"supports_none_reasoning_effort": true,
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false

azure/gpt-5.5-pro-2026-04-23 should include:

"supports_none_reasoning_effort": false,
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false,
"supports_low_reasoning_effort": false

@codecov

codecov Bot commented Apr 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/rag/ingestion/base_ingestion.py 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@yuneng-berri
yuneng-berri merged commit b021d5c into litellm_internal_staging Apr 25, 2026
115 of 116 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_rag_aws_endpoint_cleanup branch April 25, 2026 22:13
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…t_cleanup

[Fix] broaden RAG ingestion credential cleanup to AWS endpoint/identity fields
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.

4 participants