Skip to content

fix(proxy): extend banned-params + admin-clear lists (VERIA-493) - #31742

Merged
yucheng-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_veria_493_nvidia_riva_nvcf
Jun 30, 2026
Merged

fix(proxy): extend banned-params + admin-clear lists (VERIA-493)#31742
yucheng-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_veria_493_nvidia_riva_nvcf

Conversation

@yucheng-berri

@yucheng-berri yucheng-berri commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Resolves VERIA-493

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

Extends the proxy's existing banned-request-body list and admin-config clearing list, matching how analogous provider fields are already handled. Verified against a live local proxy

Type

🐛 Bug Fix

Changes

Two new entries in each of the two existing lists, next to the existing provider-specific entries. Regression tests in the existing mapped test file under tests/test_litellm/proxy/auth/. Greptile 5/5

@yucheng-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@codspeed-hq

codspeed-hq Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 23.24%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
✅ 28 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
test_completion_with_tools 4.2 ms 3.2 ms +31.39%
test_completion_simple_message 4.7 ms 4 ms +15.59%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing litellm_veria_493_nvidia_riva_nvcf (019afa8) with litellm_internal_staging (a0b26d2)

Open in CodSpeed

@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds two NVIDIA Riva-specific fields (nvcf_function_id and use_ssl) to the proxy's banned-request-body list and to the admin-config-clearing list for BYOK api_base overrides, matching how analogous provider fields like the OCI signing params are already handled.

  • auth_utils.py: two new entries in _BANNED_REQUEST_BODY_PARAMS block client-supplied values at the proxy boundary; both existing admin escape hatches (proxy-wide flag and per-deployment configurable_clientside_auth_params) remain functional.
  • clientside_credential_handler.py: the same fields are added to kwargs_only_fields so admin-pinned values are stripped before forwarding to a caller-redirected upstream.
  • Tests cover root-level rejection, api_key co-presence regression, both opt-in paths (including a monkeypatched per-deployment path), nested-container smuggling, and clearing on api_base override.

Confidence Score: 5/5

The change is additive and consistent with the existing provider-field pattern; both admin opt-in escape hatches are preserved and well-tested.

Two fields are appended to two existing lists using the same pattern as the OCI, Bedrock, and SageMaker entries already there. All new tests are mock-only and cover both changed files including the per-deployment opt-in path. No existing tests are weakened.

No files require special attention.

Important Files Changed

Filename Overview
litellm/proxy/auth/auth_utils.py Adds nvcf_function_id and use_ssl to _BANNED_REQUEST_BODY_PARAMS, consistent with the existing provider-specific endpoint fields in the same list
litellm/router_utils/clientside_credential_handler.py Adds the same two fields to kwargs_only_fields so admin-pinned values are cleared when a caller redirects api_base, parallel to the existing OCI entries
tests/test_litellm/proxy/auth/test_auth_utils.py Adds two new test classes covering root-level rejection, api_key co-presence, proxy-wide opt-in, per-deployment opt-in (monkeypatched), nested smuggling, and api_base-override clearing for both new fields; all tests are mock-only

Reviews (6): Last reviewed commit: "fix(proxy): extend banned-params + admin..." | Re-trigger Greptile

Comment thread tests/test_litellm/proxy/auth/test_auth_utils.py Outdated
Comment thread tests/test_litellm/proxy/auth/test_auth_utils.py
@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds nvcf_function_id to two enforcement lists: _BANNED_REQUEST_BODY_PARAMS in auth_utils.py (blocking client-supplied values at the proxy boundary) and _admin_config_fields_to_clear_on_base_override() in clientside_credential_handler.py (dropping the admin-pinned value when a caller redirects api_base). The change mirrors the existing pattern used for aws_bedrock_project_id and the OCI provider fields, with no modifications to the enforcement logic itself.

  • litellm/proxy/auth/auth_utils.py: nvcf_function_id appended to _BANNED_REQUEST_BODY_PARAMS with a descriptive inline comment; both admin opt-in paths (allow_client_side_credentials and configurable_clientside_auth_params) remain available.
  • litellm/router_utils/clientside_credential_handler.py: nvcf_function_id added to the kwargs_only_fields list so it is cleared alongside OCI fields when api_base is caller-redirected.
  • Tests: Four new tests cover root-level rejection, rejection when api_key is co-present, proxy-wide opt-in, and clearing on base override; the per-deployment configurable_clientside_auth_params opt-in path is not tested for this field (consistent with the existing aws_bedrock_project_id suite).

Confidence Score: 4/5

Safe to merge; the changes are additive and narrowly scoped to two enforcement lists with no modifications to surrounding logic.

Both changes correctly follow the established pattern for banned params and admin-config clearing. The only gap is the absence of a test for the per-deployment configurable_clientside_auth_params opt-in path — consistent with the existing aws_bedrock_project_id test class but still an untested branch given that the 401 error message documents it as a valid opt-in.

The test file would benefit from a per-deployment opt-in test to match what the error message documents; no production files require special attention.

Important Files Changed

