ADR 0013: agent authority levels and complete MCP surface
Status
Accepted (2026-11-02).
Context
The fleet adopted the Agentic Standard v2 (warehouse-docs docs/architecture/agentic-standard.md; fleet rule agents/fleet/agent-authority.md). Two of its requirements touch this context's agent surfaces directly:
- AS-1, authority levels. Every MCP tool and every A2A skill must declare exactly one authority level
L1..L4(no L5) so a caller knows what gating to apply before invoking it: a read isL1(pure read of the context's own state) orL2(a computed recommendation that changes nothing), a write isL3unless an ADR grantsL4. MCP declares it as amcp.Tool.Metaentry under the keycom.warehouse/authority; A2A declares it as a skill tagauthority:L1..authority:L4(a write skill keeps itswritetag). - AS-3, complete surface. An MCP server that offers tools but no resource and no prompt is half a surface: resources give a host bounded context data without a tool call, prompts standardise an operator procedure across clients.
- AS-4, stateless handler. The Streamable HTTP handler must not rely on
Mcp-Session-Id, so it also answers the 2026-07-28 protocol revision's per-request handshake (server/discover) while legacyinitializeclients keep working.
This context's MCP charter is read-only (ADR 0007) and its A2A agent is read-only because MCP is (ADR 0010); the standard does not change that, it annotates and completes the existing surface.
Decision
- Every tool is
L1. The five MCP tools (get_delivery_offer,get_promise,list_promises_by_order,list_promise_books,get_current_policy) are pure reads of this context's own state and change nothing, so each registersMeta: authorityMeta(authorityL1)(the pinned fleet shape: constsauthorityMetaKey = "com.warehouse/authority",authorityL1..authorityL4, andfunc authorityMeta(level string) mcp.Meta, ininternal/adapters/inbound/mcp/authority.go). There is noL2tool: nothing on the surface computes a recommendation, and quoting -- the closest thing -- is a write that stays on REST. There is noL3/L4tool: the charter remains read-only; an amendment of ADR 0007 would precede any write tool.checkToolMetadata(governance) fails the build on a tool withoutMeta[com.warehouse/authority] = "L1". - Both A2A skills carry
authority:L1, the level of the tool each fronts:promise_status(theget_promise/list_promises_by_orderreads) andbook_capacity(thelist_promise_booksread). They keep theirreadtags; neither is a write skill. - One resource, one prompt (AS-3).
promise://books/{nodeId}/{date}is a scoped read-model resource template backed by the sameListPromiseBooksuse case as the tool andGET /promise-books, bounded to one node and one date, served as JSON text -- never a table dump.check_order_promisesis the operator SOP prompt: how to read an order's promises and their judgements, when to consult the node's books, and when to escalate; it names tools but calls none, and hides no write (the surface has none). Resources and prompts areL1by nature and carry no tool Meta. - Stateless Streamable HTTP (AS-4).
Handlerbuilds the handler with&mcp.StreamableHTTPOptions{Stateless: true}: noMcp-Session-Idis issued,server/discoveranswers the 2026-07-28 revision, and a legacyinitializestill answers 200 (verified by raw-POST tests instateless_test.go, which also prove the authority key ridestools/list_meta, and fail if the options revert to nil). Nothing in the adapter relies on cross-call session state. - The fleet sensor guards it.
internal/architecture/mcp_authority_fitness_test.go(unmanaged copy of the warehouse-harness-template sensor) statically proves everymcp.Toolliteral declares a readable level, everya2a.AgentSkillliteral carries oneauthority:Lntag, and the server registers a resource and a prompt. Runtime halves (TestEveryAgentToolDeclaresAuthorityin both inbound adapters) assert the same over the live surfaces. - The golden carries the authority.
testdata/tool_registry.golden.json(the byte-for-byte pin oftools/list) now includes each tool's_metaauthority; the fleet agent catalogue (warehouse-docs) derives levels offline from it.
No behaviour changes: same tool names, arguments, annotations and results; same skills; unknown or misspelt arguments stay rejected; CloudEvents untouched; no auth of any kind.
Consequences
- An MCP client can gate calls by authority before invoking: everything here is
L1, so no gating is ever more than advisory for this context. - The catalogue generator (warehouse-docs
agent-catalogue.py) can publish this server's levels from the golden without dialling it. - Removing the authority Meta, a resource or the prompt now fails the build in two packages (architecture sensor + governance), not just review.
- An amendment of ADR 0007 that adds an
L2recommendation or anL3write tool must reuse the pinned constants and extendwantTools/the golden in the same PR; the sensor already accepts the shapes.