Repository navigation
test(params): fence proxy metadata keys out of provider bodies - #43368
Open
shrey-berri wants to merge 1 commit into
Open
shrey-berri wants to merge 1 commit into
shrey-berri wants to merge 1 commit into
Conversation
The fence test now sends metadata={"user_api_key_hash": "h"} and asserts the key reaches none of the six providers. AGENTS.md now states the _litellm_* naming rule for internal kwargs and that internal state never goes into metadata
Contributor
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
The last two items of the internal-params depth item, after #43221 and #43222
Problem this solves:
metadata_litellm_*naming rule was not written down anywhereHow it solves it:
metadata={"user_api_key_hash": "h"}to all 6 providersuser_api_key_hashnever appears in any request body_litellm_*rule and bans internal state inmetadataLinear ticket
Resolves LIT-8316
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Test and docs only, so nothing a user sees changes. The check that matters is whether the new assertion catches a real leak. Turning on
litellm.enable_preview_featuresmakes LiteLLM forwardmetadatato OpenAI, which leaksuser_api_key_hashinto the request bodylitellm.enable_preview_features = True'user_api_key_hash' not in keysType
✅ Test
📖 Documentation
Caveats (if any)
Medium
enable_preview_featureson and norequester_metadata, OpenAI receives every string inmetadataenable_preview_featuresoffFinal Attestation
Generated by Claude Code