{"record":{"id":"2855453c529c1302","repo":"BerriAI/litellm","slug":"key-is-not-in-a-team-vector-stores-cannot-be-assi","errorCode":null,"errorMessage":"Key is not in a team. Vector stores cannot be assigned to personal keys by non-admin callers. Disallowed vector stores: {sorted(requested)}.","messagePattern":"Key is not in a team\\. Vector stores cannot be assigned to personal keys by non-admin callers\\. Disallowed vector stores: (.+?)\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/management_helpers/object_permission_utils.py","lineNumber":724,"sourceCode":"\n\nasync def validate_key_vector_stores_against_team(\n    object_permission: ObjectPermissionDict | None,\n    team_obj: Optional[\"LiteLLM_TeamTableCachedObj\"],\n    is_proxy_admin: bool = False,\n) -> None:\n    \"\"\"\n    Reject vector_stores requested on a personal (no team) key by a non-admin\n    caller. Vector store access is granted at use-time from the key's\n    object_permission.vector_stores list, so the assignment is the authorization\n    boundary. Team keys and proxy admins are unaffected.\n    \"\"\"\n    requested: Final = _extract_requested_vector_stores(object_permission)\n    if not requested:\n        return\n    if team_obj is not None or is_proxy_admin:\n        return\n    raise HTTPException(\n        status_code=status.HTTP_403_FORBIDDEN,\n        detail={\n            \"error\": (\n                \"Key is not in a team. Vector stores cannot be assigned to \"\n                \"personal keys by non-admin callers. Disallowed vector stores: \"\n                f\"{sorted(requested)}.\"\n            )\n        },\n    )\n\n\ndef _extract_requested_search_tools(\n    object_permission: ObjectPermissionDict | None,\n) -> list[str]:\n    \"\"\"Return search_tool_name values from a key's object_permission dict.\"\"\"\n    if not object_permission or not isinstance(object_permission, dict):\n        return []\n    raw: Final = object_permission.get(\"search_tools\")","sourceCodeStart":706,"sourceCodeEnd":742,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_helpers/object_permission_utils.py#L706-L742","documentation":"HTTPException(403) from validate_key_vector_stores_against_team: a non-admin caller tried to set vector_stores on a personal (no team) key. Since vector-store access is granted at use-time from this list, the assignment itself is the authorization boundary and is restricted to team keys or admin callers.","triggerScenarios":"Thrown at litellm/proxy/management_helpers/object_permission_utils.py:724 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Assign the key to a team first, remove the requested vector stores, or call as a proxy admin."],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}