BerriAI/litellm · error · HTTPException

Access denied to managed resource.

Error message

Access denied to managed resource.

What it means

Access-control failure after a managed resource was found: the caller's user/team (from user_api_key_dict) does not match the row's created_by/team_id, so the resolution is refused even though the ID itself is valid.

Source

Thrown at litellm/proxy/pass_through_endpoints/managed_id_rewriter.py:393

                    row_created_by = obj_row.created_by
                    row_team_id = obj_row.team_id
                    found = True
            except Exception:
                verbose_proxy_logger.debug(
                    "managed_id_rewriter._resolve_one: object DB lookup failed",
                    exc_info=True,
                )

    # 3. Hard 404 for unknown / forged IDs — NEVER forward to upstream
    if not found:
        raise HTTPException(
            status_code=404,
            detail="Managed resource not found.",
        )

    # 4. Access check
    if not can_access_resource(user_api_key_dict, row_created_by, row_team_id):
        raise HTTPException(
            status_code=403,
            detail="Access denied to managed resource.",
        )

    return payload.raw_provider_id


async def _guard_raw_provider_id(
    raw_id: str,
    provider: str,
    user_api_key_dict: UserAPIKeyAuth,
    prisma_client: PrismaClient | None,
    budget: _RawIdGuardBudget | None = None,
) -> None:
    """Deny a raw provider ID that maps to a managed resource the caller does
    not own, before it is forwarded upstream.

    Clients only ever receive managed IDs (response bodies are rewritten), so a

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use an API key/team that owns or is granted access to the managed resource.
  2. Ask a proxy admin to grant the key or team access to the resource.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/pass_through_endpoints/managed_id_rewriter.py:393 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


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