From 102bd948283f0f641bba40ac280fa97c7d7c3871 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Wed, 4 Nov 2026 09:28:21 -0800 Subject: [PATCH] fix(logging): redact Bedrock streamed reasoningContent and file annotations in provider_specific_fields --- litellm/litellm_core_utils/redact_messages.py | 2 ++ tests/unit/litellm_core_utils/test_redact_messages.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/litellm/litellm_core_utils/redact_messages.py b/litellm/litellm_core_utils/redact_messages.py index 996ffed03f4..ac5c0720eff 100644 --- a/litellm/litellm_core_utils/redact_messages.py +++ b/litellm/litellm_core_utils/redact_messages.py @@ -279,6 +279,8 @@ def _redacted_provider_specific_fields(fields: Mapping[str, object]) -> Mapping[ for key in ( "thinking_blocks", "reasoningContentBlocks", + "reasoningContent", + "annotations", "citations", "citation", "citationsContent", diff --git a/tests/unit/litellm_core_utils/test_redact_messages.py b/tests/unit/litellm_core_utils/test_redact_messages.py index 361a376d5fc..491ea5315ff 100644 --- a/tests/unit/litellm_core_utils/test_redact_messages.py +++ b/tests/unit/litellm_core_utils/test_redact_messages.py @@ -59,6 +59,8 @@ def _provider_fields() -> dict[str, object]: "reasoning_details": [{"type": "reasoning.text", "text": SECRET, "index": 0, "format": "unknown"}], "thinking_blocks": [{"type": "thinking", "thinking": SECRET}], "reasoningContentBlocks": [{"reasoningText": {"text": SECRET}}], + "reasoningContent": {"reasoningText": {"text": SECRET}}, + "annotations": [{"type": "file", "file": {"name": "notes.pdf", "content": [{"type": "text", "text": SECRET}]}}], "citations": [{"cited_text": SECRET}], "citationsContent": [{"citations": [{"location": {}}], "content": [{"text": SECRET}]}], "citation": {"type": "char_location", "cited_text": SECRET},