You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement multi-layered MCP client-side defenses against tool poisoning
(arXiv:2603.22489) and per-tool capability/sensitivity metadata for
data-flow policy enforcement (arXiv:2601.08012).
- sanitize_tools() now returns SanitizeResult with injection_count,
flagged_tools, and flagged_patterns (pattern name per matched field)
- 16 injection patterns in INJECTION_PATTERNS (role override, jailbreak,
delimiter escape, base64 payload, exfil via image/link, etc.)
- Unicode hardening: strip Cf-category format chars before pattern scan
- apply_injection_penalties(): applies trust score penalties (capped at
MAX_INJECTION_PENALTIES_PER_REGISTRATION=3) and auto-demotes server
trust level when recommended level is more restrictive; never promotes
- ToolSecurityMeta on McpTool: DataSensitivity (None/Low/Medium/High)
and CapabilityClass set (FilesystemRead/Write, Network, Shell,
DatabaseRead, MemoryWrite, ExternalApi)
- infer_security_meta(): keyword-based heuristic classifier; explicit
filesystem keywords only, generic verbs excluded; defaults to Low
- Operator config override via mcp.servers[].tool_metadata TOML section
- check_data_flow(): blocks High-sensitivity tools on Untrusted/Sandboxed
servers at registration time; Medium on Sandboxed emits warning
- sanitize_string delegates to sanitize_string_tracked (DRY)
Closes#2459, closes#2420
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
30
30
- feat(mcp): configurable tool description and server instructions length caps — `[mcp] max_description_bytes` (default 2048) and `max_instructions_bytes` (default 2048); `truncate_instructions()` helper applied after handshake; server instructions stored and accessible via `McpManager::server_instructions()` (#2450)
31
31
- fix(security): canonicalize `file://` root paths in MCP `validate_roots()` — `std::fs::canonicalize()` is applied to existing paths so traversal payloads like `file:///etc/../secret` are resolved and symlinks are expanded before roots are passed to MCP servers; non-resolvable paths fall through unchanged with a warning (closes #2455)
32
32
- fix(security): sanitize MCP server instructions before storing — `truncate_instructions()` now applies injection-pattern sanitization (same rules as tool descriptions) before truncation; injection payloads in server instructions are replaced with `[sanitized]` (closes #2456)
33
+
- feat(mcp): injection detection feedback loop — `sanitize_tools()` returns `SanitizeResult` (injection count, flagged tools, flagged patterns); up to `MAX_INJECTION_PENALTIES_PER_REGISTRATION = 3` trust-score penalties applied per registration batch via `apply_injection_penalties()`; capped at 0.75 total penalty per batch to avoid runaway score collapse (closes #2459)
34
+
- feat(mcp): per-tool security metadata — `ToolSecurityMeta` struct carrying `DataSensitivity` (`None/Low/Medium/High`) and `Vec<CapabilityClass>` (`FilesystemRead/Write`, `Shell`, `Network`, `DatabaseRead/Write`, `MemoryWrite`, `ExternalApi`); `infer_security_meta()` heuristic assigns metadata from tool name keywords at registration time; operator config `[mcp.servers.tool_metadata]` overrides heuristics per tool (closes #2420)
35
+
- feat(mcp): data-flow policy enforcement — `check_data_flow()` blocks High-sensitivity tools on Untrusted/Sandboxed servers at registration time; Medium-sensitivity tools on Sandboxed servers emit a warning but are permitted (closes #2420)
0 commit comments