{"record":{"id":"729908f106ef7e37","repo":"BerriAI/litellm","slug":"policy-engine-not-initialized-no-policies-loaded","errorCode":null,"errorMessage":"Policy engine not initialized. No policies loaded.","messagePattern":"Policy engine not initialized\\. No policies loaded\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/policy_endpoints/endpoints.py","lineNumber":512,"sourceCode":"    request: Request,\n    policy_name: str,\n    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n) -> PolicyInfoResponse:\n    \"\"\"\n    Get detailed information about a specific policy.\n\n    Returns:\n    - Policy configuration\n    - Resolved guardrails (after inheritance)\n    - Inheritance chain\n    \"\"\"\n    from litellm.proxy.policy_engine.policy_registry import get_policy_registry\n    from litellm.proxy.policy_engine.policy_resolver import PolicyResolver\n\n    registry: Final = get_policy_registry()\n\n    if not registry.is_initialized():\n        raise HTTPException(\n            status_code=404,\n            detail=\"Policy engine not initialized. No policies loaded.\",\n        )\n\n    policy: Final = registry.get_policy(policy_name)\n    if policy is None:\n        raise HTTPException(\n            status_code=404,\n            detail=f\"Policy '{policy_name}' not found\",\n        )\n\n    resolved = PolicyResolver.resolve_policy_guardrails(policy_name=policy_name, policies=registry.get_all_policies())\n\n    return PolicyInfoResponse(\n        policy_name=policy_name,\n        inherit=policy.inherit,\n        scope=PolicyScopeResponse(\n            teams=[],","sourceCodeStart":494,"sourceCodeEnd":530,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/policy_endpoints/endpoints.py#L494-L530","documentation":"GET /policy/{policy_name} sentinel guard: the policy registry has not been initialized (no policies were loaded into the proxy, e.g. no policy config supplied at startup), so no policy lookup can succeed. The at-fault condition is server configuration, not the requested policy name; raised as 404.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/policy_endpoints/endpoints.py:512 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Initialize the policy engine and load policies before calling this endpoint."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}