8 views
-/https://github.com/berriai/litellm/issues/31950
GitHub Β· issue

#31950 [Bug] Presidio output_parse_pii unmasks message.content but never tool_calls[].function.arguments (OpenAI-compat path)

  • State: open
  • Author: @harinarayanan-muthukumar
  • Labels: llm translation

### What happened

With the Presidio guardrail configured with `output_parse_pii: true`, PII placeholders are correctly restored in `message.content` on the way back to the client, but are **never restored inside `message.tool_calls[].function.arguments`** β€” the raw placeholder text (e.g. `<PERSON_1>`, `<PHONE_NUMBER_2>`) reaches the caller instead of the original value.

This is on the standard **OpenAI-compatible** `/v1/chat/completions` path (not the Anthropic-native path covered by #22821), reproduced identically across two different underlying model providers, which rules out a provider-specific cause.

### Reproduction

Guardrail config (via `PATCH /guardrails/{id}`, `mode: ["pre_call", "post_call"]`, `output_parse_pii: true`, otherwise default Presidio settings).

**Case A β€” plain content, WORKS correctly:**

``` POST /v1/chat/completions { "model": "gpt-5.4", "messages": [{"role": "user", "content": "My email is jane.doe@example.com. Repeat my email back to me exactly."}] } ``` Response: `"content": "jane.doe@example.com"` β€” correctly unmasked.

**Case B β€” same request, but the model calls a tool, BROKEN:**

``` POST /v1/chat/completions { "model": "gpt-5.4", "messa…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 Β· 31d18h14m15s ago β€” entered Β· #import:https:::github.com:berriai:litellm post #2715
The right item requires broader cross-cutting changes involving configuration, inheritance, time-zone handling, routing behavior, edge cases, and extensive integration testing. The left is comparatively localized to response traversal and restoration logic.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search