Node Enrolment
A node is a machine that has enrolled with a Vagaris instance and can prove it. Enrolment gives the machine a server-side identity that leases can be bound to, so a run claimed by this machine cannot be replayed from another one.
Node lifecycle belongs to the Vagary platform CLI, vagary (package @vagarylabs/vagary, preview), not to vagaris. Both CLIs share one auth file, but each keeps its own session in it: sign in with vagary auth login before running the commands on this page. A vagaris auth login session is never used for them.
Enrol
If vagary reports that existing CLI state needs a one-time move (a machine that ran an older vagaris), run vagary auth migrate-state --dry-run, then vagary auth migrate-state. No sign-in is needed, and it moves only the CLI's own sign-ins and contexts.
vagary node enroll --company-id <company-id>
- The CLI asks the installed node (
enrol-store status, below) for this machine's fingerprint and how far enrolment got. The node creates the Ed25519 key pair in its own store; the private key never leaves it. - It requests enrolment (
POST /api/nodes/enrolment-requests) carrying the selected company, fingerprint and public key. The server files the request and itsnode_enrolmentapproval together, and answers with the approval id and the approval inbox link. No credential is issued to the machine, and none that acts as the person who approves it. - The CLI prints the approval id and how to decide it:
vagaris approve <approval-id>, or the inbox link (the server'sapprovalUrl, or the inbox path on--api-basewhen the server has no public address). It then polls the request (GET /api/nodes/enrolment-requests/:id) at the interval the server suggests, backing off with jitter when a poll fails, never waiting more than 30 s between polls. The request's own secret names it when polling or withdrawing; it is never printed. - On approval it calls
POST /api/nodes/enrolwith the request id, fingerprint, hostname, platform and the public key (the approval has already registered the node; this confirms it, and the two must name the same node). It records the confirmed approval in the node's store, then hands it to the installed node's own writer (below), which records the node id against its key.
If that last step fails (the writer could not start, closed its input or did not answer), the approval stays recorded on
the machine and the CLI says to run vagary node enroll again. That run finds the recorded approval and only finishes
the bind: it asks the server for nothing and files no second approval. On a machine whose node is already enrolled,
enroll files nothing and refuses with exit 4 (NODE_ALREADY_ENROLLED).
Enrol by pairing (nobody signs in on this machine)
vagary node enroll --pair
Use this on a machine where nobody should sign in, such as a server, a lab box or a computer someone else set up. No
--company-id is taken: the person who connects the machine chooses the organization. Pairing sends no credential.
- The installed node creates its Ed25519 key in its own store, with no organization yet. The CLI opens a pairing
(
POST /api/nodes/pairings) with the fingerprint, the public key and a proof of possession: the node signsvagaris-node-pairing-create:v1:<fingerprint>:<public key>:<time>, and the server refuses a proof more than 5 minutes off its clock (exit 3,NODE_PAIRING_CLOCK_SKEW). - The CLI prints a code such as
WXYZ-2345and the page to enter it on (/connect). A person opens it on any device, signs in there, and chooses the organization. Their sign-in never reaches this machine. - The request is then filed, and approved in the approval inbox, exactly as a signed-in enrolment is. The CLI polls
with a single-use nonce the node signs each time (
vagaris-node-pairing-poll:v1:<pairing id>:<nonce>). It reportsConnectedwhen the code is entered andEnrolment requestedwhen the approval exists. At that moment the node records the approval in its store. - When the server answers
approvedfor this machine's key, the CLI records the confirmed approval and the node's writer binds the node id to its key. Anapprovedanswer without the node id is refused and binds nothing (exit 7).
Every request goes out with no credential, even when someone is signed in to vagary on this machine. Ctrl+C
withdraws the pairing with a signed cancel (exit 4, NODE_PAIRING_WITHDRAWN). A code nobody entered expires (exit 6,
NODE_PAIRING_EXPIRED). A rejected request is forgotten on the machine (exit 2). A server without pairing says so
(exit 5, NODE_PAIRING_UNSUPPORTED), and the CLI never falls back to a signed-in enrolment. When the server asks it to
slow down (429), the CLI keeps its nonce and waits at least as long as the server says.
A rerun picks up where a stopped run left off. The node answers with the key it already holds, and the server
answers that key with its open pairing, which the CLI keeps polling, or with the node already registered to it, which
the CLI only binds. A machine that stopped between the server's approval and the local bind is therefore finished by
running vagary node enroll --pair again, with no new code and no second approval.
Abandoning a recorded approval
A recorded approval never traps the machine. vagary node enroll --abandon-pending reads the approval the node
recorded (elevated), shows its id, company and state, and asks before the node forgets it (enrol-store clear-approval); under --json the consent is --yes, and without it the command refuses (exit 13,
NODE_ABANDON_NEEDS_YES). The next vagary node enroll then files a new request. It is local: it needs no sign-in or
company, and it cannot withdraw the approval on the server, so the approval stays in the inbox and should be rejected
there (vagaris approval reject <id>). With nothing recorded it changes nothing and exits 0
({"ok": true, "abandoned": false}). A record the server already confirmed is not abandoned (exit 4,
NODE_ENROLMENT_CONFIRMED): the node exists, and vagary node enroll binds it. Whenever resuming a recorded approval
fails because the server does not know it (exit 5), refuses to show it to this CLI's credential (401/403, exit 3,
NODE_RECORDED_APPROVAL_FORBIDDEN), or answers in a shape the CLI cannot use (exit 7), the record is kept and the
message names this command. The 401/403 case is expected on a server that binds CLI credentials to an audience family:
/api/approvals is a product-CLI route, and the platform CLI is not widened onto it.
Ctrl+C withdraws the request (POST /api/cli-auth/challenges/:id/cancel) and reads its final state back. If the
request was approved before the withdrawal reached the server, the node already exists, so the CLI finishes enrolment
and has the node record it rather than leave the node without one.
Each outcome has its own exit code, and with --json stdout holds exactly one JSON document (what a person needs while
waiting goes to stderr):
| Outcome | Exit | --json |
|---|---|---|
| approved | 0 | {"ok": true, "status": "approved", "nodeId", "approvalId", "hostname", "scheduling": "cordoned"} |
| rejected | 2 | error envelope, details.status: "rejected" |
| cancelled (withdrawn, including by Ctrl+C) | 4 | error envelope, details.status: "cancelled" (cancelledBy: "this_command" for Ctrl+C) |
| expired | 6 | error envelope, details.status: "expired" |
| the server has no enrolment-request route, or answers in a shape the CLI cannot use | 7 | error envelope |
The CLI never prints, opens or follows a /cli-auth page link. A server answer that carries one, that files no
approval, or that carries a board key is withdrawn and refused (exit 7). A server that predates enrolment requests is
a protocol mismatch: there is no fallback to the retired enrolment path.
Enrollment, status and doctor use --company-id, the configured company environment variable, or the selected context profile. They never choose the first company membership. HTTP clients pass ?companyId=<uuid> on node routes; a company-scoped agent can omit it and use its authenticated company, but still needs a legitimately approved enrollment challenge.
The server binds enrollment to the approved company, fingerprint, key, algorithm and approver's current authority in one transaction. Legacy login challenges cannot enroll nodes. Identical replay is idempotent while the approval remains valid. Key rotation requires a new approval obtained after the last enrollment; replaying an older challenge cannot restore an old key. A key-bearing node cannot be downgraded to fingerprint-only enrollment.
Where the node identity lives
The CLI never writes the node's key (ruling D-CONV-ONE-WRITER). Enrolment needs the Vagary Node installed: the CLI finds
it through HKLM\SOFTWARE\Vagary\Node\InstallRoot and hands each step to the node's private enrol entry,
vagary-node enrol-store, with the step's input as JSON on stdin (never on the command line):
status: the machine's fingerprint (the server's lookup key) and whether a key is pending, an approval is waiting to be bound, or the node is already bound. The CLI never reads the fingerprint from a file a user could write.create-pendingwith the company and fingerprint: the key pair is created inside the node's protected store (C:\ProgramData\Vagary\node, DPAPI-protected) and only its public key comes back, for the enrolment request.remember-approvalwith the approval id and node id, once the server has confirmed them, so a failed bind can be finished later without a new approval.bindwith the same ids: the node records which node its key belongs to.
Before running anything from the install folder, the CLI checks that it is below Program Files, that no folder on
the way is a link or junction, and that only SYSTEM, Administrators or TrustedInstaller can write to it; otherwise it
refuses with exit 6 and runs nothing.
Without an installed node, or off Windows, node enroll refuses before asking the server for anything: "install the
node first (vagary node install)" (exit 13). The node's writer needs an elevated console and refuses while the
node's background service is running (turn background execution off first). Its refusals are exit 3 (not elevated)
or 4, with the node's code in details.nodeCode.
An identity written by an earlier CLI to ~/.vagris/node-identity.json (or to
an explicitly configured VAGARIS_HOME) is no longer read for the fingerprint, which now comes from the node. doctor
still reads its key for the attestation check; nothing is copied, moved or deleted, and the CLI says that the old plaintext file remains and how to remove it. If two legacy files
exist and differ, neither is read: keep the one this node enrolled with and move the other aside.
Approve an enrolment
A person decides the node_enrolment approval, never the machine and never a credential acting for a person:
vagaris approve <approval-id>
or open it in the Vagaris approvals inbox. Approval requires current node-management authority in the requested company and a fresh step-up; an agent, a viewer, a service principal or an API key cannot approve, and one machine can never approve its own request. Approving registers the node (cordoned and commissioning) and issues nothing to the machine: the node later authenticates as its own node principal. Rejecting closes the approval and creates no node.
The retired /cli-auth enrolment routes answer 410 node_enrolment_moved (creating a node request there) and
410 node_enrolment_decide_in_inbox (approving one on the sign-in page). This CLI calls neither; if either reaches
it, it reports the refusal in its own words and points at vagaris approve and the approvals inbox.
Status
vagary node status
vagary node status --json
Looks the node up by this machine's fingerprint and prints its id, hostname, platform, health (healthy, degraded or otherwise), enrolment time, last heartbeat, the CLI version it last reported, and a revocation notice if revoked. A machine that has not enrolled is told to run vagary node enroll.
With --json the answer is always JSON: the server's node row for an enrolled machine, or
{"enrolled": false, "enroll": "vagary node enroll"} for one that is not enrolled (exit 0 either way).
Doctor
vagary node doctor
Five checks:
| Check | Pass condition |
|---|---|
| Node enrolment | The fingerprint resolves to a node that is not revoked |
| Cryptographic attestation | The server issues a nonce, the CLI signs it with the local private key, the server verifies it against the enrolled public key. A cloned identity file without the private key fails here even with the same fingerprint. |
| Node health | The server reports healthy (warn on degraded) |
| Heartbeat recency | Last heartbeat under 5 minutes ago (warn under 30) |
| Platform compatibility | darwin or linux; anything else is reported as untested |
A missing local key file yields a warning telling you to re-run enrolment. A failed enrolment check prints the repair hint vagary node enroll.
Host verify (Windows)
vagary node host verify
vagary node host verify --wsl --distro Ubuntu-24.04
The bare command asks the installed Vagary Node whether this machine is ready to run work. It runs
vagary-node-setup.exe readiness --json from the folder the node's installer recorded in
HKLM\SOFTWARE\Vagary\Node\InstallRoot, and reads its answer strictly against the readiness contract that ships
with the CLI. It works elevated or not; an unelevated run cannot read every fact, so it may answer unproven. It changes
nothing on the machine. Exit 0 means ready, 1 not_ready, 4 unproven (no blocker, but a load-bearing fact is unknown).
It also shows, separately, whether the node is installed, enrolled and has background execution enabled. When no node is
installed, or off Windows, it refuses with exit 6 ("install the node first (vagary node install)"). An answer the CLI
cannot accept is refused with exit 10 and never read as ready. The earlier JEA-era host script
(Verify-WindowsCell.ps1) is retired (D-HS-HOSTVERIFY).
--wsl still runs the reviewed WSL ceiling script (Verify-WslRestricted.ps1), which ships with the CLI. Its sha256 is
checked before it runs; a mismatch runs nothing and exits 10. It must run in a NON-elevated console (exit 6 otherwise). It
is staged in a new per-user temporary folder, and its receipt (the one that appeared during the run) is copied with an
envelope (vagary-envelope.json, carrying the run id) into %LOCALAPPDATA%\Vagary\node-evidence before the staged copy
is removed. Nothing is uploaded. --recover and --abandon finish or undo an interrupted window, and
--drill-pause wsl pauses mid-window for a drill. The exit code is the script's own.
With --json, the readiness check prints { target, overall, exitCode, reasons, recommendations, elevated, observedAt, node, readiness }, the WSL check prints { target, exitCode, exitMeaning, receipt, envelopePath, uploaded }, and a
refusal prints {"ok": false, "error": {"code": "HOST_VERIFY_REFUSED", "exitCode": <2|6|10>, "reason": "..."}} on stdout
with the same exit code. These shapes, and every command's --help, are pinned by the package's goldens.
Lifecycle commands
The first vagary release carries the node lifecycle as well as enrolment. Each command and flag is a compatibility contract.
vagary node cordonstops the node taking new work; in-flight work continues.vagary node drainalso lets in-flight work finish.--waitblocks until it does, and exits non-zero if--timeoutpasses first, so a maintenance script does not proceed.vagary node uncordonreturns the node to service.vagary node sessionslists the runs and live leases on the node.vagary node revokerevokes the node's attestation.vagary node capabilitieslists what the node declared it can run.vagary node rotaterotates the key through the installed node's writer, or asks its running background service to rotate.vagary node enableandvagary node disableturn background execution on and off, through the installed node's setup engine, elevated and with consent.disablewaits for running work, and its force option stops it after its own confirmation.enablecan pass the consent to turn on Hyper-V, which needs a restart, only after a prompt that names it.vagary node installinstalls the node. It refuses today: no trusted manifest is compiled in.
The server decides each of these; the CLI only carries the request.
Using the node
Pass the node id when claiming a run so the lease is bound to it:
vagaris dev --agent-id <agent-id> --run-id <run-id> --node-id <node-id>
Enrolment, attestation and lease state also appear in vagaris support-bundle output (redacted), so support can see whether a node problem is identity or health.