Skip to content

Fix LLM model tenant authorization - #824

Merged
yaojin3616 merged 1 commit into
mainfrom
agent/debugger/71a8b8f2
Aug 7, 2026
Merged

Fix LLM model tenant authorization#824
yaojin3616 merged 1 commit into
mainfrom
agent/debugger/71a8b8f2

Conversation

@yaojin3616

Copy link
Copy Markdown
Collaborator

Summary

  • scope LLM model list/create requests to the caller's tenant unless the caller is a platform admin
  • scope LLM model update and default-selection lookups to the caller's tenant
  • add regression coverage for tenant selection and mutation query scoping

Root cause

Organization admins could submit another tenant's model UUID to the update or default-selection endpoints. Those handlers loaded the model by ID without a tenant predicate, allowing changes to the other tenant's Base URL and API key.

Impact

An organization admin can now manage only models in their own tenant. Platform administrators retain cross-tenant management access.

Validation

  • PYTHONPATH=. uv run pytest tests/test_llm_model_tenant_scope.py tests/test_llm_tool_capability_probe.py tests/test_model_logical_delete.py
  • PYTHONPATH=. uv run ruff check tests/test_llm_model_tenant_scope.py

@yaojin3616
yaojin3616 marked this pull request as ready for review August 7, 2026 07:40
@yaojin3616
yaojin3616 merged commit 9565b53 into main Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant