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
Found during review of #210. A custom (bring-your-own) agent can set mcp.enabled: false in its config override, and this is correctly reflected in bbox agents inspect and the agents add/doctor JSON receipt (both compute mcpDisabled from override.MCP.Enabled). However, the actual runtime MCP proxy wiring in cmd/bbox/main.go's applyCustomAgentAuthzDefault path is only reached inside the block gated by the global MCP toggle (--no-mcp / cfg.MCP.Enabled) — it never consults the per-agent override.MCP.Enabled field.
Net effect: a custom agent that declares mcp.enabled: false for itself does not actually get the MCP proxy disabled at VM start time when MCP is globally enabled. The CLI's own display/diagnostic surfaces (inspect, doctor receipt) show the agent as MCP-disabled, but the runtime behavior disagrees.
Where to look
cmd/bbox/main.go — the MCP proxy setup path (applyCustomAgentAuthzDefault and its caller, gated by the global mcpEnabled check), around main.go:850-900ish (line numbers as of PR Add bbox agents add/init scaffolding (#201) #210; verify current location).
cmd/bbox/agents.go — renderInspect, which correctly computes mcpDisabled from override.MCP.Enabled for display purposes.
cmd/bbox/agents_receipt.go — buildReceiptAgent, same per-agent mcpDisabled computation for the JSON receipt.
pkg/domain/config — the per-agent MCP override resolution (ResolveMCPConfig or similar) may already have the right logic for the display path; the gap is that the runtime wiring in main.go doesn't call the same resolution before deciding whether to start the proxy for a given agent.
Suggested fix direction
Ensure the runtime MCP proxy setup consults the same effective per-agent mcp.enabled resolution that inspect/doctor already use, so a custom agent declaring mcp.enabled: false actually skips proxy wiring for that agent's VM, not just its displayed status.
Context
Surfaced by a go-architect review agent while scoping a refactor to deduplicate custom-agent default-resolution logic (MCP authz profile / egress profile) across cmd/bbox/main.go, cmd/bbox/agents.go, and cmd/bbox/agents_receipt.go. That refactor itself was deferred as lower priority; this bug is separate and was split out to track independently.
Summary
Found during review of #210. A custom (bring-your-own) agent can set
mcp.enabled: falsein its config override, and this is correctly reflected inbbox agents inspectand theagents add/doctorJSON receipt (both computemcpDisabledfromoverride.MCP.Enabled). However, the actual runtime MCP proxy wiring incmd/bbox/main.go'sapplyCustomAgentAuthzDefaultpath is only reached inside the block gated by the global MCP toggle (--no-mcp/cfg.MCP.Enabled) — it never consults the per-agentoverride.MCP.Enabledfield.Net effect: a custom agent that declares
mcp.enabled: falsefor itself does not actually get the MCP proxy disabled at VM start time when MCP is globally enabled. The CLI's own display/diagnostic surfaces (inspect,doctorreceipt) show the agent as MCP-disabled, but the runtime behavior disagrees.Where to look
cmd/bbox/main.go— the MCP proxy setup path (applyCustomAgentAuthzDefaultand its caller, gated by the globalmcpEnabledcheck), around main.go:850-900ish (line numbers as of PR Add bbox agents add/init scaffolding (#201) #210; verify current location).cmd/bbox/agents.go—renderInspect, which correctly computesmcpDisabledfromoverride.MCP.Enabledfor display purposes.cmd/bbox/agents_receipt.go—buildReceiptAgent, same per-agentmcpDisabledcomputation for the JSON receipt.pkg/domain/config— the per-agent MCP override resolution (ResolveMCPConfigor similar) may already have the right logic for the display path; the gap is that the runtime wiring in main.go doesn't call the same resolution before deciding whether to start the proxy for a given agent.Suggested fix direction
Ensure the runtime MCP proxy setup consults the same effective per-agent
mcp.enabledresolution thatinspect/doctoralready use, so a custom agent declaringmcp.enabled: falseactually skips proxy wiring for that agent's VM, not just its displayed status.Context
Surfaced by a go-architect review agent while scoping a refactor to deduplicate custom-agent default-resolution logic (MCP authz profile / egress profile) across
cmd/bbox/main.go,cmd/bbox/agents.go, andcmd/bbox/agents_receipt.go. That refactor itself was deferred as lower priority; this bug is separate and was split out to track independently.