Skip to content

Helper agents: their own registered identity and broker MCP tools #2555

Closed

Description

@ChrisJBurns

Depends on: #2527 (per-agent registration and identities)
Removes shortcut: Main agents only; helper agents have no broker MCP tools (#2451)
Adds shortcut: helpers have no nesting limit, and definitions the broker did not load are refused. #2551 removes both.

Problem

Helper agents (subagents, parallel branches and team members) are created inside the engine. They are never registered and get no broker MCP tools, so they cannot make gateway calls. The design gives each helper its own identity, registered to the root's broker session with its creating agent as parent, and lets it call gateway tools under that identity.

Implements

Scope

  • mecak8s registers each helper before its first tool call, at the point where child sessions are created.
    • Engine events are notifications and carry no security.
    • An unavailable broker is retryable. An unregistered helper never starts.
  • If the registration hook goes in the engine, it changes the published engine API and lands first, as its own PR.
  • Helper credentials are held per session tree and renewed per helper. They are dropped as a unit wherever the root's credential is dropped today.
  • Helpers get the broker's MCP tools, within the harness's existing delegation restrictions. If mecak8s holds no registration for a helper, that helper makes no gateway call and never presents its parent's credential.
  • Members of a team rooted in a session register as helpers, with the root's main agent as parent.
  • The per-agent tool limit is Per-agent tool limit, checked by the broker #2842. Runs and delegation reports are Runs, delegations, and the run owner #2557.
  • API compatibility: the PR includes the wire API compatibility statement.

Decide before starting

  • D5: how does the broker check a child's host session? Check 7 refuses a reused incarnation that comes with a different host session or parent. Nothing yet refuses a new child whose host session is outside the tree. Proposed on Per-agent registration and identities, switched on #2527: mecak8s reports the parent's host session, and the broker compares it with the parent's record.
  • Which definition does a parallel branch or a team member register with? The design names system/explorer only for the default anonymous child (Loading definitions).
  • How does a team created without a source session get a broker session? It could get its own, opened for the team's owner when it runs, or every team could be required to belong to a session.

Done when

  • Every helper, including each member of a team rooted in a session, is registered with the correct parent before its first tool call. A failed registration stops the helper from starting.
  • A helper's gateway call is checked against the helper and attributed to it. An unregistered helper's call is refused with no exchange.
  • After the broker session reopens, live helpers register again, parents first, and keep their ag_ identifiers.
  • The D5 rule is tested.

Earlier notes: #2556 (closed, merged here).

Activity

  1. changed the title [-]Register helper agents as they are created[/-] [+]Helper agents: their own registered identity and broker MCP tools[/+] on Nov 18, 2026
  2. ChrisJBurns commented on Nov 18, 2026

    @ChrisJBurns
    ContributorAuthor

    Design decision for this ticket: Three registration rules: (1) D5, how the broker checks that a new child's host session belongs to the tree (proposed on #2527: mecak8s reports the parent's host session and the broker compares it); (2) which definition parallel branches and team members register with (the design names system/explorer only for the default anonymous child); (3) how a team created without a source session gets a broker session.

    Where it goes: agent-definitions.md: Registering instances.

    Decide it when this ticket is picked up, and record the answer as a small design edit (reviewed by the design's author) before or with the ticket's first PR.

  3. rdimitrov commented on Nov 20, 2026

    @rdimitrov
    Member

    Decisions for #2555, proposed

    #2555 lists three decisions to settle before it starts. Below is a proposal for each, based on the design and on how the harness creates helpers today.

    1. How the broker checks a new child's host session (D5)

    Today nothing links a child's host session to its tree. Check 4 covers only a registration with no parent, and check 7 covers only an incarnation registered before. A new child can therefore name any host session (RegisterAgentRequest.HostSessionID says "checking that it belongs to the session's tree will be addressed later").

    Proposal, as on #2527:

    • The child's registration also reports its parent's host session, the one its session was created under.
    • Before it records a new child, the broker checks that this equals the parent instance's recorded host session. A mismatch is PERMISSION_DENIED, like checks 3 and 4.

    This closes the gap by induction. Each child is tied to its parent's host session, the parent is registered to the same broker session (check 4), and the chain ends at the root host session that check 4 pins. A depth cap or root check is not needed for this.

    It is still a mecak8s assertion, like the rest of registration. It catches a mecak8s bug that attaches a child to the wrong parent or tree, not a compromised mecak8s.

    The related question on #2527 is now moot. It asked whether to refuse a reused incarnation under another SPIFFE ID. IDs are opaque since #2834, and the broker keys agents by incarnation, so one incarnation has one ag_ identifier. Check 7 already refuses a reused incarnation with another host session or parent.

    Where it goes: one sentence in step (4), check 4: "With a parent, the parent is registered to A42, and the reported parent host session is the parent's recorded host session." Plus the same in "Registering instances".

    The field is on the in-process broker API, not a client-facing wire change.

    2. Which definition each helper registers with

    No child session records a definition today. What each helper runs:

    Helper Runs Proposed reference
    Subagent naming an agent That AgentDef global/<name> if the broker loaded it, otherwise name only (refused until #2551), as for main sessions in #2527
    Subagent naming none The def-less read-only explorer system/explorer, as the design already says
    Parallel branch A def-less engine: the explorer's tools plus Edit and Write on its own fork, with the main prompt New built-in system/branch
    Team member with agent_type That AgentDef global/<name> if loaded, otherwise name only
    Team member without agent_type The def-less generic member engine New built-in system/member

    Why new built-ins rather than reusing system/explorer or the parent's definition:

    • A branch can write, and a generic member has its own tool set. Labeling either system/explorer would make audit records claim a read-only explorer did the work. Once ceilings land, the explorer's ceiling would also be the wrong bound for them.
    • Neither runs the parent's definition, so naming it would be wrong too.
    • A built-in costs one entry in the loader's built-in list (next to main and explorer). It follows the same rules as other built-ins: the release is its source and revision, and its name grants nothing.
    • The effective ceiling is still bounded by the parent, so the new names cannot widen authority.

    Where it goes: the system/explorer sentence in Loading definitions gains the two new built-ins.

    3. A team with no source session

    The design says a session with no owner gets no broker session. The question is what a team with no source session gets.

    Today, in production, every team has a source session. HTTP and gRPC both create teams through CreateTeamForSession, which requires one, and the in-run Team tool runs inside a session. The only path without one, CreateTeamOnDefaultPlacement, has no production caller.

    Proposal: every team that makes gateway calls belongs to a session's tree. A team with no source session gets no broker session, and its members' gateway calls fail closed. No team-owned broker session.

    • It matches the design's rule for sessions without a broker session, and adds no root kind, root eligibility rule, or owner rule for teams.
    • A team-owned broker session would need a root definition for the team and a decision on whose grant it uses. Nothing needs it today.
    • If one is needed later, it is additive.

    Implementation note for #2555: members of a team created through CreateTeamForSession have no ParentSessionID; the root exists only in the server's team state and the run context. Their parent is the root's main agent (as #2555 says), so mecak8s reports the root host session as the parent host session for D5. Team-tool teams already record the calling session as ParentSessionID.

    Where it goes: one sentence in Relationships and lifetimes, after "A session with no owner gets no broker session".

    If these look right, I'll record them as a small design PR and link it from #2555.

  4. self-assigned this
    on Nov 20, 2026
  5. added 4 commits that reference this issue on Nov 20, 2026
    910c9d7
    1c2dd83
    ff398e7
    e66b315
  6. rdimitrov commented on Nov 20, 2026

    @rdimitrov
    Member

    Outcome of the decisions and choices

    • The three "Decide before starting" items were proposed in this comment and feat(identitybroker): register each helper agent under its parent #2913 implements them and records them in the design: D5 (a child reports its parent's host session, the broker compares it with the parent's record), system/branch and system/member for def-less helpers, and no broker session for a team with no source session. They still need the design author's review.
    • Engine seam. feat(engine): let a child store admit each child it publishes #2912 adds port.ChildSessionCreator (first publication, with the definition the child runs) and port.ChildSessionResumer (resume). A team member reports the definition its factory actually built it from (MemberBuild.DefinitionName), so an unknown agent type still falls back to a generic member.
    • Resumed helpers are admitted again: a held credential is kept; one with none registers as a new helper. Because the engine resumes every subagent on the default explorer, a named helper whose credential is gone is refused on resume until Sessions run and register the exact definition revision #2548.
    • Reopened broker sessions: run entry re-registers the tree's helpers, parents first, keeping their identities.
    • Members of a team created over the API register with the root's main agent as a stand-in creation parent (their sessions record none); the design says so.
    • Broker tools (approved choices): def-less helpers get only gateway routes; API-created teams' generic members get the root's gateway tools limited to the root's bound authority (only when the root's broker attachment is resident in the process and the root has a bound authority; a root that cannot be loaded fails the team's start); helpers that run a named definition get none until Per-agent tool limit, checked by the broker #2842.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions