From 9173c1abcee0caa985b14a736008663847220d34 Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Tue, 10 Mar 2026 17:08:56 -0700 Subject: [PATCH] fix: use exact match for LITELLM_REDACT_SECRETS env var, remove unused test param --- litellm/_logging.py | 2 +- tests/test_litellm/test_secret_redaction.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/_logging.py b/litellm/_logging.py index cf402987442..d5865777661 100644 --- a/litellm/_logging.py +++ b/litellm/_logging.py @@ -17,7 +17,7 @@ if set_verbose is True: "`litellm.set_verbose` is deprecated. Please set `os.environ['LITELLM_LOG'] = 'DEBUG'` for debug logs." ) -_ENABLE_SECRET_REDACTION = bool(os.getenv("LITELLM_REDACT_SECRETS", False)) +_ENABLE_SECRET_REDACTION = os.getenv("LITELLM_REDACT_SECRETS") == "TRUE" _REDACTED = "REDACTED" diff --git a/tests/test_litellm/test_secret_redaction.py b/tests/test_litellm/test_secret_redaction.py index c5136874652..6e634248651 100644 --- a/tests/test_litellm/test_secret_redaction.py +++ b/tests/test_litellm/test_secret_redaction.py @@ -96,7 +96,7 @@ def test_filter_redacts_non_string_args(): assert "REDACTED" in output -def test_disable_redaction_passes_secrets_through(_enable_redaction): +def test_disable_redaction_passes_secrets_through(): """When _ENABLE_SECRET_REDACTION is False, secrets pass through.""" with patch("litellm._logging._ENABLE_SECRET_REDACTION", False): record = logging.LogRecord(