Skip to content

fix(mcp): stop logging tool-call input in MCP client - #31393

Merged
ryan-crabbe-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_lit_3811_mcp_input_not_logged
Jun 27, 2026
Merged

fix(mcp): stop logging tool-call input in MCP client#31393
ryan-crabbe-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_lit_3811_mcp_input_not_logged

Conversation

@ryan-crabbe-berri

@ryan-crabbe-berri ryan-crabbe-berri commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

LIT-3811

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 unit tests on make test-unit
  • 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

CI (LiteLLM team)

  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Screenshots / Proof of Fix

The MCP client logged the tool input at INFO on every call, so the caller's arguments (the user query, model, instructions, etc.) showed up verbatim in the proxy logs and any downstream log aggregator. That is the line in the LIT-3811 screenshots

Proof against a live proxy running this branch's code, calling the public DeepWiki MCP server at production INFO level (no debug flags). Config used

mcp_servers:
  deepwiki:
    transport: "http"
    url: "https://mcp.deepwiki.com/mcp"
    allow_all_keys: true

Same real tool call in both runs, with a sentinel string in the question so it is easy to grep

curl -s http://localhost:4001/mcp-rest/tools/call \
  -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' \
  -d '{"server_id":"<deepwiki>","name":"ask_question","arguments":{"repoName":"BerriAI/litellm","question":"LIT3811SECRETPROBE what is litellm"}}'

Before the fix the INFO line carries the full arguments, and the input is grep-able in the logs

$ grep "MCP client calling tool" litellm.log
17:21:54 - LiteLLM:INFO: client.py:565 - MCP client calling tool 'ask_question' with arguments: {'repoName': 'BerriAI/litellm', 'question': 'LIT3811SECRETPROBE what is litellm'}

$ grep -c "LIT3811SECRETPROBE" litellm.log
1

After the fix the same line logs only the tool name, and the input no longer appears anywhere in the logs

$ grep "MCP client calling tool" litellm.log
17:22:34 - LiteLLM:INFO: client.py:565 - MCP client calling tool 'ask_question'

$ grep -c "LIT3811SECRETPROBE" litellm.log
0

Type

Bug Fix

Changes

The MCP client emitted the full tool arguments at INFO in call_tool, and the same for prompt arguments in get_prompt, so caller input flowed into the application logs on every call. Both lines now log only the tool or prompt name and drop the arguments. The name is a stable identifier and is not sensitive; the input is what must not be logged

Files: litellm/experimental_mcp_client/client.py (the two INFO log lines), plus regression tests in tests/test_litellm/experimental_mcp_client/test_mcp_client.py that drive call_tool / get_prompt with a sensitive arguments value and assert it never reaches the logger (they fail on the pre-fix code and pass on the fix)

@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes caller-provided MCP arguments from client logs. The main changes are:

  • Drops tool-call arguments from the call_tool INFO log
  • Drops prompt arguments from the get_prompt INFO log
  • Adds tests that verify sensitive argument values are not emitted while names still appear

Confidence Score: 5/5

The change is narrowly scoped to redacting sensitive MCP argument values from INFO logs while preserving useful operation names.

The implementation matches the stated privacy goal and includes regression coverage for both tool and prompt argument logging paths.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the verbose logging verification for the MCP client tool call, capturing before and after logs that show the input arguments (hello-from-LIT-3811-call-tool and gpt-5-mini) were present before and removed from the verbose logger after.
  • Compared the mcp-get-prompt-logging artifacts, confirming that the before log included the argument hello-from-LIT-3811-get-prompt and the after log omits it, while the get_prompt INFO log still shows my_prompt and the session call data remains visible.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "fix(mcp): stop logging tool-call input i..." | Re-trigger Greptile

Comment thread litellm/litellm_core_utils/litellm_logging.py Outdated
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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
@ryan-crabbe-berri
ryan-crabbe-berri force-pushed the litellm_lit_3811_mcp_input_not_logged branch from c7657bc to 89a7832 Compare June 26, 2026 18:55
@ryan-crabbe-berri ryan-crabbe-berri changed the title fix(mcp): redact tool-call input from logs fix(mcp): stop logging tool-call input in MCP client Jun 26, 2026
@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai re review

