Executors
An executor is the binary vagaris dev runs once a lease is verified. The CLI knows an executor through a small registry entry: the binary name, the class of situation it is for, a readiness report it makes about itself, and a function that turns the lease's tool policy into that binary's own allowlist flags. dev consumes nothing else, which is what lets a second executor be added without changing dev.
The two classes, and why the distinction is not cosmetic
| Class | Runs | Ready when |
|---|---|---|
interactive_local | beside a person, on their credential and subscription | that person is present — there is no service identity behind it, no budget it can report and no expiry it can read |
unattended_machine | with no person present | it holds a service identity of its own, with an explicit budget, quota reporting, credential health and a machine-readable expiry |
The class is a property of the executor, not of the mission. The same mission dispatched to each differs in whether anyone is there to answer a prompt, and that is not something a mission can supply.
An interactive_local executor is never dispatched an unattended mission — not because it would refuse, but because it would wait, and a run blocked on a prompt nobody will answer is indistinguishable from one that is working.
Registered executors
--adapter value | Class | Binary | How the lease tool policy is passed |
|---|---|---|---|
claude-local (also claude_local) | interactive_local | claude | claude --allowedTools <tool> <tool> ... — a space-joined list |
codex-local (also codex_local) | interactive_local | codex | codex --tool a,b,c — a comma-joined list |
spine-unattended (also spine_unattended) | unattended_machine | vagaris-exec | vagaris-exec --allow-tools a,b,c — a comma-joined list |
claude-local is the default when --adapter is omitted. Underscores and hyphens are interchangeable and case is ignored.
Any other adapter type — including the adapters the server can run, such as gemini-local, cursor-local or process — is refused by dev with no CLI-hosted executor for adapter '<type>'. The refusal is deliberate: the CLI will not spawn an executor it cannot bound with an allowlist.
What the lease policy means for each executor
The lease's tool axis is one of three things:
none— the spawn is refused (lease A3 axis denies all tools). This is also what a lease with no tool policy becomes.- a non-empty list — passed as the executor's allowlist, exactly as shown above.
- for
codex-local, a missing list is also a refusal (lease carries no token allowlist for codex).
The CLI never passes claude --dangerously-skip-permissions. The curated sandbox allowlist that server-side sandbox runs use is not on the CLI path either; the lease is the only source of permission.
Readiness is reported, never inferred
Before every spawn dev asks the executor whether it can carry a mission. The answer comes from the
executor, because only it knows. An absent report is refused rather than assumed ready.
Vagaris used to read credential files it could not see from inside a container and conclude readiness from their absence — which returns the same answer for no credential, a credential somewhere I cannot see, and a credential I am not allowed to read. Those are three different facts and only one of them means not-ready.
Three values carry that honesty:
ready— can it run right now.credentialExpiresAt—nullmeans it has no expiring credential;undefinedmeans it could not tell. Reportingnullwhen nobody stamped an expiry is a stronger claim than the executor has evidence for.budget.state—unknownis notunlimited. A budget nobody reported is not an absent cap, and an unattended run that assumes otherwise discovers the cap by hitting it.
spine-unattended reports two gaps separately, because they send you to different places: the
workload identity is not bound yet is a conferral gap on the identity plane, while vagaris-exec is
not on PATH is a packaging gap on this machine. Collapsing them into one boolean is exactly the
complaint this contract was written to answer.
The unattended executor's identity
spine-unattended authenticates as its own service principal, Vagaris Spine Executor. It does
not borrow a person's credential and it is not Vagaris Cortex.
That separation is the design, not an implementation detail. Cortex owns cognition and missions; the executor claims and performs. A binding answers who is actually allowed to act, so collapsing the two would make a control look complete while contaminating audit, metering, revocation, attribution and least-privilege.
Two consequences worth stating plainly:
- The scope it is granted is not the authority needed to grant it. Conferring its workload binding
is governance-sensitive and floors at keystone; the binding that act produces carries only
capability.execution.claim. The executor must never be givencapability.governance.decideorcapability.governance.importto make a dispatch succeed — if a run needs those, this is the wrong actor for that work. - Placements get separate bindings.
executor:github-ci,executor:fleetandexecutor:customer-nodebelong to one executor family but are conferred individually, so each stays independently attestable and revocable. One broad subject stretched across them would make a single compromised placement indistinguishable from the others in an audit.
Instantiating the principal and conferring a placement binding are authority acts, not code
changes. Until they exist, spine-unattended reports not-ready and names the missing session — which
is the correct state, not a defect.
Configuring the unattended executor
Set by the machine path that already authenticated upstream — a CI OIDC exchange, or a node's enrolment — not by a person editing a file.
| Variable | Meaning |
|---|---|
VAGARIS_WORKLOAD_SESSION | the session the workload authenticates with. No fallback: unset means not-ready |
VAGARIS_WORKLOAD_SESSION_EXPIRES_AT | epoch seconds (ISO accepted). A passed expiry refuses the run |
VAGARIS_WORKLOAD_SESSION_SCOPES | space-separated scopes actually granted. Must include capability.execution.claim |
VAGARIS_API_BASE | the Vagaris host the runner claims from and asks cognition of. Required; https, or http only to loopback |
Unlike every other executor, vagaris-exec wraps no vendor CLI and holds no model access.
Vagaris brokers cognition: the runner claims the run it was dispatched for (--run-id, --agent-id)
with its workload session and the mission's --issue-id, under the adapter type spine-unattended
(the string a hold_exception approval's executor.adapterType must equal), reads its mission through
that lease (GET /api/cli/claim/:leaseId/mission: the issue the lease is for and its documents, resolved by the
server, with the signature in the x-vagaris-lease-signature header) unless an explicit vagaris-exec --prompt is given, then asks POST /api/cli/claim/:leaseId/cognition through the lease it now
holds, declaring the mission's vagaris-exec --privacy class (fleet_only or any; required, no default). Vagaris
applies the company's declared backends, the privacy class, the spend ceiling and the evidence trail,
and returns text. The runner never sees a provider key or a provider address, which is what makes a
customer deployment of this possible. The lease signature never leaves the process: it is not printed,
logged or written to the environment.
Dispatched mode is what a Vagaris dispatch runs: vagaris-exec --run-id <uuid> --dispatch-nonce <nonce>, and
nothing else. The claim carries the nonce instead of an agent and issue, and the server reads both from the run.
The tool allowlist is the signed lease's own A3b policy, read the same way vagaris dev reads it; a lease that grants
no tools ends the run as deny-default (exit 4). No privacy class is declared: the organization's AI policy decides.
Passing vagaris-exec --agent-id, vagaris-exec --issue-id, vagaris-exec --privacy, vagaris-exec --allow-tools or a
prompt beside the nonce is refused, because the run already answers each of them. The explicit form above stays for manual runs.
Serve mode (vagaris-exec --serve) is the long-lived managed executor that runs on Vagaris capacity. It
acquires its own runtime workload session from the local attestor (socket at VAGARIS_ATTESTOR_SOCKET, default
/run/vagary-attestor/attest.sock) and exchanges it through the same workload exchange as vagaris auth workload:
the identity issuer is the one the Vagaris deployment advertises (/api/cli-auth/oidc-config), never one configured on
the runner, and the session counts only once Vagaris confirms it as a workload principal in exactly one organization
(/api/cli-auth/me). The token is kept in memory only.
It then asks Vagaris for the next run (POST /api/cli/dispatches/next) and carries each one through dispatched mode.
It runs one run at a time and waits for Retry-After when there is nothing to do. On a stop signal it finishes the
run in flight or abandons it after a short grace period, and the lease expiry covers the rest. A lease that grants any
code or shell tool fails the run as code_execution_not_permitted_here before any cognition call, even though the
server already refuses to place such runs here. Serve mode exits 0 when stopped, 3 when it cannot get a session
(a renewed session refused again included), 6 on missing configuration, and 7 when Vagaris refuses its binding.
That last one is never retried.
The managed executor image (ghcr.io/vagarylabs/vagaris-cognitive-executor, built from
Dockerfile.cognitive-executor by the cognitive-executor-image workflow) is how serve mode runs on Vagaris
capacity. It contains one file: the self-contained vagaris-exec bundle, on a distroless Node base with no shell
and no package manager, running as a non-root user. Its entrypoint is vagaris-exec --serve, and nothing else.
It runs no code or shell tools: placement refuses to send it a run whose seat grants one, and the runner refuses
such a lease before any cognition call, both by the same closed rule (packages/shared/src/executor-class.ts).
It needs VAGARIS_API_BASE, VAGARY_IDENTITY_ISSUER and the attestor socket at VAGARIS_ATTESTOR_SOCKET.
The image carries the label com.vagarylabs.runtime-capabilities=governance, the only capability it may ask the
host's attestor for. The com.vagarylabs.application-id and com.vagarylabs.environment-id labels are set by the
runtime that places the container, from the identity registry, never baked in. Deploy it by digest: the identity
runtime binding pins that digest, and the attestor attests the digest the container actually runs.
The runner claims the run itself, so it is dispatched with a QUEUED run, as the mission-executor
workflow does. A host that has already claimed the run (vagaris dev) cannot hand its lease down, so
spawning vagaris-exec from there refuses at the claim.
Its refusals carry distinct exit codes, so an unattended failure is triageable without guessing:
| Code | Meaning |
|---|---|
2 | the arguments were malformed, an unrecognised flag was passed, --run-id/--agent-id/--issue-id/vagaris-exec --privacy is missing in the explicit form, or a dispatched run was given a flag the run already answers — refused, never ignored |
3 | no workload identity (readiness) — no request is made |
4 | no tool allowlist (deny-default): in the explicit form no request is made; a dispatched run whose lease grants no tools reports itself failed with no_tool_allowlist |
5 | Vagaris refused or failed the cognition (cognition_unavailable, cognition_budget_exhausted, …), named by its code |
6 | VAGARIS_API_BASE is unset, not a URL, or cleartext off loopback — no request is made |
7 | the claim was refused (binding, grant, run state — the server's code is passed through), returned no signed lease, or Vagaris was unreachable |
8 | the run was claimed but its mission could not be read (mission_not_found, a holder-proof refusal, …) |
9 | the run ended but its completion was not recorded: Vagaris refused the report (an expired or revoked lease) or stayed unreachable after the identical report was resent twice. Vagaris will not see this run end |
12 | a managed (serve-mode) run whose lease grants a code-execution tool: refused before any cognition, reported failed with code_execution_not_permitted_here |
11 | a dispatched claim was refused because its nonce expired (dispatch_nonce_expired) or names a dispatch that is no longer live (dispatch_nonce_not_live): re-dispatch, there is no authority to fix |
10 | Vagaris already holds a result for this run: a different completion (claim_completion_conflict) or the run ended another way (claim_run_terminal). The server's completion is in the report; the runner never runs the work again |
Once the claim succeeds, every exit reports how the run ended exactly once (POST /api/cli/claim/:leaseId/complete): succeeded, or failed with the server's code (8 and 5 above keep their codes when the report is recorded). A lost response is recovered by resending the identical report, which Vagaris answers with the completion it already recorded.
Adding an executor
A packaged adapter registers itself with registerCliHostedExecutor(adapterType, { binary, executorClass, reportReadiness, leaseAllowlistArgs }) from the CLI's executor registry; the function returns a disposer so a temporary registration (a test, a plugin unload) can restore the previous entry. The leaseAllowlistArgs function must return { refused: true } for a none policy — an executor that cannot express an allowlist must refuse, never run open. Declare executorClass honestly: an interactive_local executor stretched to cover an unattended mission is the failure this contract exists to prevent, and a new class member needs its own service identity rather than a borrowed one.
Executor requirements on the machine
- The binary must be on
PATHin the shell that runsvagaris dev. A missing binary surfaces as spawn exit code127in the report. - Provider credentials (for example
ANTHROPIC_API_KEY) must be present in that shell; see Model Providers. Note that the environment is sanitised before the spawn — product variables and interpreter hooks are stripped, provider keys are not. gitmust be available for the per-run worktree.
Server-side adapters
Runs triggered with vagaris heartbeat run or by the scheduler execute on the server with the adapter configured on the agent. Those adapters are documented under Adapters. The CLI bundles the local adapters (Claude, Codex, Cursor, Gemini, Grok, OpenCode, Pi, ACPX and the OpenClaw gateway) so pnpm vagaris-dev run can start a server that has them.