#30728 [Bug]: Presidio PII guardrail fails open on analyzer error and skips /v1/responses input and streaming bytes
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…