Expand description
Native Gate4Agent node server and runtime.
Re-exports§
pub use machine_env::collect as collect_machine_environment;pub use gate4agent_node_protocol as protocol;
Modules§
- browser_
capture - Linux dig2browser capture inside the node (feature
d2b). - door
- Local door for agents on this node: mail and task operations without ever touching a key.
- enroll_
client - Node side of enrollment: key generation in the node’s own state directory, the signed request with the operator’s one-time code, and the stored public answer.
- isolation
- Node-side isolation: run provider sessions as an unprivileged user, and apply the egress
kill-switch rendered by
hatchery_enroll::KillSwitch. Linux/Unix only; both are opt-in and fail closed (a requested isolation that cannot be set up stops the node). - keystore_
proxy - Node-side keystore proxy (was
m4a_signer_proxy) (option A,specs/m4a-session-keys-2026-10-16.md). - local_
server - Session-local HTTP server pool (tesserax-http static + supervised http children).
- m4a_
accounts - Per-session m4a accounts assigned by the node at spawn (owner model: session = nick = one key
= one role). When
HATCHERY_M4A_AGENT_BINandHATCHERY_M4A_ACCOUNTS_ROOTare set, every PTY spawn gets its own account: the node runsm4a-agent account provision(registry and vaults stay under the node’s accounts root, outside the session sandbox), reads the fresh capability from a one-shot 0600 file it removes at once, and injects ONLYM4A_NICKandM4A_SESSION_CAPinto that session’s child environment. The capability is never logged. - m4a_
signer_ proxy - 0.2.15 name of
keystore_proxy. - machine_
env - Collect host machine resources + installed provider CLI versions for topology inventory.
- plugins
- Signed session plugins (node-owned session environment).
- provider_
inventory - Provider inventory: which provider CLIs this node can run and which models each one exposes, read from the CLI itself (or its own config). Nothing is invented: a provider whose CLI does not list models reports only what its help text / config names.
- restream_
g4a_ bridge - Node restream g4a bridge (A2).
- restream_
session - Node end of a live restreamer session (A2 / A3).
- session_
signals - Short session signals the node reads off its own PTY screens: a provider CLI hit a
usage/rate limit, needs a login, or is ready again. Only state changes are sent to
core (
task.session_signalover the node-call channel); screens never leave the node for this. Detection is heuristic text matching on the rendered screen and is kept per provider-agnostic phrase lists so a CLI wording change degrades to “no signal”. - uplink_
calls - Node calls (
mail.*,task.*) over the restreamer uplink. - uplink_
journal - Persistent uplink journal and JournalReq responder for the A2 restreamer.
- wake_
pipeline - The node’s letter pipeline: letter in -> policy -> g4a deliver (or refuse; the letter stays in the inbox).
Structs§
- Bundle
Catalog - Bounded immutable lookup table for bundles installed before node startup.
- Mailbox
Handle - Handle of the background mailbox thread.
- Managed
Worktree Profile - Native
History Config - Native
History Root - Network
Allowlist Catalog - Empty-default station network allowlist catalog.
- Network
Allowlist Entry - One node-local catalog entry. Wire / inventory still use
SpawnNetworkAllowlistId. - Network
Permit Sketch - dig2browser-spirit peer+protocol permit (node-local; non-secret).
- Node
Bundle - Immutable host-local bundle bytes and their public content receipt.
- Node
Bundle File - One immutable, normalized file captured from a validated bundle root.
- Node
Environment Profile - Immutable host-local binding from one public profile revision to native child-environment resolvers. Resolver values remain inside the native profiles and are never serialized or formatted for diagnostics.
- Node
Letter - One letter for a session of this node.
- Node
Secret Reference - Node
Server - Node
Server Config - Node
Session Materialization Profile - Node
Session Path Binding - Node
Shutdown Handle - Node
Wake - Node
WgPeer Config - Provider
Native Network Sketch - Honest, partial provider-native network mapping (node-local).
- Spawn
Profile Registry - Workspace
Config
Enums§
- Bundle
Catalog Error - History
Source Layout - Network
Allowlist Catalog Error - Network
Permit Protocol - Allowed permit protocols (string form in JSON:
tcp/udp). - Node
Bundle Error - Node
Environment Profile Error - Node
Secret Resolve Error - Node
Secret Value - Node
Secret Value Error - Node
Server Error - Node
Session Environment Mutation - Node
Session File - Node
Session Materialization Profile Error - Node
Session Path Class - Node
WgPeer Error - Spawn
Profile Registry Error - Worktree
Service Mode
Constants§
- CLAUDE_
STATION_ NETWORK_ SETTINGS_ FILE - Sidecar settings filename under ProviderHome (
CLAUDE_CONFIG_DIRhome/). - DEFAULT_
SPAWN_ PROFILE_ ID - MAX_
BUNDLE_ CATALOG_ ENTRIES - MAX_
BUNDLE_ FILES - MAX_
BUNDLE_ FILE_ BYTES - MAX_
BUNDLE_ PATH_ BYTES - MAX_
BUNDLE_ TOTAL_ BYTES - MAX_
NETWORK_ ALLOWLIST_ CATALOG_ ENTRIES - Soft bound on station network allowlist catalog membership (ids only). Soft bound on station network allowlist catalog ids exposed on launch inventory.
- MAX_
NETWORK_ PERMITS_ PER_ ENTRY - Soft bound on permit rows per catalog entry (dig2
MAX_NETWORK_PERMITSspirit). - MAX_
NODE_ ENVIRONMENT_ PROFILES - MAX_
NODE_ SECRET_ REFERENCE_ BYTES - MAX_
NODE_ SECRET_ VALUE_ BYTES - MAX_
SESSION_ ENVIRONMENT_ ENTRIES - MAX_
SESSION_ MATERIALIZATION_ FILES - MAX_
SESSION_ MATERIALIZATION_ FILE_ BYTES - MAX_
SESSION_ MATERIALIZATION_ RELATIVE_ PATH_ BYTES - MAX_
SPAWN_ PROFILES - NETWORK_
ALLOWLIST_ CATALOG_ ENV - Env path to an optional allowlist catalog file (absolute regular file). Unset → empty catalog (deny unknown at resolve). Never a secret store.
- NETWORK_
ALLOWLIST_ CATALOG_ SCHEMA_ VERSION - Structured catalog schema version (JSON v2).
- WG_
ADDRESS_ ENV - WG_
INTERFACE_ ENV - WG_
KEEPALIVE_ ENV - WG_
LISTEN_ PORT_ ENV - WG_
PEER_ ADDRESS_ ENV - WG_
PEER_ ENDPOINT_ ENV - WG_
PEER_ KEY_ ENV - WG_
PRIVATE_ KEY_ ENV - WIREGUARD_
LINK_ TAG - Link tag so the kit binary retains this module.
Traits§
Functions§
- bring_
up_ node_ wireguard - Creates a kernel WireGuard interface for the node↔C2 peer.
Allowed IPs and the installed route are only the C2 tunnel host.
Does not substitute another transport when
ip link add type wireguardfails. - claude_
allowed_ domains_ from_ permits - Deduplicated Claude
allowedDomainsfrom catalog permits (stable order). - claude_
bash_ sandbox_ network_ os_ supported - Vendor Bash sandbox network overlay is macOS / Linux / WSL2 only. Native Windows (and WSL1 host without Linux node) has no vendor sandbox — refuse rather than silent no-op or invented argv.
- claude_
settings_ network_ overlay_ args - Documented Claude CLI argv:
--settings <absolute-path>. - claude_
station_ network_ settings_ json - Settings JSON fragment for Claude Bash sandbox network (vendor documented
sandbox.enabled+sandbox.network.allowedDomains). - codex_
network_ access_ config_ overlay - Codex
-coverlay for legacysandbox_workspace_write.network_access. - default_
node_ endpoint - default_
state_ path - force_
link - Touches a real symbol in each enabled core so the node binary links them.
Does not start a browser, a provider CLI, or a tunnel, and does not read
a secret. The mailbox is started separately by
start_mailbox. - linked_
core_ names - Names of the cores linked into this build, in owner order.
- load_
network_ allowlist_ catalog_ file - Load catalog from
path(absolute regular file). Dual format. - node_
wg_ from_ env - Optional service-mode bring-up. Unset
WG_INTERFACE_ENVleaves the tunnel down. The key is a path, never a secret value in the unit file. - orca_
home_ roots - Pinned Orca-compatible roots beneath an explicitly supplied native home.
- parse_
network_ allowlist_ catalog_ text - Parse catalog text: JSON v2 when first non-comment content is
{, else v1 id-list (one id per line). - permit_
peer_ to_ allowed_ domain - Map catalog permit
peer→ Claudesandbox.network.allowedDomainshost. - provider_
native_ mapping_ supported - Whether
provider_nativeon a catalog entry can be honored forproviderat the resolvedApprovalLevel. - resolve_
network_ allowlist_ catalog - Resolve optional catalog from an explicit path, else from
NETWORK_ALLOWLIST_CATALOG_ENV, else empty. - resolve_
provider_ native_ launch_ overlay - Resolve provider-native launch overlay argv for a catalog entry, or refuse.
- start_
mailbox - Start the mail4agent mailbox on a background thread (
m4aonly). Same daemon the standalonemail4agentbinary runs.