diff --git a/litellm/_logging.py b/litellm/_logging.py index 15c95996335..14cb10c9c8c 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 = os.getenv("LITELLM_REDACT_SECRETS", "").lower() == "true" +_ENABLE_SECRET_REDACTION = os.getenv("LITELLM_DISABLE_REDACT_SECRETS", "").lower() != "true" _REDACTED = "REDACTED" diff --git a/tests/test_litellm/test_secret_redaction.py b/tests/test_litellm/test_secret_redaction.py index 6321f452f66..d2c74afc3b4 100644 --- a/tests/test_litellm/test_secret_redaction.py +++ b/tests/test_litellm/test_secret_redaction.py @@ -17,7 +17,7 @@ SECRET = "sk-proj-abc123def456ghi789jklmnopqrst" @pytest.fixture(autouse=True) def _enable_redaction(): - """Enable secret redaction for all tests in this module.""" + """Ensure secret redaction is on (the default) for all tests in this module.""" with patch("litellm._logging._ENABLE_SECRET_REDACTION", True): yield @@ -133,7 +133,7 @@ def test_filter_redacts_extra_fields(): def test_disable_redaction_passes_secrets_through(): - """When _ENABLE_SECRET_REDACTION is False, secrets pass through.""" + """When LITELLM_DISABLE_REDACT_SECRETS=true, secrets pass through.""" with patch("litellm._logging._ENABLE_SECRET_REDACTION", False): record = logging.LogRecord( name="test",