Revert "feat(guardrails): implement team-based isolation guardrails mgmnt" - #20393
Merged
1 commit merged intoFeb 4, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ghost
deleted the
revert-19889-feat/own-team-guardrail-mgmnt
branch
February 4, 2026 04:59
Contributor
Greptile OverviewGreptile SummaryThis PR reverts PR #19889 which implemented team-based isolation for guardrails management. The revert removes team-specific guardrail configuration capabilities and returns to a global guardrails-only model. Key changes reverted:
Critical issue found:
Confidence Score: 2/5
|
| Filename | Overview |
|---|---|
| litellm/proxy/guardrails/guardrail_endpoints.py | Removed team-based isolation logic, moved CreateGuardrailRequest/UpdateGuardrailRequest back to local classes, removed team_id filtering |
| litellm/proxy/guardrails/guardrail_registry.py | Removed team_id parameter from add_guardrail_to_db, update_guardrail_in_db, delete_guardrail_from_db and get_all_guardrails_from_db |
| litellm/proxy/schema.prisma | Removed team_id from LiteLLM_GuardrailsTable and allow_team_guardrail_config from TeamTable/DeletedTeamTable |
| schema.prisma | Removed team_id from LiteLLM_GuardrailsTable and allow_team_guardrail_config from TeamTable/DeletedTeamTable |
| litellm-proxy-extras/litellm_proxy_extras/schema.prisma | Schema file not updated by revert - still contains team_id in GuardrailsTable and allow_team_guardrail_config in TeamTable/DeletedTeamTable |
Sequence Diagram
sequenceDiagram
participant User
participant GuardrailEndpoint as Guardrail Endpoints
participant GuardrailRegistry as Guardrail Registry
participant Database as Prisma DB
Note over User,Database: Before Revert (With Team Isolation)
User->>GuardrailEndpoint: POST /guardrails (with team_id)
GuardrailEndpoint->>GuardrailEndpoint: Check team permissions
GuardrailEndpoint->>Database: Verify allow_team_guardrail_config
Database-->>GuardrailEndpoint: Return team config
GuardrailEndpoint->>GuardrailRegistry: add_guardrail_to_db(guardrail, team_id)
GuardrailRegistry->>Database: INSERT with team_id
Database-->>GuardrailRegistry: Success
GuardrailRegistry-->>GuardrailEndpoint: Guardrail created
GuardrailEndpoint-->>User: 200 OK
Note over User,Database: After Revert (Global Only)
User->>GuardrailEndpoint: POST /guardrails
GuardrailEndpoint->>GuardrailRegistry: add_guardrail_to_db(guardrail)
GuardrailRegistry->>Database: INSERT (no team_id)
Database-->>GuardrailRegistry: Success
GuardrailRegistry-->>GuardrailEndpoint: Guardrail created
GuardrailEndpoint-->>User: 200 OK
Note over User,Database: List Guardrails - Before vs After
User->>GuardrailEndpoint: GET /v2/guardrails/list
alt Before: Team-filtered
GuardrailEndpoint->>Database: SELECT WHERE team_id = user.team_id
else After: Global view
GuardrailEndpoint->>Database: SELECT * (no team filter)
end
Database-->>GuardrailEndpoint: Guardrails list
GuardrailEndpoint-->>User: Return guardrails
Contributor
Additional Comments (3)
Prompt To Fix With AIThis is a comment left during a code review.
Path: litellm-proxy-extras/litellm_proxy_extras/schema.prisma
Line: 779:779
Comment:
revert missed removing `team_id` field from `LiteLLM_GuardrailsTable`
```suggestion
guardrail_info Json?
created_at DateTime @default(now())
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: litellm-proxy-extras/litellm_proxy_extras/schema.prisma
Line: 132:132
Comment:
revert missed removing `allow_team_guardrail_config` field from `LiteLLM_TeamTable`
```suggestion
model_id Int? @unique // id for LiteLLM_ModelTable -> stores team-level model aliases
litellm_organization_table LiteLLM_OrganizationTable? @relation(fields: [organization_id], references: [organization_id])
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: litellm-proxy-extras/litellm_proxy_extras/schema.prisma
Line: 164:164
Comment:
revert missed removing `allow_team_guardrail_config` field from `LiteLLM_DeletedTeamTable`
```suggestion
model_id Int? // id for LiteLLM_ModelTable -> stores team-level model aliases
```
How can I resolve this? If you propose a fix, please make it concise. |
fzowl
pushed a commit
to fzowl/litellm
that referenced
this pull request
Jun 24, 2026
…gmnt (#1…" (BerriAI#20393) This reverts commit 76a399b.
This pull request was closed.
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.
Reverts #19889