mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-01 18:52:21 +01:00
feat(mcp): let a deployment declare local MCP tools (#6330)
* feat(mcp): let a deployment declare local MCP tools Tools served by a user-configured MCP server are absent from TOOL_CAPABILITIES, so they are unknown and fail high. For a server with both a read and a write tool that is unusable: the read result arms the post-external gate, because an unknown result is not SYSTEM integrity, and the write that follows is refused until separately authorized. Every second call needs an approval, for a server that never leaves the host. Add ODYSSEUS_LOCAL_MCP_READ_TOOLS and ODYSSEUS_LOCAL_MCP_WRITE_TOOLS. Declared read tools become READ_PRIVATE with SYSTEM integrity, so their output no longer arms the gate; declared write tools become WRITE_PRIVATE and stay inside POST_EXTERNAL_BLOCKED_EFFECTS, so a run tainted by real external content still requires the approval. Unset variables keep the current behaviour exactly. Fixes #6329 * fix(mcp): secure local MCP authorization and preserve external taint gate Keep declared local MCP read tool results untrusted with EXTERNAL_UNTRUSTED integrity so they continue to arm the external-context gate. Introduce a narrowly scoped continuation exception for declared local MCP writes on the same server when no external taint or explicit error payloads enter the run. Preserves gate protection for shell execution, network egress, email, and cross-server actions. Fixes #6329 * fix(mcp): resolve local continuation against stdio transport and enforce built-in classifications Resolve declared local MCP continuation operations against connected stdio servers and enforce established built-in tool security classifications. Ensure remote HTTP and SSE servers, unverified transports, replaced sessions, stale configurations, and operations with dangerous effects or missing request grants fail closed. * fix(mcp): require sealed authority for local continuation * fix(mcp): seal local tool admission and synchronize GPU stacks --------- Co-authored-by: Alexandre Teixeira <general@alexandreteixeira.dev>
This commit is contained in:
co-authored by
Alexandre Teixeira
parent
6f2b58c896
commit
6fced41220
+2
-1
@@ -66,10 +66,11 @@ External content that reaches the LLM is treated as untrusted via `src/prompt_se
|
||||
|
||||
It is on unless `ODYSSEUS_TOOL_APPROVAL_GATE` is set to a falsy value (`0`/`false`/`no`/`off`). Request authority narrows which tool families a turn may use, but within an admitted family it does not bind the exact action: a request to read email admits `send_email` and `delete_email`, and agent processes inherit the host network. Until those are covered by their own boundaries, this gate is what stops an injected instruction from reaching them. Turning it off lets a successful injection reach `bash`, `host_shell`, `send_email` and `delete_email` without a separate confirmation.
|
||||
|
||||
Two exemptions apply even when the gate is on, both deliberate:
|
||||
Three exemptions apply even when the gate is on, all deliberate:
|
||||
|
||||
- Sources in `_CONTROL_PLANE_CONTEXT_SOURCES` (skills, runtime descriptors, the open editor document, the open email, uploaded files) are treated as control-plane metadata and still permit read-only tools.
|
||||
- A TUI run that advertises a host shell bridge and declares `unattended_mode` exempts the local execution set in `TUI_CLIENT_TOOL_NAMES`. Personal, network and deployment-local tools are never exempted.
|
||||
- Narrow continuation for local MCP tools declared via `ODYSSEUS_LOCAL_MCP_READ_TOOLS` and `ODYSSEUS_LOCAL_MCP_WRITE_TOOLS`: Only explicitly configured stdio MCP servers qualify; remote HTTP and SSE servers fail closed. Declarations never override built-in tool effects, so built-in email, browser, memory, image generation, and other built-in servers cannot receive continuation exceptions. Declared read tools remain untrusted (`EXTERNAL_UNTRUSTED`) to ensure that prompt injections in local data cannot reach shell, network, or unrelated tools without approval. Stdio transport does not guarantee network isolation, as local processes may still reach the host network. However, declared non-destructive write tools on the exact same stdio MCP server are permitted to continue without an approval prompt if the only untrusted context in the run was produced by declared local reads on that same server, without any explicit error or external taint. Genuinely external content (web search, web fetch, emails, external message context) blocks these writes. Authorization must still originate from the trusted request: request authority must permit the tool and retain the sealed backend resource grant. The residual same-store write risk (the agent writing to the same local store after reading a local prompt injection) remains subject to the user's initial request authority.
|
||||
|
||||
## Security Headers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user