fix(llm): Hide private models from Agent Creation#7873
Merged
justin-tahara merged 2 commits intomainfrom Jan 27, 2026
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryFixed security bug where non-public LLM providers with no group/persona restrictions were incorrectly accessible to all users instead of being admin-only. Key Changes:
Impact:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant API as /llm/provider endpoint
participant AccessControl as can_user_access_llm_provider
participant DB as Database
User->>API: GET /llm/provider
API->>DB: fetch_existing_llm_providers()
DB-->>API: all_providers[]
API->>DB: fetch_user_group_ids(user)
DB-->>API: user_group_ids
loop For each provider
API->>AccessControl: can_user_access_llm_provider(provider, user_group_ids, persona=None, is_admin)
alt Provider is public
AccessControl-->>API: True (public override)
else Provider has groups only
alt User is admin OR user in group
AccessControl-->>API: True
else
AccessControl-->>API: False
end
else Provider has personas only
AccessControl-->>API: False (persona=None)
else Provider has both groups and personas
AccessControl-->>API: False (persona=None)
else Provider has no restrictions (not public)
alt User is admin
AccessControl-->>API: True
else
AccessControl-->>API: False (admin-only)
end
end
alt Access granted
API->>API: Add to accessible_providers
end
end
API-->>User: accessible_providers[]
|
yuhongsun96
reviewed
Jan 27, 2026
justin-tahara
added a commit
that referenced
this pull request
Jan 27, 2026
justin-tahara
added a commit
that referenced
this pull request
Jan 27, 2026
justin-tahara
added a commit
that referenced
this pull request
Jan 27, 2026
justin-tahara
added a commit
that referenced
this pull request
Jan 27, 2026
justin-tahara
added a commit
that referenced
this pull request
Jan 27, 2026
justin-tahara
added a commit
that referenced
this pull request
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Updating the backend api check for LLM management in the Agent Creation page
How Has This Been Tested?
Tested locally by making an LLM config private and setting myself to a basic user.
Also added a proper test
Basic User:

Admin User:

Additional Options
Summary by cubic
Hide private LLM providers from the Agent Creation page by enforcing centralized access control in the listing API. Non-public, unrestricted providers no longer appear for basic users; admins still see all.
Written for commit 10d83fe. Summary will update on new commits.