{"record":{"id":"ef7c32d963c9d7b2","repo":"BerriAI/litellm","slug":"trying-to-use-secret-detectionmissing-litellm-ente","errorCode":null,"errorMessage":"Trying to use Secret DetectionMissing litellm-enterprise package. Please install it to use this feature. Run `pip install litellm-enterprise`","messagePattern":"Trying to use Secret DetectionMissing litellm-enterprise package\\. Please install it to use this feature\\. Run `pip install litellm-enterprise`","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/common_utils/callback_utils.py","lineNumber":206,"sourceCode":"                        _ENTERPRISE_LlamaGuard,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"MissingTrying to use Llama Guard\" + CommonProxyErrors.missing_enterprise_package.value\n                    )\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use Llama Guard\" + CommonProxyErrors.not_premium_user.value)\n\n                llama_guard_object = _ENTERPRISE_LlamaGuard()\n                imported_list.append(llama_guard_object)\n            elif isinstance(callback, str) and callback == \"hide_secrets\":\n                try:\n                    from litellm_enterprise.enterprise_callbacks.secret_detection import (\n                        _ENTERPRISE_SecretDetection,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"Trying to use Secret Detection\" + CommonProxyErrors.missing_enterprise_package.value\n                    )\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use secret hiding\" + CommonProxyErrors.not_premium_user.value)\n\n                _secret_detection_object = _ENTERPRISE_SecretDetection()\n                imported_list.append(_secret_detection_object)\n            elif isinstance(callback, str) and callback == \"openai_moderations\":\n                try:\n                    from enterprise.enterprise_hooks.openai_moderation import (\n                        _ENTERPRISE_OpenAI_Moderation,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"Trying to use OpenAI Moderations Check,\"\n                        + CommonProxyErrors.missing_enterprise_package_docker.value\n                    )","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_utils/callback_utils.py#L188-L224","documentation":"Raised at proxy startup when callbacks includes 'hide_secrets' (secret detection/redaction) but importing litellm_enterprise.enterprise_callbacks.secret_detection._ENTERPRISE_SecretDetection raises ImportError. Like Llama Guard, secret hiding is an enterprise feature packaged in the separate litellm-enterprise distribution; the open-source litellm install cannot provide it. The message text runs together ('Trying to use Secret DetectionMissing litellm-enterprise package...') because two strings are concatenated without a separator.","triggerScenarios":"Enabling callbacks: ['hide_secrets'] in litellm_settings on an environment where pip show litellm-enterprise fails; CI images built from the plain litellm wheel; deploys where the enterprise package was dropped from requirements.","commonSituations":"Adopting the secret-masking guardrail after reading enterprise docs; environment drift between prod (enterprise installed) and staging (not); docker images not rebuilt after adding the callback.","solutions":["pip install litellm-enterprise in the environment that runs the proxy.","Rebuild the docker image so the new dependency is baked in.","Remove 'hide_secrets' from callbacks if the feature is not licensed/needed.","Confirm the import works: python -c \"from litellm_enterprise.enterprise_callbacks.secret_detection import _ENTERPRISE_SecretDetection\"."],"exampleFix":"# before\n# requirements: litellm only, config has callbacks: [\"hide_secrets\"]\n\n# after\n# requirements add:\nlitellm-enterprise","handlingStrategy":"fallback","validationCode":"import importlib.util\n\nif 'hide_secrets' in callbacks and importlib.util.find_spec('litellm_enterprise') is None:\n    callbacks.remove('hide_secrets')  # or fail loudly, per your policy\n    logger.warning('hide_secrets disabled: litellm-enterprise not installed')","typeGuard":null,"tryCatchPattern":"try:\n    from litellm_enterprise.enterprise_callbacks.secret_detection import _ENTERPRISE_SecretDetection  # noqa\n    HIDE_SECRETS_OK = True\nexcept ImportError:\n    HIDE_SECRETS_OK = False\n\ncallbacks = ['hide_secrets'] if HIDE_SECRETS_OK else []","preventionTips":["Version requirements.txt and callback config in the same PR so they cannot drift.","Add a container healthcheck that imports each enabled enterprise hook at boot.","Keep a tested OSS fallback config for local development."],"tags":["litellm","proxy","callbacks","hide-secrets","enterprise","importerror"],"backgroundTag":"missing-optional-dependency","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}