BerriAI/litellm · error · HTTPException

Key is not in a team. search_tools cannot be assigned to per

Error message

Key is not in a team. search_tools cannot be assigned to personal keys by non-admin callers. Disallowed search tools: {sorted(requested)}.

What it means

HTTPException(403) from validate_key_search_tools_against_team: a non-admin caller tried to assign search_tools to a personal (teamless) key. Search-tool access on personal keys cannot be granted by non-admin callers; the message lists the disallowed search tools.

Source

Thrown at litellm/proxy/management_helpers/object_permission_utils.py:764


async def validate_key_search_tools_against_team(
    object_permission: ObjectPermissionDict | None,
    team_obj: Optional["LiteLLM_TeamTableCachedObj"],
    is_proxy_admin: bool = False,
) -> None:
    """
    Validate key object_permission.search_tools is a subset of the team's allowlist.

    Empty team allowlist means no restriction at team layer (skip).
    Non-admin callers cannot assign search_tools to a personal (no team) key.
    """
    requested: Final = _extract_requested_search_tools(object_permission)
    if not requested:
        return

    if team_obj is None and not is_proxy_admin:
        raise HTTPException(
            status_code=status.HTTP_403_FORBIDDEN,
            detail={
                "error": (
                    "Key is not in a team. search_tools cannot be assigned to "
                    "personal keys by non-admin callers. Disallowed search tools: "
                    f"{sorted(requested)}."
                )
            },
        )

    team_tools: list[str] = []
    if team_obj is not None and team_obj.object_permission is not None:
        st: Final = team_obj.object_permission.search_tools
        if st:
            team_tools = list(st)

    if not team_tools:
        return

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Assign the key to a team first, remove the requested search tools, or call as a proxy admin.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_helpers/object_permission_utils.py:764 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/db9f90e5b81fb4ba. Report an issue: GitHub.