{"record":{"id":"0be7f3990fc1d38e","repo":"BerriAI/litellm","slug":"crowdstrike-aidr-guardrail-name-is-required","errorCode":null,"errorMessage":"CrowdStrike AIDR guardrail name is required","messagePattern":"CrowdStrike AIDR guardrail name is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/__init__.py","lineNumber":16,"sourceCode":"from typing import TYPE_CHECKING, Final\n\nfrom litellm.types.guardrails import GuardrailEventHooks, SupportedGuardrailIntegrations\n\nfrom .crowdstrike_aidr import CrowdStrikeAIDRHandler\n\nif TYPE_CHECKING:\n    from litellm.types.guardrails import Guardrail, LitellmParams\n\n\ndef initialize_guardrail(litellm_params: \"LitellmParams\", guardrail: \"Guardrail\"):\n    import litellm\n\n    guardrail_name: Final = guardrail.get(\"guardrail_name\")\n    if not guardrail_name:\n        raise ValueError(\"CrowdStrike AIDR guardrail name is required\")\n\n    _crowdstrike_aidr_callback: Final = CrowdStrikeAIDRHandler(\n        guardrail_name=guardrail_name,\n        api_base=litellm_params.api_base,\n        api_key=litellm_params.api_key,\n        # Exclude during_call to prevent duplicate input events\n        event_hook=[\n            GuardrailEventHooks.pre_call.value,\n            GuardrailEventHooks.post_call.value,\n        ],\n        default_on=litellm_params.default_on,\n    )\n    litellm.logging_callback_manager.add_litellm_callback(_crowdstrike_aidr_callback)\n\n    return _crowdstrike_aidr_callback\n\n\nguardrail_initializer_registry: Final = {","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/__init__.py#L1-L34","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\nguardrails:\n  - litellm_params:\n      guardrail: crowdstrike_aidr\n      api_base: https://example.crowdstrike.ai\n\n# after\nguardrails:\n  - guardrail_name: crowdstrike-aidr\n    litellm_params:\n      guardrail: crowdstrike_aidr\n      api_base: https://example.crowdstrike.ai","handlingStrategy":"validation","validationCode":"import yaml\ncfg = yaml.safe_load(open(\"config.yaml\"))\nseen = set()\nfor g in cfg.get(\"guardrails\", []):\n    if g.get(\"litellm_params\", {}).get(\"guardrail\") == \"crowdstrike_aidr\":\n        name = g.get(\"guardrail_name\")\n        assert isinstance(name, str) and name.strip(), f\"crowdstrike_aidr entry missing guardrail_name: {g}\"\n        assert name not in seen; seen.add(name)","typeGuard":"from typing import Any\ndef is_named_guardrail_entry(entry: Any) -> bool:\n    return (isinstance(entry, dict)\n            and isinstance(entry.get(\"guardrail_name\"), str)\n            and bool(entry[\"guardrail_name\"].strip()))","tryCatchPattern":null,"preventionTips":["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."],"tags":["litellm","guardrails","crowdstrike","configuration","startup","aidr"],"backgroundTag":"missing-required-config-field","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}