ADR 0018: Agent authority levels and complete MCP surface
Status
Accepted (2026-11-02). Amends ADR 0005 (the
read-only MCP charter — unchanged: no write tool, ever) and
ADR 0016 (the read-only A2A agent, which
gains only a tag). Implements the fleet's Agentic Standard v2
(AS-1, AS-3, AS-4) as pinned in the warehouse-docs decision page and the
agent-authority fleet rule; reference implementation workforce-management
(PR #235, ADR 0041).
Context
The fleet is standardising what an agent call declares about itself so a caller (model host, ops-agent, human approving a delegation) can gate it without inspecting behaviour:
- AS-1 authority levels. Every MCP tool declares a level in its
mcp.Tool.Metaunder the keycom.warehouse/authority; every A2A skill carries the same level as anauthority:Lntag. Levels areL1(pure read of this context's own state),L2(computed recommendation, changes nothing),L3(state change; caller accountable) andL4(an ADR-granted envelope above L3 — none here). - AS-4 stateless MCP transport. The Streamable HTTP handler stops issuing
Mcp-Session-Id, so the 2026-07-28 protocol revision's per-request handshake (server/discover) is answered while legacyinitializeclients keep working. - AS-3 complete surface. An MCP server that offers only tools is half an agent surface: it also offers at least one resource (scoped read model, no table dumps) and one prompt (the operator SOP).
inbound-receiving's MCP charter is read-only (ADR 0005): seven read tools, no write use case wired, governance tests that fail the build on a write-verb tool name. F3 (ASN auto-close over MCP) is explicitly deferred fleet-wide.
Decision
- Every tool is
L1. All seven tools (get_asn,list_asns,get_appointment,list_appointments,get_receipt,list_receipts,list_docks) are pure reads of this context's own state; none computes a recommendation, so none isL2, and the charter bars writes, so none isL3/L4. Each registersMeta: authorityMeta(authorityL1)through the fleet-pinned helper (authorityMetaKey+authorityL1constants), whichtools/listreturns verbatim in_meta. Only theL1constant exists: theunusedsensor rejects constants nothing references, and anL2/L3tool cannot be registered here; the constant is added together with the tool on the day an ADR 0005 amendment ever charters one. - Both A2A skills are
authority:L1.asn_receiving_statusanddock_schedulefront composed reads (GetAsn+ListReceipts,ListAppointments), so they carry the same level as the tools they front. They keep theirreadtag; nowritetag exists in this context. - The handler is stateless.
Handlerbuilds the handler withmcp.StreamableHTTPOptions{Stateless: true}. Nothing in this adapter holds cross-call session state (it never did: every call is one use-case read). Raw-POST tests pin the wire facts:server/discoveradvertises2026-07-28with no session id,tools/listcarries the authority key, and a legacyinitialize(2025-06-18) still answers 200. - One resource.
warehouse://inbound/receipts/{receiptId}— exactly one receipt (the sameGetReceiptread model and JSON asget_receipt), never a dump of a table. A malformed or non-matching URI is rejected, not defaulted; an unknown id surfaces thereceipt-not-foundslug. Resources are reads by nature and need no tool Meta. - One prompt.
receive_inbound_shipment— the operator SOP for working an inbound shipment: read the ASN, find the dock window, follow the receipts and their discrepancies, and escalate closure, claims and cancellations to humans (this surface is read-only; the SOP names tools and never performs a write). - The registry golden carries the level.
testdata/tool_registry.golden.jsonis regenerated and now pins_meta: {"com.warehouse/authority": "L1"}on every tool, so a level change is a reviewed golden update. - A static fitness sensor enforces it. The harness template's
internal/architecture/mcp_authority_fitness_test.gois copied verbatim (its only addition is themcpAdapterDirconstant, which this repo'smcp_optional_inputs_test.govariant does not define): everymcp.Toolliteral must declare a readable level, a write tool must beL3+ (an ADR comment forL4), everya2a.AgentSkillliteral needs exactly oneauthority:Lntag, and tools-only servers fail until a resource and a prompt exist (no.agent-surface-pendingmarker here: the surface is complete).
Consequences
- A model host can gate every tool and skill of this context as a pure read
(
L1); nothing on the agent surface changes state, matching the charter. - Clients that rely on
Mcp-Session-Idsee it disappear; no caller of this server did (its clients negotiate per-request or re-initialize), and the legacyinitializepath keeps answering, verified by the raw-POST tests and the existing Streamable HTTP integration tests. - Adding any tool, resource, prompt, skill or authority change now trips the golden, the governance tests and the authority sensor — all three must move together, in one reviewed PR.
- Writes stay where ADR 0005 put them: REST, idempotency key, version guard,
transactional outbox, CloudEvents. If the fleet ever charters F3 (ASN
auto-close), that is a new ADR amending 0005, an
L3declaration withinitiated_byattribution, and a governance/golden update — not a quiet edit here.