Skip to content

Node Gateway

Jackson Sá edited this page Oct 21, 2026 · 1 revision

agentux-gateway (the crate) and aux node … connect a node to AgentUX Command over AUXP. Using it: Enrolling Nodes, Node Policy. Reference: docs/gateway.md.

Modules

Module Role
lib.rs NodeConfig (~/.config/agentux/node.json, 0600), enroll(), the Messages builder (envelope, sequences kept in gateway.json), the Outbox (ordered, bounded, retried), the Http sink and the main loop
channel.rs The command connection: WebSocket to /v1/protocol/connect, reconnect with backoff, instance check on the handshake
commands.rs handle(): the checks (node, organization, pinned instance, no credentials, idempotency by commandId), the policy decision, execute() against agentuxd, held commands (gateway-pending.json) and run_decided()
policy.rs /etc/agentux/node-policy.yaml: allow, confirm or deny per method, the defaults, unknown methods denied

Main loop

Every 30 s a heartbeat (active runs, runs waiting); every 5 minutes, and after a limits event, harness.status when it changed; every agentuxd event mapped to AUXP (run.updated, run.completed, run.failed, approval.requested, harness.limits_changed); and events from the command connection (command.denied, command.completed). The outbox flushes after each. On a Command instance mismatch the gateway stops.

Enrollment and pinning

enroll() reads the instance id from the token (auxe1_<instance>_<secret>), compares it with GET /v1/instance before sending the token, redeems it at /v1/enroll, and saves the credential with command_instance_id. A pinned node checks the instance in POST answers, in the X-AgentUX-Command-Instance handshake header and in every command's commandInstanceId; commands must also carry the node's organization.

Clone this wiki locally