BerriAI/litellm · error · Exception
Trying to use ENTERPRISE BannedKeywordYou must be a LiteLLM
Error message
Trying to use ENTERPRISE BannedKeywordYou must be a LiteLLM Enterprise user to use this feature. If you have a license please set `LITELLM_LICENSE` in your env. Get a 7 day trial key here: https://www.litellm.ai/enterprise#trial. Pricing: https://www.litellm.ai/#pricing
What it means
The 'banned_keywords' callback loaded its enterprise module, but the license gate failed: premium_user is not True at config load time. The message combines 'Trying to use ENTERPRISE BannedKeyword' with the standard not_premium_user text that points to LITELLM_LICENSE and the trial link. Startup aborts at this raise.
Source
Thrown at litellm/proxy/common_utils/callback_utils.py:305
)
if premium_user is not True:
raise Exception("Trying to use ENTERPRISE BlockedUser" + CommonProxyErrors.not_premium_user.value)
blocked_user_list = _ENTERPRISE_BlockedUserList(prisma_client=prisma_client)
imported_list.append(blocked_user_list)
elif isinstance(callback, str) and callback == "banned_keywords":
try:
from enterprise.enterprise_hooks.banned_keywords import (
_ENTERPRISE_BannedKeywords,
)
except ImportError:
raise Exception(
"Trying to use Banned Keywords" + CommonProxyErrors.missing_enterprise_package_docker.value
)
if premium_user is not True:
raise Exception("Trying to use ENTERPRISE BannedKeyword" + CommonProxyErrors.not_premium_user.value)
banned_keywords_obj = _ENTERPRISE_BannedKeywords()
imported_list.append(banned_keywords_obj)
elif isinstance(callback, str) and callback == "detect_prompt_injection":
from litellm.proxy.hooks.prompt_injection_detection import (
_OPTIONAL_PromptInjectionDetection,
)
prompt_injection_params = None
if "prompt_injection_params" in litellm_settings:
prompt_injection_params_in_config = litellm_settings["prompt_injection_params"]
prompt_injection_params = LiteLLMPromptInjectionParams(**prompt_injection_params_in_config)
prompt_injection_detection_obj = _OPTIONAL_PromptInjectionDetection(
prompt_injection_params=prompt_injection_params,
)
imported_list.append(prompt_injection_detection_obj)
elif isinstance(callback, str) and callback == "batch_redis_requests":View on GitHub (pinned to 77b7c6c40c)
Solutions
- Export a valid LITELLM_LICENSE for the proxy process and restart.
- Or drop 'banned_keywords' from the callbacks list.
- In Kubernetes/compose, verify the env var is in the pod spec and not only in the local shell.
Example fix
# before (compose, no license) environment: - LITELLM_MASTER_KEY=sk-... # after environment: - LITELLM_MASTER_KEY=sk-... - LITELLM_LICENSE=sk-...
Defensive patterns
Strategy: validation
Validate before calling
import os
def validate_config(cfg: dict) -> None:
cbs = (cfg.get("litellm_settings") or {}).get("callbacks") or []
if "banned_keywords" in cbs and not os.environ.get("LITELLM_LICENSE"):
raise SystemExit("banned_keywords needs LITELLM_LICENSE") Try / catch
try:
start_proxy(cfg)
except Exception as e:
if "ENTERPRISE BannedKeyword" in str(e):
raise SystemExit("license missing: export LITELLM_LICENSE or drop banned_keywords")
raise Prevention
- Inject the license env var the same way in staging and production.
- Add a scheduled check of license validity before expiry dates.
- Keep local dev configs free of enterprise callbacks so license issues never block development.
When it happens
Trigger: Proxy runs on the enterprise Docker image with callbacks: ['banned_keywords'] while LITELLM_LICENSE is absent, expired, or invalid.
Common situations: The image is right but the license env var never reached the container. The license expired after a billing change. Staging works, production fails because only staging got the env var.
Related errors
- Trying to use Google Text ModerationYou must be a LiteLLM En
- Trying to use Llm GuardYou must be a LiteLLM Enterprise user
- Trying to use ENTERPRISE BlockedUserYou must be a LiteLLM En
- Trying to use Banned KeywordsThis uses the enterprise folder
- You must be a LiteLLM Enterprise user to use this feature. I
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/0767363883eb0069.
Report an issue: GitHub.