Skip to content

IPC catalog

This document catalogs every inter-process channel in AgentMux, their wire contracts, authentication models, and security properties. It is intended as both a developer reference and a security audit anchor point.


  1. Architecture Overview
  2. Channel Summary Table
  3. Channel A: Renderer → Host Local IPC (HTTP)
  4. Channel B: Host → Renderer Event Push (CEF JS Bridge)
  5. Channel C: Host ↔ Launcher Named Pipe
  6. Channel D: Host → Srv Named Pipe (Read-only Bridge)
  7. Channel E: Renderer ↔ Srv WebSocket (RPC)
  8. Channel F: Renderer → Srv HTTP Service
  9. Channel G: Browser DOM API (HTTP over IPC)
  10. Channel H: OSC 16162 — Terminal Shell Integration Escape Sequences
  11. Channel I: Chromium Remote Debug Port (CDP)
  12. IPC Token and Auth Key — Lifecycle and Leak Surface
  13. Launcher ↔ Srv Named Pipe (Reducer Bus)
  14. Command/Event Domain Mixing in crates/common/src/ipc.rs
  15. Environment Variable Contract
  16. Security Findings Cross-Reference

IPC architecture: launcher (top-left, purple) connects bidirectionally to cef (top-right) via Ch C named pipe, and to srv (bottom-left) via Ch 13. CEF connects to renderer via Ch D (read-only) and Ch A/B (bidirectional dashed). Srv connects to renderer via Ch E/F WebSocket.

Process hierarchy (production):

agentmux-launcher.exe (owns Win32 Job Object J0)
└── agentmux-cef.exe (CEF host, IPC client)
└── [CEF subprocesses: renderer, GPU, plugin]
└── agentmux-srv.exe (backend sidecar, HTTP/WS server)

