{"record":{"id":"d1727336ed84fef8","repo":"BerriAI/litellm","slug":"violated-crowdstrike-aidr-guardrail-policy","errorCode":null,"errorMessage":"Violated CrowdStrike AIDR guardrail policy","messagePattern":"Violated CrowdStrike AIDR guardrail policy","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/crowdstrike_aidr.py","lineNumber":315,"sourceCode":"            \"Authorization\": f\"Bearer {self.api_key}\",\n            \"Content-Type\": \"application/json\",\n        }\n\n        verbose_proxy_logger.debug(\n            \"CrowdStrike AIDR Guardrail (%s): Calling endpoint %s with payload: %s\", hook_name, endpoint, payload\n        )\n\n        response: Final = await self.async_handler.post(url=endpoint, json=payload, headers=headers)\n        assert response is not None\n        response.raise_for_status()\n\n        result = _GuardChatCompletionsResponse.model_validate(response.json()).result or _GuardChatCompletionsResult()\n\n        if result.blocked:\n            verbose_proxy_logger.warning(\n                \"CrowdStrike AIDR Guardrail (%s): Request blocked. Response: %s\", hook_name, result\n            )\n            raise HTTPException(\n                status_code=400,  # Bad Request, indicating violation\n                detail={\n                    \"error\": \"Violated CrowdStrike AIDR guardrail policy\",\n                    \"guardrail_name\": self.guardrail_name,\n                },\n            )\n        verbose_proxy_logger.debug(\n            \"CrowdStrike AIDR Guardrail (%s): Request passed. Response: %s\", hook_name, result.detectors\n        )\n\n        return result\n\n    def _build_guard_input_for_request(self, inputs: GenericGuardrailAPIInputs) -> _GuardInputWithIndices | None:\n        guard_input: Final = _GuardInput(messages=[], tools=[])\n        structured_messages: Final = inputs.get(\"structured_messages\")\n        texts: Final = inputs.get(\"texts\", [])\n        tools: Final = inputs.get(\"tools\")\n","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/crowdstrike_aidr.py#L297-L333","documentation":"HTTP 400 raised from the CrowdStrike AIDR guard hook when the guard API responds with result.blocked=true for the content checked on that event hook (pre-call prompt, post-call output, or MCP payload). This is the guardrail working as designed — a policy violation was detected — and the response detail includes guardrail_name for attribution, not an infrastructure failure.","triggerScenarios":"A request whose messages (pre-call hooks) or model output (post-call hooks) matches a CrowdStrike AIDR detector policy (PII such as SSNs/cards, prompt-injection patterns, restricted topics); response.raise_for_status() has already passed, so this is a semantic verdict, not an HTTP error from CrowdStrike.","commonSituations":"Test prompts containing realistic PII trip detectors; corporate policy configured too broadly in the CrowdStrike console; guardrail left default_on for all teams when intended for one; integration tests not expecting guardrail verdicts.","solutions":["Treat it as a policy verdict: change or remove the offending content — retrying the identical request will block again","Review and narrow the detector policy for this workload in the CrowdStrike console","Scope the guardrail: set default_on: false and attach it only to specific teams/API keys/paths via guardrail_info","If unexpected, inspect the proxy warning log — it prints the full guard result (detectors) that produced blocked=true"],"exampleFix":"# before: retry loops on any error, blocks forever on a policy 400\nresp = client.chat.completions.create(**params)\n\n# after: branch on the guardrail 400 and stop retrying\ntry:\n    resp = client.chat.completions.create(**params)\nexcept Exception as e:\n    body = getattr(getattr(e, 'response', None), 'json', lambda: {})() or {}\n    err = body.get('error', {})\n    if err == 'Violated CrowdStrike AIDR guardrail policy':\n        return policy_denied(guardrail=body.get('guardrail_name'))\n    raise","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from fastapi import HTTPException\n\ntry:\n    result = await proxied_chat_call(...)\nexcept HTTPException as e:\n    if e.status_code == 400 and isinstance(e.detail, dict) and e.detail.get('error') == 'Violated CrowdStrike AIDR guardrail policy':\n        return policy_denied(guardrail=e.detail.get('guardrail_name'))  # no retry: deterministic verdict\n    raise","preventionTips":["Never auto-retry 400s carrying a guardrail error - the same content blocks again","Log detail.guardrail_name so blocks are attributable to the right policy","Use obviously-fake PII (e.g. 000-00-0000 style) in test traffic when policies detect it","Scope the guardrail with default_on: false + guardrail_info to teams that need it"],"tags":["crowdstrike","guardrails","content-moderation","http-400","policy-violation","blocked-request"],"backgroundTag":"guardrail-content-blocked","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}