Expand description
Which websocket connection may call which command, decided at dispatch.
The instance key opens /ws, and a native agent has it in its environment, so holding it proves nothing
about who is calling. A command is the AgentMux window’s alone unless backend::rpc::action_access lists it:
- a connection the host proved is the window (
RpcContext::operator_proven_now) calls anything; - any connection calls an open command (
OPEN: reads the window shows anyone who can open it, and the calls the handler itself decides per caller); - a connection registered as an agent reaches only the open commands and the ones whose handler checks the
pane (
OWN_PANE); everything else is refused, whatever the agent’s own rules say; - any other connection is refused with the words the app matches to prove the connection again.
A headless srv with no registered external host and no sign-in of its own has nothing that could vouch for a
connection, so it admits an unproven one and logs once per connection (the same fallback as the composer’s
agentinput, agent_handlers::composer_origin); with either present the guard is strict.
A dev build runs the guard like any other. AGENTMUX_DEV_OPEN_RPC=1, given when a dev instance is started, turns
it off for the harnesses in tools/tests that drive an unproven connection; any other mode ignores it.
Structs§
- Mode 🔒
- What the decision reads besides the call: how this srv was started.
Enums§
- Verdict 🔒
Constants§
- DEV_
SWITCH 🔒 - The environment variable that turns the guard off, in a dev build only.
Functions§
- decide 🔒
- dev_
open_ 🔒from - The switch counts only in a dev build.
- guard_
with 🔒 - install 🔒
- Guard
engine’s connection. The unproven-admission is logged once for this connection. - live_
mode 🔒 - mode 🔒
- How this srv was started, read once.