@ryan-crabbe-berri
ryan-crabbe-berri merged commit 7acc015 into litellm_internal_staging Jun 27, 2026
124 checks passed
@ryan-crabbe-berri
ryan-crabbe-berri deleted the litellm_lit_3811_mcp_input_not_logged branch June 27, 2026 00:42
yuneng-berri added a commit that referenced this pull request Jul 3, 2026
…-log-31393

chore(release): backport #31393 to stable/1.89.x and cut 1.89.6
mateo-berri pushed a commit that referenced this pull request Jul 3, 2026
Backport of #31393 to stable/1.90.x.
Cherry-picked from 7acc015 (litellm_internal_staging).

The test-file conflict hunk also carried the staging-only TestMCPClientResolvedAuth
class from an unrelated commit that never reached this line; it was dropped and only
the additions belonging to #31393 were kept.
yuneng-berri added a commit that referenced this pull request Jul 3, 2026
chore(release): backport #31923, #31929, #31393 to stable/1.90.x and cut 1.90.3
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Jul 4, 2026
….3) (#1400)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/berriai/litellm](https://images.chainguard.dev/directory/image/wolfi-base/overview) ([source](https://github.com/BerriAI/litellm)) | patch | `v1.90.2` → `v1.90.3` |

---

### Release Notes

<details>
<summary>BerriAI/litellm (ghcr.io/berriai/litellm)</summary>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.3...v1.90.3)

##### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

##### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.2...v1.90.3)

##### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

##### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/1400
blake-hamm added a commit to blake-hamm/bhamm-lab that referenced this pull request Jul 4, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ghcr.io/berriai/litellm](https://images.chainguard.dev/directory/image/wolfi-base/overview) ([source](https://github.com/BerriAI/litellm)) | final | patch | `v1.90.2` → `v1.90.3` |

---

### Release Notes

<details>
<summary>BerriAI/litellm (ghcr.io/berriai/litellm)</summary>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.3...v1.90.3)

##### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

##### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.2...v1.90.3)

##### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

##### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDkuNSIsInVwZGF0ZWRJblZlciI6IjQzLjI0OS41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: Renovate Bot <renovate@bhamm-lab.com>
Reviewed-on: https://codeberg.org/blake-hamm/bhamm-lab/pulls/258
blake-hamm added a commit to blake-hamm/bhamm-lab that referenced this pull request Jul 4, 2026
…to v1.90.3 (#257)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [https://github.com/BerriAI/litellm.git](https://github.com/BerriAI/litellm) | patch | `v1.90.0` → `v1.90.3` |

---

### Release Notes

<details>
<summary>BerriAI/litellm (https://github.com/BerriAI/litellm.git)</summary>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.2...v1.90.3)

#### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

#### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

### [`v1.90.2`](https://github.com/BerriAI/litellm/releases/tag/v1.90.2)

[Compare Source](BerriAI/litellm@v1.90.1...v1.90.2)

#### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.2
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.2/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.2
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

#### What's Changed

- chore(release): backport [#&#8203;31519](BerriAI/litellm#31519), [#&#8203;31733](BerriAI/litellm#31733) to stable/1.90.x and cut 1.90.2 by [@&#8203;yuneng-berri](https://github.com/yuneng-berri) in [#&#8203;31782](BerriAI/litellm#31782)

**Full Changelog**: <BerriAI/litellm@v1.90.1...v1.90.2>

### [`v1.90.1`](https://github.com/BerriAI/litellm/releases/tag/v1.90.1)

[Compare Source](BerriAI/litellm@v1.90.0-rc.1...v1.90.1)

#### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.1
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.1/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.1
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

#### What's Changed

- chore(release): backport [#&#8203;31036](BerriAI/litellm#31036), [#&#8203;31342](BerriAI/litellm#31342), [#&#8203;31653](BerriAI/litellm#31653) to stable/1.90.x and cut 1.90.1 (litellm-enterprise 0.1.43.post1) by [@&#8203;yuneng-berri](https://github.com/yuneng-berri) in [#&#8203;31667](BerriAI/litellm#31667)

**Full Changelog**: <BerriAI/litellm@v1.90.0...v1.90.1>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDkuNSIsInVwZGF0ZWRJblZlciI6IjQzLjI0OS41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: Renovate Bot <renovate@bhamm-lab.com>
Reviewed-on: https://codeberg.org/blake-hamm/bhamm-lab/pulls/257
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