BerriAI/litellm · error · HTTPException

You do not have permission to modify this memory entry.

Error message

You do not have permission to modify this memory entry.

What it means

HTTPException(403) from the memory-entry write-access check: the caller is not an admin and does not own the row — the row's user_id belongs to someone else, or it is a team row and the caller is not a team admin. Plain team members may read team rows but not modify them.

Source

Thrown at litellm/proxy/memory/memory_endpoints.py:201

      Plain team members can only READ team rows, not modify them — same
      pattern as `_validate_team_member_add_permissions` etc.
    - Anything else: 403.
    """
    if _is_admin(user_api_key_dict):
        return
    row_user_id: Final = getattr(row, "user_id", None)
    row_team_id: Final = getattr(row, "team_id", None)

    # Personal ownership.
    if row_user_id and row_user_id == user_api_key_dict.user_id:
        return

    # Pure team row — only team admins (or org admins) may write.
    if row_user_id is None and row_team_id is not None:
        if await _is_team_admin_for(prisma_client, user_api_key_dict, row_team_id):
            return

    raise HTTPException(
        status_code=403,
        detail="You do not have permission to modify this memory entry.",
    )


async def _is_team_admin_for(prisma_client: "PrismaClient", user_api_key_dict: UserAPIKeyAuth, team_id: str) -> bool:
    """
    True if the caller is a team admin of `team_id`, or an org admin for the
    team's organization. Mirrors the auth pattern used by team-management
    endpoints (`_is_user_team_admin` + `_is_user_org_admin_for_team`).

    Imported lazily to avoid a circular import with proxy_server during the
    memory router's module load.
    """
    from litellm.proxy.management_endpoints.common_utils import (
        _is_user_org_admin_for_team,
        _is_user_team_admin,
    )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Modify the entry with the key/user that owns it, or call as a proxy admin.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/memory/memory_endpoints.py:201 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/b19a83a54d3462eb. Report an issue: GitHub.