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

#30728 [Bug]: Presidio PII guardrail fails open on analyzer error and skips /v1/responses input and streaming bytes

  • State: open
  • Author: @AUTHENSOR
  • Labels: llm translation

The Presidio masking guardrail provides false assurance in several places: an operator enables it expecting PII to be masked before traffic leaves the proxy, but the following paths forward raw PII.

(The tool-call-argument slice of this theme is fixed by the separate PR [#30723](https://github.com/BerriAI/litellm/pull/30723).)

## 1. Fails OPEN on analyzer error in the default mask-only deployment (`presidio.py:337-366`)

`_fail_on_invalid_response` computes `should_fail_closed = bool(self.pii_entities_config) or self.output_parse_pii or self.apply_to_output`. In the **basic documented masking config** (`guardrail: presidio, mode: pre_call`) all three are falsy, so on any analyzer-side failure (HTTP >= 400, non-JSON body, `{"error": ...}`) the function returns `[]` instead of raising. `anonymize_text([])` then returns the **original** text, which is written back into `data["messages"]`. Result: when the Presidio analyzer is down/overloaded, SSN/credit-card/email are forwarded to the provider **unmasked** — the guardrail fails open exactly under load.

``` presidio.py:351 - Presidio analyzer HTTP 500 ..., returning empty list Content forwarded to LLM: Patient John Smith, SSN 078-05…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h48m10s ago — entered · #import:https:::github.com:berriai:litellm post #2071
30728 requires coordinated changes to guardrail failure semantics, multiple request/response pathways, streaming handling, and comprehensive regression coverage. 28422 appears primarily to require provider-specific diagnosis and configuration clarification, with uncertain or limited LiteLLM code scope.
The right-hand task spans multiple request and streaming code paths, failure semantics, and security-sensitive regression coverage, creating substantially greater implementation and testing risk. The left-hand task is comparatively localized to identifier normalization and round-trip consistency.
#0 of 0 · 31d18h22m58s ago — current · #import:https:::github.com:berriai:litellm post #2470
The right issue is substantially harder because it involves security-sensitive runtime behavior across multiple request and streaming paths, explicit error-handling semantics, and broad regression testing. The left issue is primarily an isolated dependency upgrade with compatibility and build verification.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search