Skip to content

[641] feat(sandbox): preserve network isolation for MCP servers via CONNECT proxy#679

Open
decko wants to merge 2 commits into
mainfrom
feat/mcp-allowed-hosts
Open

[641] feat(sandbox): preserve network isolation for MCP servers via CONNECT proxy#679
decko wants to merge 2 commits into
mainfrom
feat/mcp-allowed-hosts

Conversation

@decko

@decko decko commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Wire go-arapuca's AllowedHosts into the sandbox runner so MCP servers declaring allowed_hosts in soda.yaml keep full network namespace isolation instead of disabling it
  • Upgrade go-arapuca to v0.2.3-rc1 (includes arapuca_config_add_allowed_host FFI from arapuca#46)

How it works

When all MCP servers in a phase declare allowed_hosts, the sandbox CONNECT proxy routes only that traffic while the agent remains fully network-isolated. Without allowed_hosts, falls back to the existing behavior (disable netns).

mcp:
  servers:
    jira:
      command: wtmcp
      args: [jira]
      allowed_hosts:
        - host: "jira.example.com"
          port: 443

Changes

  • config.MCPServerConfig gains AllowedHosts []AllowedHost
  • effectiveUseNetNS keeps netns when all servers have allowed hosts
  • collectAllowedHosts aggregates and deduplicates across servers
  • arapuca.Config.AllowedHosts wired in sandbox runner
  • 15 new test cases (8 effectiveUseNetNS, 7 collectAllowedHosts)
  • Config example updated with allowed_hosts documentation

Closes #641

💘 Generated with Crush

…lowed hosts

When MCP servers are configured, the sandbox previously disabled network
namespace isolation entirely so servers could reach external APIs. This
wires go-arapuca's new AllowedHosts/CONNECT proxy support so that MCP
servers declaring allowed_hosts in soda.yaml keep full network isolation
while routing only declared traffic through the proxy.

Servers without allowed_hosts fall back to the existing behavior
(disable netns). Mixed configurations (some with, some without) also
fall back to preserve backward compatibility.

Closes #641

Assisted-by: Claude Opus 4.6
- effectiveUseNetNS now respects configured=false (never overrides
  user's explicit opt-out of network namespace isolation) (#680)
- Validate AllowedHost fields at config load time: non-empty host,
  port 1-65535, no URL scheme prefixes (#681)

Assisted-by: Claude Opus 4.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sandbox): MCP server isolation via Unix socket bridge

1 participant