Expand description
Who is calling, derived from the request’s credential — identity M4a
(docs/specs/SPEC_AGENT_IDENTITY_CARRIED_NOT_DERIVED_2026_09_23.md
§6.5.3).
A request that carries X-Agent-Token for a token this srv minted is
Caller::Agent with that token’s UID. Anything else is
Caller::Unattributed — the UI, bashwrap, muxsh, a tokenless agent,
a peer srv. This is attribution, never authorization: at the same-user
boundary a request that omits its token cannot be told apart from the UI
(§6.5.1), so nothing here refuses a request. An unknown or foreign-channel
token is counted and treated as absent — an agent deleted while running,
or a token that reached another channel’s srv through a forwarded
environment, keeps working exactly as before.
Derived only for requests that authenticated with the full instance key: a token on a LAN-key request must not lift it to host trust (§6.5.3).
Enums§
- Caller 🔒
- Who a request is attributed to. Inserted into every request’s extensions on the authed and LAN-forward route groups.
- Lookup 🔒
- Resolve the request’s
Caller. Pure, so the rules are testable without a router:tokenis the header value,full_keywhether the request authenticated with the full instance key,lookupthe token index. What the token index said about a token.
Constants§
- AGENT_
TOKEN_ 🔒HEADER - The request header an agent’s MCP sets from its inherited
AGENTMUX_AGENT_TOKEN.
Functions§
- attributed_
uid 🔒 - The UID to persist beside an actor name (identity M4c-1, spec §6.5.9):
the request’s attributed UID, or
""— unknown, never guessed — when the request is Unattributed or carries noCallerat all. - caller_
middleware 🔒 - Inserts
Caller. Layered insideauth_middleware/lan_or_full_auth_middleware; both mark which key authenticated the request (ReactiveAuthVia), and aCalleris derived only when that mark says the full key — a request that reached here unmarked is Unattributed, never assumed full-key (review on #3571). The WebSocket upgrade is always Unattributed (§6.5.3): WebSocket RPC is the UI’s channel, and a token must never ride on it. - derive_
caller 🔒 - handle_
identity_ 🔒fallbacks GET /agentmux/identity/fallbacks— every §9.2 counter and the two live gauges (§6.5.6). The phase gates read this: M4d and M5 wait forlive.tokenless_or_unknownto reach zero and for the fallback counters to stop moving. Read-only; auth-gated like every loopback route.