{"record":{"id":"c24d7ffec31c9a79","repo":"BerriAI/litellm","slug":"trying-to-use-banned-keywordsthis-uses-the-enterpr","errorCode":null,"errorMessage":"Trying to use Banned KeywordsThis uses the enterprise folder - only available on the Docker image.","messagePattern":"Trying to use Banned KeywordsThis uses the enterprise folder - only available on the Docker image\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/common_utils/callback_utils.py","lineNumber":300,"sourceCode":"                        _ENTERPRISE_BlockedUserList,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"Trying to use Blocked User List\" + CommonProxyErrors.missing_enterprise_package_docker.value\n                    )\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use ENTERPRISE BlockedUser\" + CommonProxyErrors.not_premium_user.value)\n\n                blocked_user_list = _ENTERPRISE_BlockedUserList(prisma_client=prisma_client)\n                imported_list.append(blocked_user_list)\n            elif isinstance(callback, str) and callback == \"banned_keywords\":\n                try:\n                    from enterprise.enterprise_hooks.banned_keywords import (\n                        _ENTERPRISE_BannedKeywords,\n                    )\n                except ImportError:\n                    raise Exception(\n                        \"Trying to use Banned Keywords\" + CommonProxyErrors.missing_enterprise_package_docker.value\n                    )\n\n                if premium_user is not True:\n                    raise Exception(\"Trying to use ENTERPRISE BannedKeyword\" + CommonProxyErrors.not_premium_user.value)\n\n                banned_keywords_obj = _ENTERPRISE_BannedKeywords()\n                imported_list.append(banned_keywords_obj)\n            elif isinstance(callback, str) and callback == \"detect_prompt_injection\":\n                from litellm.proxy.hooks.prompt_injection_detection import (\n                    _OPTIONAL_PromptInjectionDetection,\n                )\n\n                prompt_injection_params = None\n                if \"prompt_injection_params\" in litellm_settings:\n                    prompt_injection_params_in_config = litellm_settings[\"prompt_injection_params\"]\n                    prompt_injection_params = LiteLLMPromptInjectionParams(**prompt_injection_params_in_config)\n","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_utils/callback_utils.py#L282-L318","documentation":"The callback 'banned_keywords' imports enterprise.enterprise_hooks.banned_keywords from the 'enterprise' folder. That folder exists only in the LiteLLM enterprise Docker image. On a pip install or source checkout the import fails, and the loader converts the ImportError into this Exception during config load.","triggerScenarios":"Start the proxy with litellm_settings.callbacks: ['banned_keywords'] outside the enterprise Docker image (pip install litellm, local source run, custom image without the enterprise folder).","commonSituations":"Trying keyword blocking after reading the enterprise docs, without noticing it is image-gated. Moving a working config from the enterprise image to a bare-metal or pip-based deployment.","solutions":["Remove 'banned_keywords' from litellm_settings.callbacks.","Or switch the deployment to the LiteLLM enterprise Docker image.","Remember that a valid LITELLM_LICENSE is still required afterwards (error 2886)."],"exampleFix":"# before\nlitellm_settings:\n  callbacks: [\"banned_keywords\"]\n\n# after\nlitellm_settings:\n  callbacks: []\n# or: run litellm enterprise docker image + LITELLM_LICENSE","handlingStrategy":"validation","validationCode":"import os\n\ndef banned_keywords_ok() -> bool:\n    return os.path.isdir(\"enterprise\") and os.path.exists(\"enterprise/enterprise_hooks/banned_keywords.py\")\n\nif \"banned_keywords\" in callbacks and not banned_keywords_ok():\n    raise SystemExit(\"banned_keywords needs the enterprise docker image\")","typeGuard":null,"tryCatchPattern":"try:\n    start_proxy(cfg)\nexcept Exception as e:\n    if \"Banned Keywords\" in str(e) and \"Docker\" in str(e):\n        raise SystemExit(\"run enterprise image or remove banned_keywords\")\n    raise","preventionTips":["Track which callbacks in the config are image-gated versus pip-installable.","Build CI config validation inside the production image, not on a pip-only runner.","Prefer open-source guardrails for keyword blocking when no enterprise license is planned."],"tags":["litellm","enterprise","docker","import-error","config","banned-keywords"],"backgroundTag":"missing-optional-dependency","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}