fix(permissions): require approval for user MCP tools - #1321
Merged
Merged
Conversation
MCP tools were classified as low risk and auto-allowed in every mode, so ask/accept-edits never showed an approval card. Classify mcp_ tools as medium and ignore server-declared risk. auto still runs them; Plan and Goal still deny them. Fixes #1320
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
Fixes #1320.
PermissionManagerclassified everymcp_<serverId>_<tool>tool asLowrisk, which auto-allows in every mode, so MCP tools ran without an approval card underaskandaccept-edits.mcp_tools asMedium(same as a plugin tool without a valid declaration). Server-declared risk / annotations are ignored and never lower the path.ask/accept-edits: every call shows the approval card ("MCP server tool requires approval"); allow-session covers only that exact tool name.autostill runs them without a card; Plan / Goal still deny them.plugins.execute, themcp_namespace, host protocol, schema or persistence.docs/adr/mcp-tool-approval-risk.md(D640); en + zh-CN tools-and-permissions, security, E2E plan and decisions log updated.Testing
crates/host-core/src/permissions.rs: declared risk ignored, prompts underask/accept-edits, auto-allow underauto, session-grant scope, denial in Plan / Goal.cargo test -p host-core: 746 passedcargo fmt -p host-core -- --check,cargo clippy -p host-core --all-targets -- -D warnings: cleanpnpm docs:check,pnpm check:agent-policy,pnpm check:pr-base: passNot covered
E2E-MCP-tool-requires-approvalnot run yet (marked Draft).