Skip to content

Give helper agents broker MCP tools #2556

Closed as not planned
Closed as not planned

Description

@ChrisJBurns

Depends on: #2555, #2536
Removes shortcut: main agents only; helper agents have no broker MCP tools (#2451; #2555 registers helpers, this ticket completes the removal)

Problem

In broker mode, helper agents (subagents, team members, parallel branches) get no broker MCP tools, so they cannot make protected MCP calls. The design gives them those tools: helper sessions share the root's broker session, and step (6)'s worked example is a helper's gateway call.

Design

What

The broker's tools are added only to the main agent's catalog (internal/app/catalog.go); helper catalogs are built separately, and clearGlobalMCPForBroker (internal/app/build.go) removes the global fallback.

  • Pass the broker tools into helper catalogs (the subagent, team, and parallel builders in internal/app/catalog.go and internal/app/build.go), subject to the harness's existing delegation restrictions. The broker's definition ceiling check comes with the authority work (mcp-authorization.md, "Definition-derived ceiling").
  • Each helper call presents the helper's own credential, registered by Helper agents: their own registered identity and broker MCP tools #2555. The MCP broker check (MCP broker authorizes gateway calls and sends them to the configured gateway #2536) captures the acting and root session before the call begins and looks up the credential by (root session, acting session) in the shared holder (internal/agentcredential); today only main agents are stored, so a helper's lookup fails closed. This ticket makes helpers' credentials available there through Helper agents: their own registered identity and broker MCP tools #2555's registration.
  • Fail closed until registered. A helper whose registration is not held makes no gateway call: the call fails closed and never presents the main agent's credential.
  • A test pins the behavior: a registered helper's call carries its own identity; an unregistered helper's call is refused without any exchange.

Why after #2555: helper credentials only exist once #2555 registers helpers; until then #2536 refuses a helper's gateway call (identity_unavailable) rather than sending it under the main agent's credential. AS-1 would not catch it: its check 8 only compares the agent's session owner with the grant's user, which is the same user. Check 8 at the broker does not catch it either: the main agent's credential is registered to the same broker session. The guard is Mecatl's: a helper with no registration it holds makes no call. The broker-side backstop is #2557's run record, which binds the helper's run to the helper (step (6) check 4).

How it fits

Helpers can use the user's connected accounts through the gateway, and each call is attributed to and checked against the helper that made it.

Done when

In broker mode, helpers make broker MCP calls that are checked and attributed to them; an unregistered helper's call fails closed and never uses the main agent's credential; tests pin both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions