Add opt-in MCP tool-metadata enforcement (injection refuse) - #112
Merged
Conversation
Default remains detect-only; MCP_TOOL_METADATA_ENFORCEMENT_ENABLED filters list_tools and refuses call_tool for injection-flagged tools after a successful health screen, with honest Non-Claims and ops docs. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Bugbot: a rebuild that dropped unscanned prior injection blocks could re-admit poisoned tools; keep the block until the tool is re-verified. Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Author
Bugbot follow-upFixed: per-tool scanner exceptions no longer clear a prior |
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.
Summary
MCP_TOOL_METADATA_ENFORCEMENT_ENABLED(default off) rebuilds per-serverblocked_toolsafter a successfullist_toolsscreen (health today), omits injection-flagged tools from listings, and refusescall_toolwith stableerror_code=tool_refused_metadata_injectionbefore transport.enabled=False→ invoke 404 byte-identical to missing; drift stays detect-only; never auto-mutatesenabled. Outer screen failure: list fail-open + prior blocks still refuse.docs/designs/mcp-tool-metadata-enforcement/(REV 2); GOVERNANCE / SECURITY_MAPPING ASI02 / OPERATIONS runbook / PLATFORM_GUIDE /.env.examplehonesty updates.Risk tier
High — opt-in enforcement on MCP discovery/execution. Plan + four artifacts APPROVED by security, SRE, and template-DX (REV 2).
Test plan
tests/test_mcp_tool_metadata_enforcement.py.jinja(default-off, enforce-on omit+refuse, drift, atomicity, outer fail, legacy load, enrichment, cross-tenant, healthtools_refused, API 404/200 pins)test_mcp_tool_screen.py.jinjabash scripts/validate_generated.sh— all four profiles PASSED (266 checks, 0 warnings on defaults)Made with Cursor