mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-25 14:27:26 +00:00
Greptile P1: Aim's ``_anonymize_request`` and Lakera v2's mask-PII path both wrote redacted content only to ``data["messages"]``. The Responses API backend reads ``data["input"]``, so when a request arrived via ``/v1/responses`` with a plain string ``input`` the hook would update ``messages`` (which the backend ignores) and leave ``input`` carrying the original unredacted text. Net effect: anonymize/mask silently passed PII through to the LLM. Add ``apply_redacted_messages_back`` to ``_content_utils`` — it writes the redacted messages back to ``data["messages"]`` AND, when present, re-flattens the redacted content into ``data["input"]``. Aim and Lakera v2 now route their mask writeback through this helper. List ``input`` (multimodal) is still handled by the upstream block-on-multimodal guard. Adds unit tests for the helper and regression tests asserting ``data["input"]`` is redacted for both hooks on Responses-API string input. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/test_litellm
This folder can only run mock tests.