Filename Overview
litellm/proxy/auth/auth_utils.py Adds nvcf_function_id to _BANNED_REQUEST_BODY_PARAMS; follows the same pattern as aws_bedrock_project_id and other provider-specific endpoint fields. No logic changes to the enforcement code itself.
litellm/router_utils/clientside_credential_handler.py Adds nvcf_function_id to the kwargs_only_fields list in _admin_config_fields_to_clear_on_base_override(), consistent with the OCI field entries immediately above it. Correctly dropped when a caller redirects api_base.
tests/test_litellm/proxy/auth/test_auth_utils.py Adds four new tests covering root-level rejection, rejection when api_key is co-present, proxy-wide opt-in, and clearing on base override. Missing a test for the per-deployment configurable_clientside_auth_params opt-in path, which the error message documents as a valid opt-in.

Reviews (1): Last reviewed commit: "fix(proxy): block client-supplied nvcf_f..." | Re-trigger Greptile

Comment thread tests/test_litellm/proxy/auth/test_auth_utils.py
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yucheng-berri
yucheng-berri force-pushed the litellm_veria_493_nvidia_riva_nvcf branch from b9d01a6 to 83a94ab Compare June 30, 2026 19:09
@yucheng-berri

yucheng-berri commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Addressed manager-review feedback. @greptileai please re-review the new head.

@yucheng-berri

yucheng-berri commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Addressed Greptile coverage feedback as a test-only follow-up commit. @greptileai please take another pass.

@yucheng-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 88a8e63. Configure here.

@yucheng-berri

yucheng-berri commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Addressed Greptile feedback on test coverage and docstring terseness. @greptileai please re-review.

@yucheng-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 29e55ae. Configure here.

@yucheng-berri

yucheng-berri commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Final CI: green. One known-flaky live-provider job at the time of comment, resolved on re-run; this PR does not touch that code path.

@mateo-berri mateo-berri left a comment

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.

LGTM; thanks!

non-blocking nit: is Greptile's docstring nit here legit?:

the single non-critical note is a style-level docstring cleanup in tests/test_litellm/proxy/auth/test_auth_utils.py

…(VERIA-493)

Two NVIDIA-Riva-specific fields consumed by the audio-transcription
handler via the provider's `optional_params` passthrough were not
covered by the proxy's existing banned-request-body list or the
admin-config clearing list applied on `api_base` BYOK override:

* `nvcf_function_id`
* `use_ssl`

Add both to `_BANNED_REQUEST_BODY_PARAMS` in
`litellm/proxy/auth/auth_utils.py` and to the kwargs-only list in
`_admin_config_fields_to_clear_on_base_override()` in
`litellm/router_utils/clientside_credential_handler.py`, next to the
analogous provider-specific entries already there (`aws_bedrock_*`,
OCI provider fields, etc.). Same admin opt-ins as every other entry
on those lists (`general_settings.allow_client_side_credentials`
proxy-wide, or `configurable_clientside_auth_params` per deployment).

Regression tests in `tests/test_litellm/proxy/auth/test_auth_utils.py`
cover root-level rejection, the historical `api_key` bypass, both
admin opt-in paths (proxy-wide and per-deployment), nested-container
smuggling via the existing recursive walk, and clearing on
`api_base` override. Mutation check verified.

Resolves VERIA-493
@yucheng-berri
yucheng-berri force-pushed the litellm_veria_493_nvidia_riva_nvcf branch from 29e55ae to 019afa8 Compare June 30, 2026 22:14
@yucheng-berri

yucheng-berri commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Force-pushed: squashed into a single commit with a redacted message and trimmed inline comments. Same diff content.

@yucheng-berri yucheng-berri changed the title fix(proxy): block client-supplied nvcf_function_id (VERIA-493) fix(proxy): extend banned-params + admin-clear lists (VERIA-493) Jun 30, 2026
@yucheng-berri
yucheng-berri merged commit 41f9d8d into litellm_internal_staging Jun 30, 2026
126 checks passed
@yucheng-berri
yucheng-berri deleted the litellm_veria_493_nvidia_riva_nvcf branch June 30, 2026 22:30
duanhongyi pushed a commit to duanhongyi/litellm that referenced this pull request Jul 2, 2026
…(VERIA-493) (BerriAI#31742)

Two NVIDIA-Riva-specific fields consumed by the audio-transcription
handler via the provider's `optional_params` passthrough were not
covered by the proxy's existing banned-request-body list or the
admin-config clearing list applied on `api_base` BYOK override:

* `nvcf_function_id`
* `use_ssl`

Add both to `_BANNED_REQUEST_BODY_PARAMS` in
`litellm/proxy/auth/auth_utils.py` and to the kwargs-only list in
`_admin_config_fields_to_clear_on_base_override()` in
`litellm/router_utils/clientside_credential_handler.py`, next to the
analogous provider-specific entries already there (`aws_bedrock_*`,
OCI provider fields, etc.). Same admin opt-ins as every other entry
on those lists (`general_settings.allow_client_side_credentials`
proxy-wide, or `configurable_clientside_auth_params` per deployment).

Regression tests in `tests/test_litellm/proxy/auth/test_auth_utils.py`
cover root-level rejection, the historical `api_key` bypass, both
admin opt-in paths (proxy-wide and per-deployment), nested-container
smuggling via the existing recursive walk, and clearing on
`api_base` override. Mutation check verified.

Resolves VERIA-493
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