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(