fix(mcp): bound elicitation channel, warn on sensitive fields (#2524, #2523)#2530
Merged
fix(mcp): bound elicitation channel, warn on sensitive fields (#2524, #2523)#2530
Conversation
…2523) Replace the unbounded elicitation mpsc channel in McpManager with a bounded channel (default capacity 16). Requests arriving when the queue is full are auto-declined with a warning log, preventing memory exhaustion from misbehaving or malicious MCP servers. Capacity is configurable via: [mcp] elicitation_queue_capacity = 16 # default Add sensitive-field detection to the elicitation handler. Before prompting, field names are matched case-insensitively against a list of sensitive patterns (password, token, secret, key, credential, auth, private, passphrase, pin). If any match, a warning is shown with the server name and field name so the user can make an informed trust decision. Configurable via: [mcp] elicitation_warn_sensitive_fields = true # default Also fix three pre-existing clippy warnings in the elicitation CLI prompt builder (match-to-if-let, uninlined format args) and a stale test assertion. Closes #2524, closes #2523
24021f1 to
aeb178c
Compare
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
Depends on #2521 — contains elicitation code this PR builds on. Merge after #2521 lands.
[mcp] elicitation_queue_capacity = 16and[mcp] elicitation_warn_sensitive_fields = true(both optional with safe defaults)is_sensitive_field, bounded-channel overflowTest plan
cargo clippy --workspace --all-targets -- -D warnings— cleancargo +nightly fmt --check— cleanCloses #2524, closes #2523