BerriAI/litellm · error · HTTPException

Policy engine not initialized. No policies loaded.

Error message

Policy engine not initialized. No policies loaded.

What it means

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.

Source

Thrown at litellm/proxy/management_endpoints/policy_endpoints/endpoints.py:512

    request: Request,
    policy_name: str,
    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
) -> PolicyInfoResponse:
    """
    Get detailed information about a specific policy.

    Returns:
    - Policy configuration
    - Resolved guardrails (after inheritance)
    - Inheritance chain
    """
    from litellm.proxy.policy_engine.policy_registry import get_policy_registry
    from litellm.proxy.policy_engine.policy_resolver import PolicyResolver

    registry: Final = get_policy_registry()

    if not registry.is_initialized():
        raise HTTPException(
            status_code=404,
            detail="Policy engine not initialized. No policies loaded.",
        )

    policy: Final = registry.get_policy(policy_name)
    if policy is None:
        raise HTTPException(
            status_code=404,
            detail=f"Policy '{policy_name}' not found",
        )

    resolved = PolicyResolver.resolve_policy_guardrails(policy_name=policy_name, policies=registry.get_all_policies())

    return PolicyInfoResponse(
        policy_name=policy_name,
        inherit=policy.inherit,
        scope=PolicyScopeResponse(
            teams=[],

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Initialize the policy engine and load policies before calling this endpoint.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/policy_endpoints/endpoints.py:512 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/729908f106ef7e37. Report an issue: GitHub.