0041. Agent authority levels and attributable assignments
Status
Accepted (2026-11-02). Applies the fleet decision "Agentic Standard v2"
(docs/architecture/agentic-standard.md and the fleet rule
agents/fleet/agent-authority.md in IQVO/warehouse-docs, PR #96) to this
context. Extends ADR 0008 (MCP) and
ADR 0039 (A2A); changes nothing in
ADR 0026.
Context
This context already lets an agent act: assign_labor is a write tool over MCP
and a write skill over A2A. Two things were missing for a delegating agent such
as warehouse-ops-agent to use it responsibly:
- Nothing declared how much an agent may do with a tool. The only signal
was the MCP
ReadOnlyHint/DestructiveHintannotations and the A2Awritetag, which say whether a call changes state, not what level of authority the call represents. - A moved associate could not be traced to the agent that moved them.
LaborAssigned/LaborReassignedwere identical whether a supervisor used the console or an agent acted on a proposal.
Separately, the fleet's MCP servers used the Streamable HTTP handler with its default (stateful) options, which advertises only the 2025-11-25 revision and older, so a client speaking the 2026-07-28 per-request handshake was refused.
Decision
Authority levels, declared where the tool is registered
Authority levels are the strings L1..L4. In this context:
| Surface | Name | Level | Why |
|---|---|---|---|
| MCP | get_staffing_gap | L1 | reads facts |
| MCP | get_workforce_labor_report | L1 | reads facts (registered only when a reports client is wired) |
| MCP | propose_path_heads | L2 | a pure recommendation (ceil(charge/rate)), persists nothing |
| MCP | assign_labor | L3 | changes state |
| A2A | staffing_status | L1 | reads; the optional sizing persists nothing |
| A2A | assign_labor | L3 | changes state; keeps its write tag |
- MCP declares it in the tool's
Metaundercom.warehouse/authority; it is returned verbatim intools/list_meta. - A2A declares it as the skill tag
authority:L<n>. - L4 is not granted here. No ADR in this context lets an agent act without
a human-gated step, so
L4is forbidden.
Two sensors enforce it. TestEveryAgentToolDeclaresAuthority exists in both
adapters (internal/adapters/inbound/mcp and internal/adapters/inbound/a2a):
every registered tool or skill has exactly one valid level, every tool with
ReadOnlyHint=false (or tagged write) is L3, and every read tool is L1 or
L2. The MCP golden testdata/tool_registry.golden gained an authority column,
so a level can only change through a reviewed golden edit. The level is a label
for callers and reviewers; it is not access control and nothing in this
context decides anything from it (the surface stays unauthenticated, like REST,
per the fleet decision).
Stateless MCP
mcp.NewStreamableHTTPHandler now receives
&mcp.StreamableHTTPOptions{Stateless: true}. No Mcp-Session-Id is issued and
the server answers server/discover for the 2026-07-28 revision, while a legacy
initialize (for example 2025-06-18) still answers 200, so existing session
clients keep working. Nothing in this adapter relied on cross-call session
state; a tool that ever needs it takes an explicit, server-minted handle as an
argument. stateless_test.go pins all three wire facts with raw POSTs.
Attributable assignments
assign_labor over MCP and over A2A accepts three optional arguments,
proposalId, approvedBy and agentId: strings, trimmed, at most 128
characters, otherwise rejected with the surface's usual invalid-argument answer.
Strict decoding still rejects every other unknown name, and via is not an
argument.
- A domain value object
shared.Initiatorcarriesvia,proposal_id,approved_byandagent_id; its zero value means "not agent-initiated". - The adapter, never the caller, sets
via(mcpora2a). A call that gives no attribution at all is still marked with itsvia. AssignLabor.ExecuteInitiatedBythreads theInitiatorto the aggregate (LaborAssignment.AssignBy) and onto the event.Executeis unchanged and passes the zeroInitiator, so the REST handler is untouched.- The analytics event data gains
initiated_by, snake_case like the rest of the payload:{"via":"mcp"|"a2a","proposal_id"?,"approved_by"?,"agent_id"?}. It is omitted when absent. It is additive on thev1dataschema: nothing renamed, nothing removed, no CloudEvents extension attribute, and consumers ignore it (the projector reads onlyassociate_id,path_idandto_path_id). - It is stamped on both
LaborAssigned(first assignment) andLaborReassigned(a move). The reallocation this exists for is almost always a move of an associate who is already on a path, which raisesLaborReassigned; attributing onlyLaborAssignedwould leave the main case untraceable.apis/asyncapi.yamldocuments both, with an example each.
The three values are attribution labels, not credentials. They grant nothing, are not verified, and never change whether an assignment is accepted; the domain invariants (certification, single active assignment, no break, shift not ended) decide that exactly as before.
Consequences
- A reviewer can read an agent's reach off the registry, and a new tool cannot ship without declaring a level.
- Because the labels are free-form and unauthenticated,
initiated_byproves which surface made the call (the adapter sets it) but only claims the rest. Treatapproved_byas a record of what the caller said, not evidence. - Facts still travel as CloudEvents on Kafka; MCP still carries tools and A2A still carries delegation. Nothing here adds a producer or a transport.
- The in-process SDK client negotiates the older revision against a default server, so serving 2026-07-28 does not mean the fleet's clients speak it yet.
assign_laboris still not idempotent (see ADR 0039).