BerriAI/litellm · critical · ValueError
CrowdStrike AIDR guardrail name is required
Error message
CrowdStrike AIDR guardrail name is required
What it means
ValueError raised by CrowdStrike AIDR guardrail initialization when the config entry has no guardrail_name. As with all litellm proxy guardrails, guardrail_name is the mandatory registration key used for hook routing, request-level guardrail selection, and AI-DR event attribution to your CrowdStrike tenant. Initialization aborts at config load, so the proxy won't start with a nameless crowdstrike_aidr entry.
Source
Thrown at litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/__init__.py:16
from typing import TYPE_CHECKING, Final
from litellm.types.guardrails import GuardrailEventHooks, SupportedGuardrailIntegrations
from .crowdstrike_aidr import CrowdStrikeAIDRHandler
if TYPE_CHECKING:
from litellm.types.guardrails import Guardrail, LitellmParams
def initialize_guardrail(litellm_params: "LitellmParams", guardrail: "Guardrail"):
import litellm
guardrail_name: Final = guardrail.get("guardrail_name")
if not guardrail_name:
raise ValueError("CrowdStrike AIDR guardrail name is required")
_crowdstrike_aidr_callback: Final = CrowdStrikeAIDRHandler(
guardrail_name=guardrail_name,
api_base=litellm_params.api_base,
api_key=litellm_params.api_key,
# Exclude during_call to prevent duplicate input events
event_hook=[
GuardrailEventHooks.pre_call.value,
GuardrailEventHooks.post_call.value,
],
default_on=litellm_params.default_on,
)
litellm.logging_callback_manager.add_litellm_callback(_crowdstrike_aidr_callback)
return _crowdstrike_aidr_callback
guardrail_initializer_registry: Final = {View on GitHub (pinned to 77b7c6c40c)
Solutions
- Add a unique guardrail_name at the top level of the guardrail entry.
- Validate structure: guardrails is a list of {guardrail_name, litellm_params}; lint the YAML or use litellm's config validation before deploy.
- Restart the proxy after the fix so initialization re-runs.
Example fix
# before
guardrails:
- litellm_params:
guardrail: crowdstrike_aidr
api_base: https://example.crowdstrike.ai
# after
guardrails:
- guardrail_name: crowdstrike-aidr
litellm_params:
guardrail: crowdstrike_aidr
api_base: https://example.crowdstrike.ai Defensive patterns
Strategy: validation
Validate before calling
import yaml
cfg = yaml.safe_load(open("config.yaml"))
seen = set()
for g in cfg.get("guardrails", []):
if g.get("litellm_params", {}).get("guardrail") == "crowdstrike_aidr":
name = g.get("guardrail_name")
assert isinstance(name, str) and name.strip(), f"crowdstrike_aidr entry missing guardrail_name: {g}"
assert name not in seen; seen.add(name) Type guard
from typing import Any
def is_named_guardrail_entry(entry: Any) -> bool:
return (isinstance(entry, dict)
and isinstance(entry.get("guardrail_name"), str)
and bool(entry["guardrail_name"].strip())) Prevention
- Validate all guardrails entries share the {guardrail_name, litellm_params} shape in CI.
- Use the same lint rule repo-wide — every guardrail type has this requirement.
- Generate config from typed templates instead of hand-editing YAML lists.
When it happens
Trigger: Adding a guardrails: [{litellm_params: {guardrail: crowdstrike_aidr, api_base:..., api_key:...}}] entry without the sibling guardrail_name field, then starting or hot-reloading the proxy; initialize_guardrail() reads guardrail.get('guardrail_name'), gets None, and raises.
Common situations: YAML indentation placing guardrail_name under litellm_params instead of the entry root; trimming configs for minimal examples; renaming entries and accidentally deleting the name line.
Related errors
- Block Code Execution guardrail requires a guardrail_name
- Couldn't get Cato Networks api key, either set the `CATO_API
- Cisco AI Defense API key is required. Set `CISCO_AI_DEFENSE_
- Compresr guardrail requires an API key. Set `api_key` in the
- Bedrock guardrail failed: {e}
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/0be7f3990fc1d38e.
Report an issue: GitHub.