chore(release): backport #31393 to stable/1.89.x and cut 1.89.6 - #32001
Conversation
The MCP client logged the full tool arguments (and prompt arguments) at INFO on every call, so caller input such as user queries, model names, and instructions landed in the proxy application logs and any downstream log aggregator Log only the tool or prompt name and drop the arguments from these INFO lines (cherry picked from commit 7acc015)
Greptile SummaryThis backport cherry-picks the log-redaction fix from
Confidence Score: 5/5Safe to merge — the change is a two-line log redaction with no effect on routing, tool execution, or error handling. The product-code diff is minimal: two f-strings in INFO log calls lose their No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/experimental_mcp_client/client.py | Removes arguments from two INFO log calls in call_tool and get_prompt, fixing sensitive data leakage into proxy logs; no logic change. |
| tests/test_litellm/experimental_mcp_client/test_mcp_client.py | Adds two new mock-only tests (test_call_tool_does_not_log_arguments, test_get_prompt_does_not_log_arguments) and helper _all_logged_messages; no real network calls, comprehensive log-level coverage. |
| pyproject.toml | Version bumped from 1.89.5 to 1.89.6 in both [project] and [tool.commitizen] sections. |
Reviews (1): Last reviewed commit: "chore(ci): sync GitHub Actions with defa..." | Re-trigger Greptile
Relevant issues
Backports #31393 onto stable/1.89.x and cuts 1.89.6. The MCP client logged the full caller
argumentsat INFO on every call incall_toolandget_prompt, so tool-call input such as user queries, model names, and instructions landed in the proxy application logs and any downstream log aggregator. Both lines now log only the tool or prompt name and drop the arguments; the name is a stable identifier that is not sensitive, the input is what must not be loggedLinear ticket
LIT-3811
What is included
.github/workflows/and.github/actions/with the default branch socreate-releasecan run, and carries no product codeAdaptation notes
The production change to
litellm/experimental_mcp_client/client.pyapplied verbatim (patch-id identical). The mapped test filetests/test_litellm/experimental_mcp_client/test_mcp_client.pywas ADAPTED: on staging the three log-redaction additions (_all_logged_messages,test_call_tool_does_not_log_arguments,test_get_prompt_does_not_log_arguments) were appended after aTestMCPClientResolvedAuthclass that does not exist on 1.89.x (itsresolved_authMCPClient parameter predates this line). That neighbor class was excluded and the three tests appended after the line's last existing test class instead. The three added test functions are byte-identical to the source PR; a name-equality assert confirmed no staging-only neighbor tests were absorbedPre-Submission checklist
@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewKnown noise on this line
The mapped test file baseline on stable/1.89.x tip was 23 passed, 0 failures, so there is no pre-existing red to discount here. One pre-existing ruff
F401(import sslunused, line 3 of the test file) exists on the line independent of this pickScreenshots / Proof of Fix
Live proxy running this branch's code, calling the wikipedia MCP server's
fetchtool at production INFO level. Same real tool call in both runs with a sentinel string in the arguments so it is grep-ableBefore the fix (baseline on the line tip) the INFO line carries the full arguments and the input is grep-able
After the pick the same line logs only the tool name, and the input no longer appears anywhere in the logs, while the tool call still returns content (routing unaffected)
Targeted tests as a delta: baseline 23 passed on the line tip; with the pick applied 25 passed (the two new redaction tests), zero new failures. A behavioral gauntlet run (universal, standard) sealed SURVIVED across all three sub-claims (identifiers resolve, the pick's own tests deliver the redaction, no existing caller depends on the removed log substring), with zero verified regression findings
Type
🐛 Bug Fix
Changes
litellm/experimental_mcp_client/client.py: the two INFO log lines incall_toolandget_promptnow log only the tool or prompt name and drop thearguments. Plus the mapped regression tests that drivecall_tool/get_promptwith a sensitiveargumentsvalue and assert it never reaches the logger (they fail on the pre-fix code and pass on the fix), the 1.89.6 version bump and lock refresh, and the GitHub Actions default-branch sync