-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
feat(guardrails): add pre_mcp_call support to Content Filter #32936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yuneng-berri
merged 6 commits into
litellm_internal_staging
from
litellm_lit4226_content_filter_pre_mcp_call
Jul 11, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
21b123f
feat(guardrails): add pre_mcp_call support to Content Filter
yucheng-berri cec164c
test(guardrails): cover canonical MCP key gate under pre_mcp_call mode
yucheng-berri a333939
fix(guardrails): scan MCP arguments per value and gate mixed-mode sca…
yucheng-berri 9dcdb05
fix(guardrails): cap MCP argument scan depth and register the walker …
yucheng-berri f9c3bf1
test(guardrails): update LIT-4226 UI settings tests for content filte…
yucheng-berri 90498df
fix(guardrails): use builtin generics in MCP scan annotations to sati…
yucheng-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed mode scans chat MCP fields
Medium Severity
_scan_mcp_tool_call_argumentsuses_event_hook_is_event_type(pre_mcp_call), which is true wheneverpre_mcp_callappears in the guardrail’s configured mode list, not only on MCP hook invocations. With a mixed mode such as["pre_call", "pre_mcp_call"], a normal chatpre_callrun can still scan and block or rewritemcp_tool_name/mcp_argumentsif those keys are present onrequest_data.Reviewed by Cursor Bugbot for commit 9ba423f. Configure here.