BerriAI/litellm · error · HTTPException

Policy '{policy_name}' not found

Error message

Policy '{policy_name}' not found

What it means

The registry is initialized but contains no policy with the requested name: the caller asked for details of a policy_name that was never defined. Raised as 404; at-fault input is an unknown or misspelled policy name.

Source

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

    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=[],
            keys=[],
            models=[],
        ),
        guardrails=PolicyGuardrailsResponse(
            add=policy.guardrails.get_add(),
            remove=policy.guardrails.get_remove(),
        ),

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify the policy_name. List policies to find valid names.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/policy_endpoints/endpoints.py:519 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/38bc8a0ed0039e29. Report an issue: GitHub.