IDNameTransportDirectionAuthPurpose
ALocal IPC HTTPHTTP POST 127.0.0.1:<rnd>renderer→hostBearer ipc_tokenAll host command dispatch
BCEF JS event pushframe.execute_javascript()host→renderernone (same process trust)Push typed events to frontend
CLauncher named pipe / Unix socketNamed pipe (Win) / Unix sockethost↔launchernone (OS pipe ownership)Window state mirror, saga dispatch, WRR
DSrv named pipe bridgeNamed pipe (Win) / Unix sockethost←srv (read-only)none (OS pipe ownership)Forward srv reducer events to renderer
ESrv WebSocket RPCWS ws://127.0.0.1:<rnd>/wsrenderer↔srv?authkey= query param (WS-only)RPC commands, event bus subscription
FSrv HTTP serviceHTTP POST 127.0.0.1:<rnd>/agentmux/servicerenderer→srvX-AuthKey headerObject CRUD, tab/block/workspace ops
GBrowser DOM APIHTTP POST 127.0.0.1:<rnd>/agentmux/browser/*renderer→hostBearer ipc_tokenCSS query, JS eval, screenshot, click, key in browser panes
HOSC 16162Terminal escape sequence (PTY output)shell→renderernone (data in PTY stream)Inject env keys into block metadata; configure poller
IChromium remote debugHTTP/WS 127.0.0.1:9222 (prod) / 9223 (dev), or a free port. Off in release builds unless AGENTMUX_CDP_PORT turns it onany local process→renderernoneExternal CDP tooling and test harnesses. Not used by the Browser DOM API
13Launcher↔Srv named pipeNamed pipe (Win) / Unix socketlauncher↔srvnone (OS pipe ownership)Srv reducer Command/Event bus

3. Channel A: Renderer → Host Local IPC (HTTP)

Section titled “3. Channel A: Renderer → Host Local IPC (HTTP)”

Source: crates/cef/src/ipc.rs

Axum HTTP server bound to 127.0.0.1:0 (random ephemeral port). Port is written to <data_dir>/ipc-port-<hash> file as <port>:<token> after CEF init. File is owner-readable only on Unix (0600); no Windows DACL restriction on the port file itself (only on authkey.dev).

Routes:

  • POST /ipc — main command handler (ipc.rs)
  • GET /health — unauthenticated health check (ipc.rs)
  • POST /agentmux/browser/* — Browser DOM API (see Channel G)

Authorization: Bearer <ipc_token> header required on POST /ipc (ipc.rs).
ipc_token is a random UUID generated once per host process.

Gap: CorsLayer::permissive() is applied (ipc.rs), accepting any Origin header. Any web page that guesses or reads the port can make unauthenticated cross-origin preflight-exempt requests (OPTIONS is ignored by the auth check) and then authenticated ones if it has obtained the token.

JSON body: {"cmd": "<command_name>", "args": <JSON>}
Response: {"success": bool, "data": <JSON>|null, "error": string|null} always HTTP 200 (even for errors; frontend checks success field). (ipc.rs)

Every command the host handles is dispatched through route_command (crates/cef/src/ipc.rs). The catalog below is generated from it, not written by hand: node scripts/gen-ipc-catalog.mjs --code <agentmux checkout> --page src/content/docs/internals/ipc-catalog.md --write rewrites it, and the PR check fails when a pin bump leaves it different from the code.

This catalog is generated from the match cmd of route_command and from is_stub_command: 192 commands the host handles, and 11 names it accepts and ignores. The note is the comment directly above the command’s arm in the code. First call is the first function the arm calls, leaving out library calls, tracing and precondition checks. It is where to start reading, not always the call that does the work: an arm that sets something up first (browser_pane_create) shows the setup call. Argument and return shapes are not listed: they are in the code the arm calls.

Runs says where the arm works: inline on the IPC request task, async when the arm awaits, blocking when it hops to a blocking thread (spawn_blocking). Args says whether the arm passes the request’s arguments on.

Tier 1: Bootstrap (must work for frontend to load)

Section titled “Tier 1: Bootstrap (must work for frontend to load)”
CommandFirst callRunsArgsNote
get_platformcommands::platform::get_platforminline—
get_window_systemcommands::platform::get_window_systeminline—
get_window_button_layoutcommands::desktop_settings::get_window_button_layoutinline—
get_auth_keyin the arminline—
get_is_devcommands::platform::get_is_devinline—
get_zoom_factorcommands::window::get_zoom_factorinline—
get_about_modal_detailscommands::platform::get_about_modal_detailsinline—
get_host_infocommands::platform::get_host_infoinline—
get_backend_endpointscommands::backend::get_backend_endpointsinline—
get_mux_init_optscommands::backend::get_mux_init_optsinline—
set_window_init_statuscommands::backend::set_window_init_statusinlineyes
report_first_paintcommands::backend::report_first_paintinlineyes
fe_logcommands::backend::fe_loginlineyes
fe_log_structuredcommands::backend::fe_log_structuredinlineyes
fe_log_batchcommands::backend::fe_log_batchinlineyes
CommandFirst callRunsArgsNote
get_backend_infocommands::backend::get_backend_infoinline—
get_health_signalshealth_signals::snapshotinline—
restart_backendcommands::backend::restart_backendasync—
close_window, close_request_seencommands::window::close_commandinlineyes
quit_appcommands::window::quit_appinline—Issue #2977 Workstream 1 — the tray’s “Quit AgentMux”. Explicit, user-initiated shutdown that bypasses the background-service gate (see quit_app’s doc for why the ordinary last-window path and Event::HostShouldQuit both cannot serve here).
open_panelcommands::window::open_panelinline—Issue #2977 WS3 — the tray panel: a small top-level window, pool-first.
set_taskbar_attentioncommands::taskbar_attention::set_taskbar_attentioninlineyesTaskbar badge + flash for “agents need you” (SPEC_OS_NOTIFICATIONS _SYSTEM_2026_09_24 Phase 4).
autostart_status, autostart_open_login_itemscommands::autostart::routeasync—Settings UI → launcher auto-start verbs (SPEC_OS_NOTIFICATIONS_SYSTEM _2026_09_24 §4.1). Kept separate from background mode on purpose — tray spec §7.4.
background_audit_takebackground_audit::background_audit_takeinline—Issue #2977 WS4 — hand the frontend whatever the background service did while no window was open, so it can tell the user.
incidents_listcommands::incidents::incidents_listinline—What went wrong and what AgentMux did about it (SPEC_RECOVERY_NOTICES_AND_TOASTS §4.2).
incident_acknowledgecommands::incidents::incident_acknowledgeinlineyes
set_host_keysclient::host_keys::set_host_keysinlineyesThe keys the app wants forwarded out of a focused browser pane (SPEC_KEYBOARD_SHORTCUTS_SETTINGS §7).
set_menu_keysclient::menu_keys::set_menu_keysinlineyes
minimize_windowcommands::window::minimize_windowinlineyes
maximize_windowcommands::window::maximize_windowinlineyes
toggle_floating_maximizecommands::window::toggle_floating_maximizeinlineyes
set_floating_always_on_topcommands::window::set_floating_always_on_topinlineyes
set_modal_opencommands::window::set_modal_openinlineyes
set_zoom_factorcommands::window::set_zoom_factorinlineyes
is_main_windowcommands::window::is_main_windowinlineyes
get_window_labelcommands::window::get_window_labelinlineyes
open_new_windowcommands::window::open_new_windowinlineyes
open_linkcommands::deeplink_open::open_linkinlineyes
open_restored_windowcommands::window::open_restored_windowinlineyes
open_subwindowcommands::window::open_subwindowinlineyes
recycle_begincommands::recycle::recycle_beginasyncyesA window recycling its renderer (commands/recycle.rs): the old page begins it, the new one takes its cover picture while it boots.
recycle_cancelcommands::recycle::recycle_cancelinlineyes
recycle_declinedcommands::recycle_governor::recycle_declinedinlineyes
take_reload_snapshotcommands::recycle::take_reload_snapshotinlineyes
capture_window_viewportbrowser_api::routes::capture_window_viewportasyncyes
open_floating_pane_windowcommands::floating_pane::open_floating_pane_windowblockingyes
get_pane_debug_statecommands::floating_pane::get_pane_debug_stateinline—
debug:hang_uiui_tasks::post_hang_ui_threadinline—
get_instance_numbercommands::window::get_instance_numberinlineyes
register_backend_windowcommands::window::register_backend_windowinlineyes
get_envcommands::platform::get_envinlineyes
open_externalcommands::platform::open_externalinlineyes
reveal_in_file_explorercommands::platform::reveal_in_file_explorerinlineyes
show_open_file_dialogcommands::platform::show_open_file_dialogasyncyes
show_open_bundle_dialogcommands::platform::show_open_bundle_dialogasyncyes
show_save_layout_dialogcommands::platform::show_save_layout_dialogasyncyes
show_open_layout_dialogcommands::platform::show_open_layout_dialogasyncyes
set_window_transparencycommands::window::set_window_transparencyinlineyes
set_window_opacitycommands::window::set_window_opacityinlineyes
get_window_opacitycommands::window::get_window_opacityasyncyes
start_window_dragcommands::window::start_window_draginlineyes
get_window_rectcommands::window::get_window_rectinlineyes
set_window_rectcommands::window::set_window_rectinlineyes
get_window_positioncommands::window::get_window_positionblockingyes
is_window_maximizedcommands::window::is_window_maximizedblockingyes
resolve_window_at_cursorcommands::window::resolve_window_at_cursorblockingyes
update_floating_redock_hovercommands::window::update_floating_redock_hoverblockingyes
clear_floating_redock_hovercommands::window::clear_floating_redock_hoverinlineyes
set_floating_redock_targetcommands::window::set_floating_redock_targetinlineyes
set_floater_fadecommands::window::set_floater_fadeinlineyes
get_floating_redock_targetcommands::window::get_floating_redock_targetinlineyes
move_window_bycommands::window::move_window_byinlineyes
set_window_positioncommands::window::set_window_positioninlineyes
toggle_devtoolscommands::window::toggle_devtoolsinlineyes
inspect_element_atcommands::window::inspect_element_atinlineyes
begin_gpu_tracecommands::window::begin_gpu_traceinlineyesDev-only memory-infra GPU tracing (#2218 diagnostics) — see docs/specs/SPEC_GPU_MEMORY_TRACING_SCAFFOLDING_2026_07_24.md.
end_gpu_tracecommands::window::end_gpu_traceinlineyes
show_context_menuin the arminline—
CommandFirst callRunsArgsNote
start_cross_dragcommands::drag::start_cross_draginlineyes
update_cross_dragcommands::drag::update_cross_draginlineyes
complete_cross_dragcommands::drag::complete_cross_draginlineyes
cancel_cross_dragcommands::drag::cancel_cross_draginlineyes
claim_cross_drag_targetcommands::drag::claim_cross_drag_targetinlineyes
get_cursor_pointcommands::drag::get_cursor_pointinline—
get_mouse_button_statecommands::drag::get_mouse_button_stateinline—
set_drag_cursorcommands::drag::set_drag_cursorinline—
restore_drag_cursorcommands::drag::restore_drag_cursorinline—
release_drag_capturecommands::drag::release_drag_captureinline—
set_js_drag_activecommands::drag::set_js_drag_activeinlineyes
open_window_at_positioncommands::drag::open_window_at_positioninlineyes
tear_off_pool_promotecommands::drag::tear_off_pool_promoteblockingyes
pool_window_readycommands::drag::pool_window_readyinlineyes
start_tab_drag_trackingcommands::drag::start_tab_drag_tracking_blockingasyncyes
stop_tab_drag_trackingcommands::drag::stop_tab_drag_tracking_blockingasync—
live_follow_begin, live_follow_end, live_follow_resize, live_follow_capture, live_follow_quiet, live_follow_fade, capture_pane_picture, cut_pane_picture, debug_native_window_picturecommands::live_follow::routeasyncyes
pane_pool_window_readycommands::drag::pane_pool_window_readyinlineyes
tear_off_sc_move_handshakecommands::drag::tear_off_sc_move_handshakeblockingyes
list_windowscommands::window::list_windowsinline—
list_window_instancescommands::window::list_window_instancesinline—
get_double_click_timecommands::window::get_double_click_timeinline—
focus_windowcommands::window::focus_windowblockingyes
close_window_by_labelcommands::window::close_window_by_labelinlineyes

Vault (the Vault pane’s host-side operations; vault_op is further down)

Section titled “Vault (the Vault pane’s host-side operations; vault_op is further down)”
CommandFirst callRunsArgsNote
vault_revealcommands::vault::revealasyncyes
vault_copycommands::vault::copyasyncyes
vault_exportcommands::vault_files::exportasyncyes
vault_importcommands::vault_files::importasyncyes
vault_import_deletecommands::vault_files::delete_pickedasyncyes

Clipboard (CEF can’t use navigator.clipboard without permission policy)

Section titled “Clipboard (CEF can’t use navigator.clipboard without permission policy)”
CommandFirst callRunsArgsNote
read_clipboardcommands::clipboard::read_clipboardinline—
write_clipboardcommands::clipboard::write_clipboardinlineyes
write_clipboard_imagecommands::clipboard_image::write_clipboard_imageinlineyes
read_clipboard_attachmentscommands::clipboard::read_clipboard_attachmentsinline—
CommandFirst callRunsArgsNote
set_provider_authcommands::providers::set_provider_authasyncyes
run_cli_logincommands::cli_login::run_cli_loginasyncyes
cancel_cli_logincommands::cli_login::cancel_cli_logininline—
get_cli_login_statuscommands::cli_login::get_cli_login_statusinline—
open_login_terminalcommands::cli_login::open_login_terminalinlineyes
ensure_settings_filecommands::platform::ensure_settings_fileinline—
open_in_editorcommands::platform::open_in_editorinlineyes
open_in_file_managercommands::platform::open_in_file_managerinlineyes
copy_file_to_dircommands::providers::copy_file_to_dirblockingyesspawn_blocking: a folder or a large file copies for seconds.
consume_drag_paths, peek_drag_paths, register_file_dragcommands::file_drag::ipcinlineyesThe drag IPCs: the paths of an OS drag into a window (drag_stash.rs) and the files a drag out will carry.
CommandFirst callRunsArgsNote
run_commandcommands::palette::run_commandinlineyes
CommandFirst callRunsArgsNote
open_agentcommands::palette::open_agentinlineyes
CommandFirst callRunsArgsNote
browser_pane_createbrowser_pane::identity::set_for_blockinlineyes
browser_pane_navigatestate.browser_panes.navigateinlineyes
browser_pane_autocompletestate.browser_panes.autocompleteasyncyes
browser_pane_resizestate.browser_panes.resizeinlineyes
browser_pane_discardbrowser_panes::discard::DiscardOp::parseasyncyes
browser_panes_set_rectsbrowser_panes::bounds::parse_set_rects_argsasyncyes
browser_pane_hibernation_checkbrowser_api::hibernation::Handlers::from_argasyncyes
browser_pane_set_frozenbrowser_api::hibernation::set_frozenasyncyes
browser_pane_memorybrowser_api::hibernation::pane_memoryasyncyes
memory_pressure_levelmemory_pressure::current_levelinline—
browser_pane_closebrowser_pane::auth::cancel_for_blockinlineyes
browser_pane_go_backstate.browser_panes.go_backinlineyes
browser_pane_go_forwardstate.browser_panes.go_forwardinlineyes
browser_pane_reloadstate.browser_panes.reloadinlineyes
browser_pane_find, browser_pane_stop_findstate.browser_panes.run_find_commandinlineyes
browser_pane_stopstate.browser_panes.stopinlineyes
browser_download_cancel, browser_download_startclient::downloads::run_commandinlineyes
browser_pane_printstate.browser_panes.printinlineyes
browser_pane_view_sourcestate.browser_panes.view_sourceinlineyes
browser_pane_inspect_elementstate.browser_panes.inspect_elementinlineyes
browser_pane_copystate.browser_panes.copyinlineyes
browser_pane_cutstate.browser_panes.cutinlineyes
browser_pane_pastestate.browser_panes.pasteinlineyes
browser_attention_resolveclient::backend_browser_attentionblockingyes
browser_bypass_setclient::backend_browser_bypassblockingyes
browser_pause_setclient::backend_browser_pauseblockingyes
widget_approval_decideclient::backend_widget_approvalblockingyes
vault_opclient::backend_vaultblockingyes
google_opclient::backend_googleblockingyes
app_update_actionclient::backend_app_updateblockingyes
store_update_install, store_update_check, store_update_came_back, store_update_restart, store_update_working, store_update_raisecommands::store_update::runasyncyes
upgrade_request_decideclient::backend_upgrade_requestblockingyes
desktop_request_decideclient::backend_desktop_requestblockingyes
desktop_stopclient::backend_desktop_stopblockingyes
operator_attestclient::backend_operator_attestblockingyes
browser_pane_set_badgebrowser_pane::size_badge::handleinlineyes
browser_pane_focusstate.browser_panes.focusinlineyes
browser_popup_show, browser_popup_closeui_tasks::post_show_popupinlineyesShow and Close on an opener’s popup-windows strip (SPEC_BROWSER_PANE_NATIVE_POPUPS_AGENT_DRIVEN_2026_10_08.md §7). Only a live popup window’s label does anything.
browser_pane_auth_submitbrowser_pane::auth::takeinlineyes
browser_pane_auth_cancelbrowser_pane::auth::takeinlineyes
browser_pane_auth_savecredential_broker::save_credentialasyncyes
ssh_approval_decidessh_approval::decideinlineyes
credential_approval_decidecredential_broker::approval::takeasyncyes
browser_panes_set_overlay_clipin the arminlineyes
pane_media_revokebrowser_panes::media_prompt::cancel_pane_any_threadinlineyes
pane_media_permission_respondbrowser_panes::media_prompt::RespondTask::newinlineyes
main_window_focusin the arminlineyes
input_selectinput_owner::registry::apply_selectioninlineyesThe frontend’s one selection request: the app (no block_id) or a pane of window_label takes the keyboard. epoch (one per page load) and seq order them, so one that arrives after a newer one is dropped. SPEC_BROWSER_PANE_INPUT_OWNER_2026_10_15.md §3.6.
input_owner_stateinput_owner::registry::reportinlineyesWhether window_label is active and where its keyboard is, as the last input-owner-changed said; null where nothing tracks it yet.

Accepted and answered with null, so a frontend that still calls them does not error. They do nothing (crates/cef/src/commands/stubs.rs).

download_file, quicklook, update_wco, create_workspace, switch_workspace, delete_workspace, set_active_tab, create_tab, close_tab, install_update, is_devtools_open


4. Channel B: Host → Renderer Event Push (CEF JS Bridge)

Section titled “4. Channel B: Host → Renderer Event Push (CEF JS Bridge)”

Source: crates/cef/src/launcher_event_bridge.rs, crates/cef/src/srv_event_bridge.rs

frame.execute_javascript(...) injected by the host into every top-level renderer frame. Not a network channel; runs inside the CEF process boundary.

None. Host process trust. A compromised renderer cannot forge these events; they originate in the Rust host.

Launcher events dispatched as:

window.__agentmux_launcher_event(<JSON Event>)

Srv events dispatched as:

window.__agentmux_srv_event(<JSON Event>)

Event shapes are the agentmux_common::ipc::Event variants serialized to JSON (crates/common/src/ipc.rs).

  • Launcher events: window lifecycle (open/close/pool), instance numbers, WRR drift, saga lifecycle, corrective moves, HostShouldQuit.
  • Srv events: workspace/tab/block CRUD, layout tree mutations, active-tab changes.

5. Channel C: Host ↔ Launcher Named Pipe

Section titled “5. Channel C: Host ↔ Launcher Named Pipe”

Source: crates/cef/src/launcher_ipc/mod.rs, crates/common/src/ipc.rs

  • Windows: Win32 named pipe. Path passed via env var AGENTMUX_LAUNCHER_PIPE. Launcher creates with first_pipe_instance(true).
  • Unix/macOS: Unix domain socket. Same env var name.

Dev mode (task dev without launcher, or host invoked directly): AGENTMUX_LAUNCHER_PIPE is unset; all report_* calls are silent no-ops.

None. OS-level pipe ownership. The host process must be a child of the launcher (enforced by parent_process::parent_is_agentmux_launcher() check before connecting, crates/cef/src/lib.rs).

Newline-delimited JSON. One message per line.

Host → Launcher: agentmux_common::ipc::Command variants (externally tagged: {"cmd":"register",...}).

Launcher → Host: agentmux_common::ipc::HostFrame envelope (Phase CPD-1+). Each frame is tagged with "kind":

  • {"kind":"event","event":"<name>",...} — launcher-emitted Event broadcast
  • {"kind":"command","cmd":"<name>",...} — saga-issued Command dispatched to host
CommandFieldsPurpose
Registerkind, pid, versionHandshake; MUST be first message
PingnonceRound-trip confirmation
Goodbye—Graceful disconnect
ReportWindowOpenedlabel, kind, parent_label?CEF on_after_created fired
ReportWindowClosedlabelCEF on_before_close fired
ReportPoolWindowAddedlabel, saga_id?Pool window spawned
ReportPoolWindowRemovedlabelPool window leaving pool
ReportPoolWindowPromotedlabelPool → user-visible window transition
ReportHostCountswindows, poolDrift detection snapshot
ReportHostPoolCountcountPool-only drift snapshot
ReportBackendWindowIdRegisteredlabel, window_idFrontend register_backend_window
ReportBackendWindowIdUnregisteredlabelWindow closed
ReportHwndOpenedhwnd, class_name, title, label_hint?Win32 EVENT_OBJECT_CREATE
ReportHwndDestroyedhwndWin32 EVENT_OBJECT_DESTROY
ReportHwndVisibilityChangedhwnd, visibleEVENT_OBJECT_SHOW/HIDE
ReportHwndForegroundChangedhwndEVENT_SYSTEM_FOREGROUND
ReportHwndIconicChangedhwnd, iconicEVENT_SYSTEM_MINIMIZE*
ReportHwndPositionChangedhwnd, rectWM_WINDOWPOSCHANGED (50 ms debounce)
ReportMonitorTopologyChangedrectsWM_DISPLAYCHANGE
ReportPanesReapedlabel, saga_id?Browser-pane HWNDs drained
ReportPoolDrainDecisionlabel, was_last, saga_id?Pool-drain-if-last decision
ReportSagaActionFailedsaga_id, reasonSchema-only CPD-1; no producer yet
GetSnapshot—Request full launcher state snapshot
GetSrvSnapshot—Request srv reducer snapshot
GetEventssinceReplay events since version
SpawnPoolWindowsaga_idSaga asks host to spawn a pool window
ReapPaneslabel, saga_idSaga asks host to drain pane HWNDs
DrainPoolIfLastlabel, saga_idSaga asks host to drain pool if last window

All agentmux_common::ipc::Event variants propagated. Key ones:

EventPurpose
RegisteredConnection ack
PongPing reply
ErrorParse/invariant violation
WindowOpened/ClosedWindow mirror updated
PoolWindowAdded/Removed/PromotedPool inventory changed
WindowInstanceAssigned/ReleasedInstance number assigned
BackendWindowIdRegistered/Unregisteredlabel↔window_id mapping
DriftDetectedMirror mismatch
HwndDriftDetectedCEF/Win32 HWND disagreement
CorrectiveWindowMoveReducer-initiated window repositioning
HostShouldQuitLast user-visible window gone
SagaStarted/Completed/FailedSaga lifecycle
SnapshotFull launcher state
SrvSnapshotFull srv reducer state
WorkspaceCreated/Deleted/RenamedWorkspace CRUD
TabCreated/Deleted/Reordered/MovedTab CRUD
BlockCreated/Deleted/MovedBlock CRUD
LayoutNodeDeleted, LayoutTreeReplaced, LayoutBackendActionsQueuedLayout tree changes (with FocusedNodeChanged and MagnifiedNodeChanged for focus and magnify)

6. Channel D: Host → Srv Named Pipe (Read-only Bridge)

Section titled “6. Channel D: Host → Srv Named Pipe (Read-only Bridge)”

Source: crates/cef/src/srv_ipc.rs

  • Windows: Win32 named pipe. Path in env var AGENTMUX_SRV_PIPE_PATH (set by launcher’s srv_spawner.rs).
  • Unix: Unix domain socket (same env var).

Activated only when AGENTMUX_SRV_PIPE_PATH is set. Dev builds (is_dev_build_exe) short-circuit to None (crates/cef/src/lib.rs).

None. OS-level pipe ownership.

Same agentmux_common::ipc::Event newline-delimited JSON as Channel C. The host reads events from srv’s reducer and forwards them to all renderer frames via srv_event_bridge::dispatch_to_renderers.

Host is a read-only subscriber. No outbound command channel exists today (saga coordinator in Phase E.5+ will add producers).


7. Channel E: Renderer ↔ Srv WebSocket (RPC)

Section titled “7. Channel E: Renderer ↔ Srv WebSocket (RPC)”

Source: crates/srv/src/server/websocket.rs

WebSocket at ws://127.0.0.1:<srv_port>/ws.

?authkey=<auth_key> query parameter on the WebSocket upgrade URL (crates/srv/src/server/auth.rs). This is the only route that accepts the authkey via query string; all other routes require the X-AuthKey header.

Gap: The query-string authkey is visible in browser history, server access logs, and Referer headers on cross-origin navigations. Acceptable for WebSocket (where the browser API does not permit custom headers) but represents a key leak risk if the URL is ever logged or forwarded.

JSON text frames. Two message directions:

Renderer → Srv (wscommand):

{"wscommand": "<cmd>", "message": <RpcMessage>}

Or type-tagged messages for ping/bus/setblocktermsize/blockinput:

{"type": "ping"|"bus:register"|"bus:send"|"bus:inject", ...}

Srv → Renderer:

  • RPC events: {"eventtype":"rpc","data":{...}}
  • WaveObj updates: {"eventtype":"waveobj:update","oref":"block:<id>","data":{...}}
  • MessageBus messages: {"type":"bus:message","data":{...}}
  • Periodic ping: {"type":"ping","stime":<ms>} every 10 seconds
CommandPurpose
COMMAND_EVENT_SUBSubscribe to WPS event scope
COMMAND_EVENT_UNSUBUnsubscribe from scope
COMMAND_EVENT_UNSUB_ALLUnsubscribe all
COMMAND_EVENT_READ_HISTORYReplay buffered WPS events
COMMAND_CONTROLLER_INPUTSend input to block controller (PTY/stdin)
COMMAND_CONTROLLER_RESYNCForce controller state resync
COMMAND_GET_METAGet block/tab/workspace metadata
COMMAND_SET_METASet metadata
COMMAND_GET_FULL_CONFIGGet full wconfig
COMMAND_GET_AI_RATE_LIMITRate limit status
COMMAND_ROUTE_ANNOUNCEAnnounce wshrpc route
COMMAND_ROUTE_UNANNOUNCEDeannounce route
COMMAND_SET_CONFIGSet config value
COMMAND_APP_INFOGet app/version info
COMMAND_SUBPROCESS_SPAWNSpawn subprocess in pane
COMMAND_AGENT_INPUTSend text to agent PTY
COMMAND_AGENT_STOPStop agent
COMMAND_TOOL_DECISIONAccept/reject tool call
COMMAND_WRITE_AGENT_CONFIGWrite agent config
setblocktermsizeResize PTY terminal
blockinputSend raw bytes to PTY

MessageBus over WS:

TypeFieldsPurpose
bus:registeragent_idRegister pane as a bus agent
bus:sendfrom, to, payload, priority?Send message to agent
bus:injecttarget, bus_messageDeliver a jekt to an agent on this instance (agents use the Message tool). Structured agents get it in their conversation; terminal agents as typed input

8. Channel F: Renderer → Srv HTTP Service

Section titled “8. Channel F: Renderer → Srv HTTP Service”

Source: crates/srv/src/server/service/mod.rs, crates/srv/src/server/mod.rs

POST http://127.0.0.1:<srv_port>/agentmux/service

X-AuthKey: <auth_key> header required (crates/srv/src/server/auth.rs). Auth middleware also accepts ?authkey= query param exclusively on the /ws route.

http://127.0.0.1:* and http://localhost:* origins accepted (crates/srv/src/server/routes.rs). External origins rejected.

POST body: {"service": "<service>", "method": "<method>", "args": [...], "uicontext": {...}}
Response: {"success": bool, "data"?: ..., "error"?: string, "updates"?: [WaveObjUpdate]}

Updates from service calls are broadcast on the event bus to all WebSocket subscribers.

Service / Method Catalog (representative subset)

Section titled “Service / Method Catalog (representative subset)”
ServiceMethodPurpose
objectGetObjectFetch one object by oref
objectGetObjectsFetch multiple objects
objectCreateBlockCreate a new block
objectUpdateObjectUpdate object meta
objectDeleteBlockDelete block
tabCreateTabCreate tab in workspace
tabCloseTabClose tab
workspaceCreateWorkspaceNew workspace
workspaceDeleteWorkspaceDelete workspace
windowCloseWindowClose window
Various agent, CLI, identity, install services

9. Channel G: Browser DOM API (HTTP over IPC)

Section titled “9. Channel G: Browser DOM API (HTTP over IPC)”

Source: crates/cef/src/browser_api/routes.rs, registered via crate::browser_api::register_routes(app) (ipc.rs)

Same HTTP server as Channel A (127.0.0.1:<ipc_port>). Routes under /agentmux/browser/*.

Authorization: Bearer <ipc_token> header required by every handler (routes.rs).

RouteMethodPurpose
POST /agentmux/browser/queryCSS selector query in pane DOMReturns matching Element[]
POST /agentmux/browser/focus_infoGet document.activeElementReturns focused Element
POST /agentmux/browser/evalRun arbitrary JS in pane rendererReturns serialized value
POST /agentmux/browser/screenshotCapture PNG of pane viewportReturns base64 PNG
POST /agentmux/browser/click_elementSynthesize mouse click at element centroidDispatches Input.dispatchMouseEvent
POST /agentmux/browser/focus_elementCall .focus() on first matching element
POST /agentmux/browser/dispatch_keySend text or named key to focused elementSupports Enter, Tab, Escape, Backspace, ArrowUp/Down/Left/Right, Space
POST /agentmux/browser/navigateNavigate pane to URL via Page.navigate
POST /agentmux/browser/backBrowser history backPage.goBack
POST /agentmux/browser/forwardBrowser history forwardPage.goForward
POST /agentmux/browser/reloadReload current pagePage.reload

All Browser DOM API routes speak the Chromium DevTools Protocol (CDP) in-process, through CEF’s SendDevToolsMessage and a DevTools message observer on the target browser (crates/cef/src/browser_api/cdp.rs). They don’t use the remote-debugging port (Channel I), which is off in release builds.

Security: /agentmux/browser/eval runs arbitrary JS. The eval route accepts a caller-supplied script string and executes it in the pane’s JS world via Runtime.evaluate with no sandbox or isolation (routes.rs). The script runs in whatever origin the pane currently loads. Any local process holding the ipc_token can execute arbitrary JS in any browser pane.


10. Channel H: OSC 16162 — Terminal Shell Integration Escape Sequences

Section titled “10. Channel H: OSC 16162 — Terminal Shell Integration Escape Sequences”

Source: crates/srv-core/src/backend/shellintegration/bash.sh (and zsh, fish, pwsh), frontend/app/view/term/termosc.ts, frontend/app/view/term/termwrap.ts

VT escape sequence embedded in PTY output, parsed by xterm.js in the renderer:

ESC ] 16162 ; <command> ; <JSON-payload> BEL

Registered as an OSC handler on xterm.js number 16162 (termwrap.ts).

None. The sequence is parsed from PTY byte stream. Any program running in the terminal can emit OSC 16162 and trigger the handler.

Sub-commandWire exampleHandler actionSecurity implication
E\033]16162;E;{"AGENTMUX_AGENT_ID":"Alice"}\007Calls RpcApi.SetMetaCommand to write {"cmd:env": <payload>} into the block’s persistent metadata (termosc.ts). Empty payload clears.Env-key injection: any terminal program can write arbitrary keys into cmd:env. Values are then injected into child process environments (shell.rs). No key allow-list or value range is enforced.
X\033]16162;X;{"muxbus_url":"https://...","muxbus_token":"tok"}\007Makes an authenticated POST /agentmux/reactive/poller/config to reconfigure the cloud MuxBus poller URL and token (termosc.ts).Poller injection: any terminal program can redirect the srv’s outbound polling to an attacker-controlled endpoint. The route requires X-AuthKey.
A\033]16162;A;{}\007Sets shell:state = "ready" in block RT infoState metadata injection
C\033]16162;C;{"cmd64":"<b64>"}\007Sets shell:state = "running-command", decodes cmd64 → shell:lastcmdLast-command display
D\033]16162;D;{"exitcode":0}\007Sets shell:lastcmdexitcodeExit code display
I\033]16162;I;{"inputempty":true}\007Sets shell:inputemptyInput state
M\033]16162;M;{"shell":"bash","shellversion":"5.2","uname":"Linux"}\007Sets shell:type, shell:version, shell:unameShell metadata
R\033]16162;R;{}\007If in alternate screen buffer: writes ESC[?1049l to exit alternate screenScreen reset

Scripts are embedded in the srv binary (shellintegration.rs) and deployed to ~/.agentmux/shell/<type>/ on first launch or version change. The shell controller sources them via --rcfile (bash), ZDOTDIR (zsh), -File (pwsh), or -C source (fish) (shellintegration.rs).


11. Channel I: Chromium Remote Debug Port (CDP)

Section titled “11. Channel I: Chromium Remote Debug Port (CDP)”

Source: crates/cef/src/cdp_port.rs, crates/cef/src/lib.rs (port selection), crates/cef/src/app/mod.rs (remote_allow_origins)

Chromium DevTools Protocol over HTTP and WebSocket:

  • http://127.0.0.1:9222/json — list targets (prod)
  • ws://127.0.0.1:9222/devtools/page/<target> — CDP per-target session

On by default only in dev builds. A release build starts it only when AGENTMUX_CDP_PORT is set to a port or to 1/on/true/yes/auto; 0/off/false/no turns it off in a dev build too (crates/cef/src/cdp_port.rs). The preferred port is 9222 in production and 9223 in dev builds, with an OS-assigned fallback when it is taken; the port in use is published in authkey.dev. --remote-allow-origins is limited to http://127.0.0.1:<port> and http://localhost:<port> (crates/cef/src/app/mod.rs, remote_allow_origins), so web pages can’t open a DevTools WebSocket; clients that send no Origin are not affected. No CSP header is configured.

None. While it is on, the CDP endpoint is unauthenticated. Any local process can connect and:

  • Enumerate all browser targets (main window and all panes)
  • Execute arbitrary JavaScript in any target (Runtime.evaluate)
  • Capture screenshots
  • Intercept network traffic
  • Modify DOM

Note: no_sandbox: 1 is set in CEF settings (crates/cef/src/lib.rs), which means the Chromium renderer processes run without the OS sandbox. This widens the blast radius of any renderer compromise.

None in the app. The Browser DOM API (Channel G) drives CDP in-process (see Channel G above), and Inspect Element opens CEF’s native DevTools. The port exists for external tooling and test harnesses, which is why dev builds keep it on.


12. IPC Token and Auth Key — Lifecycle and Leak Surface

Section titled “12. IPC Token and Auth Key — Lifecycle and Leak Surface”

There are two distinct secrets:

SecretName in codeWhere generatedWho uses itScope
ipc_tokenstate.ipc_tokenRandom UUID, host startupPOST /ipc (Channel A) and POST /agentmux/browser/* (Channel G)Per-host-process
auth_keystate.auth_key (host); AppState.auth_key (srv)Random UUID, srv startup; passed to host via env or backend-info/ws?authkey= (Channel E) and X-AuthKey (Channel F)Per-srv-process
VectorLeaksCondition
ipc-port-<hash> file (<data_dir>/ipc-port-<hash>)<port>:<ipc_token>Always (owner-readable, but data dir may have lax permissions on some installations)
authkey.dev file (<data_dir>/authkey.dev)Both ipc_token and auth_key, plus both endpoint addressesDev mode only (AGENTMUX_DEV=1); file is chmod 0600 (Unix) / DACL-restricted (Windows) (dev_authfile.rs)
Renderer URL query stringipc_token via ?ipc_token=<token> (if frontend embeds it in the URL on load)Visible in process arguments, browser history, Referer headers
WS URL query stringauth_key via ?authkey=<key>Visible in server access logs (crates/srv/src/server/auth.rs)
get_auth_key IPC commandauth_keyAny caller that already holds ipc_token — no additional gate
{
"version": 1,
"auth_key": "<uuid>",
"web_endpoint": "127.0.0.1:<port>",
"ws_endpoint": "127.0.0.1:<port>",
"ipc_endpoint": "127.0.0.1:<port>",
"ipc_token": "<uuid>",
"service_path": "/agentmux/service",
"file_path": "/agentmux/file",
"instance": "v<version>",
"data_dir": "<path>",
"host_pid": <pid>,
"debug_port": <port>,
"created_at": "<ISO8601>"
}

(dev_authfile.rs)


13. Launcher ↔ Srv Named Pipe (Reducer Bus)

Section titled “13. Launcher ↔ Srv Named Pipe (Reducer Bus)”

Source: crates/common/src/ipc.rs (shared wire types), crates/launcher/src/ (server side, not read directly)

  • Windows: Named pipe (path keyed on hash(data_dir, version) for isolation invariant I5)
  • Unix: Unix domain socket

None. OS-level pipe ownership + launcher Job Object containment.

Same agentmux_common::ipc::Command / agentmux_common::ipc::Event newline-delimited JSON as Channel C. The launcher is the server; srv connects as a client with ClientKind::Srv.

srv-Domain Commands (routed to the srv reducer)

Section titled “srv-Domain Commands (routed to the srv reducer)”

All Command variants from the second half of ipc.rs (Phase E.x):

CommandPurpose
GetSrvSnapshotRequest srv reducer full snapshot
CreateWorkspace, DeleteWorkspace, RenameWorkspace, UpdateWorkspaceMetaWorkspace CRUD
CreateTab, DeleteTab, SetActiveTab, ReorderTab, ReorderTabsBulk, RenameTab, UpdateTabMeta, MoveTabTab CRUD and ordering
CreateWindow, CloseWindowInternal, SwitchWorkspace, UpdateWindowMetaWindow↔workspace mapping
CreateBlock, DeleteBlock, MoveBlock, UpdateBlockMetaBlock CRUD
SetFocusedNode, SetMagnifiedNodeLayout focus/magnify
LayoutApplyIntent, LayoutSetTree, LayoutDeleteNode, LayoutDeleteNodeByBlock, LayoutStackPush, LayoutStackActivate, LayoutStackMove, LayoutStackMoveMany, LayoutQueueBackendActionsLayout tree mutations

crates/common/src/ipc.rs (2034 LOC) contains a single Command enum that conflates two distinct domains:

  • Launcher domain (Register, Ping, ReportWindow*, ReportHwnd*, SpawnPoolWindow, ReapPanes, DrainPoolIfLast, GetSnapshot, GetEvents, …) — processed by the launcher’s reducer.
  • Srv domain (GetSrvSnapshot, CreateWorkspace, DeleteWorkspace, CreateTab, LayoutSetTree, …) — processed by the srv reducer.

These share a wire-level namespace. The routing logic lives in the respective process’s connection handler and is not enforced by the type system. A mis-addressed CreateWorkspace sent to the launcher pipe returns Event::Error { code: InvalidCommand } rather than a type error.

See ipc.rs for the stated backward-compat policy (externally tagged enums, unknown-command → Event::Error).


14. Command/Event Domain Mixing in crates/common/src/ipc.rs

Section titled “14. Command/Event Domain Mixing in crates/common/src/ipc.rs”

crates/common/src/ipc.rs is 2034 lines. It defines:

  • ClientKind enum — Host, Renderer, Srv, Tool
  • Command enum — all commands from both the launcher domain and the srv domain (see §13 above)
  • Event enum — all events from both domains (~60 variants)
  • HostFrame — {"kind":"event"|"command", ...} CPD-1 envelope
  • Helper types: Rect, WindowKind, WindowSnapshot, LifecyclePhase, DriftKind, HwndDriftKind, Severity, ErrorCode

There is no sub-module or feature-flag separation between launcher-domain and srv-domain variants. Operators reading the enum cannot tell at a glance which variants belong to which pipe. The only documentation is inline comments citing phase numbers (e.g., “Phase E.2”, “Phase B.4”).

Recommendation: Add // === LAUNCHER DOMAIN === and // === SRV DOMAIN === section comments at the boundary within the enum to make the split explicit without requiring a breaking split into two enums.


The variables srv puts in a pane’s environment, who sets them and which are kept from the instance’s own environment are in Environment variables: the pane allow-list (PANE_ENV_KEEP in crates/srv-core/src/backend/pane_env.rs) decides which AGENTMUX_* variables reach a pane, and AGENTMUX is always set to 1. The OSC 16162 E command can still write keys into a block’s cmd:env (section 10).

AGENTMUX_AGENT_COLOR and AGENTMUX_AGENT_TEXT_COLOR are decommissioned: nothing injects or reads them, and the pane border uses the agent’s persisted ui:color.


This section maps the security findings to the specific code locations documented above.

FindingLocationImpactMitigation status
ipc_token leaks via ipc-port filecrates/cef/src/lib.rs writes port:token to <data_dir>/ipc-port-<hash>Any process that can read data dir obtains both port and token; can drive Channel A and G fullyFile permissions not explicitly restricted (unlike authkey.dev). The launcher reads it for single-instance forwarding.
ipc_token leaks via renderer URL queryFrontend’s load-time URL (its source is not read in this catalog)Token in browser history, Referer, process argumentsNot mitigated in code seen
authkey.dev leaks both tokens (dev mode)dev_authfile.rs; written when AGENTMUX_DEV=1Full API access with both ipc_token and auth_keyFile is chmod 0600 / owner DACL. Dev-only.
get_auth_key IPC command returns srv auth keyipc.rsAny renderer holding ipc_token can obtain auth_key (srv-side token)No separate gate; design intentional (renderer needs both)
get_env returns any env varplatform.rs; ipc.rsRenderer can extract AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN, etc. from the host process environment. Requires ipc_token.No allowlist or blocklist enforced
/agentmux/browser/eval runs arbitrary JSroutes.rsAny caller with ipc_token can execute JS in any open browser pane (including cross-origin pages).Auth: ipc_token required. No script length or content restriction.
OSC 16162 E injects env keys into block metatermosc.tsAny program in the PTY can write arbitrary keys into cmd:env. Those keys are injected into future child process environments by shell.rs.No key allowlist. No value validation.
OSC 16162 X reconfigures srv pollertermosc.tsAny terminal program can set the srv’s outbound polling URL/tokenauth_key required from the renderer.
CorsLayer::permissive() on host IPC serveripc.rsAny Origin accepted on http://127.0.0.1:<ipc_port>. Web pages from the renderer’s browsed sites can make preflight-free requests if they guess/obtain the port and token.Not mitigated. Srv has been narrowed to loopback-only origins (crates/srv/src/server/routes.rs); host has not.
CDP port unauthenticated, when oncrates/cef/src/cdp_port.rs, crates/cef/src/lib.rsAny local process can enumerate targets, execute JS, capture screens, intercept network.Off in release builds unless AGENTMUX_CDP_PORT opts in; on in dev builds. Web origins refused via --remote-allow-origins. No auth. no_sandbox: 1 widens blast radius.
No CSP on any routeipc.rs, crates/srv/src/server/mod.rsXSS in the main window or a browser pane has no Content-Security-Policy barrier.Not mitigated.
no_sandbox: 1 in CEF settingscrates/cef/src/lib.rsRenderer processes run without OS sandbox. Renderer compromise can access host filesystem and processes directly.Required for current platform support; documented limitation.
WS authkey in query stringcrates/srv/src/server/auth.rsauth_key in URLs, logs, Referer. Intentional WS-only exception (browser WS API cannot set custom headers).Accepted on the /ws route only.