Implementation: DESIGN (server) · Exposure: PUBLIC PREVIEW (contract). The Agency API is not live yet. This page describes the published v0.3 contract so you can review and build against it; details may change before alpha.
A Run is one durable execution of a goal. It is persisted before the create call returns and survives process restart. The alpha opens only after a run can survive restart, resume, verify, replay and receipt-backed completion. For the concepts behind this page see The kernel.

Endpoints

Related: events, attention, artifacts and receipts of a run.

The Run object

Run IDs match ^run_[A-Za-z0-9]+$.

Status

Precedence when nodes differ: cancelling > paused > needs_attention > running > waiting > accepted.

Resolved defaults

resolved is always present. It holds everything the server resolved before execution. resolved.authority is a ResolvedAuthority: resolved.completion is a ResolvedCompletion:

Nested objects

budget_usage (BudgetUsage): completion (CompletionState). Each result is one of pending, pass, fail, inconclusive, error (VerificationResult). inconclusive is never a pass. output (RunOutput): cancellation (CancellationState): links (RunLinks): debug (RunDebugView), only with view=debug and scope debug:read. Its fields may change without a major version.

Create a run

Compiles the request into explicit internal contracts and returns the Run immediately. It never executes an implicit free-form loop. The run is persisted before 202 is returned. Only goal is required. The server resolves workspace, authority, budget and completion from the agent’s and profile’s versioned defaults and records them on Run.resolved before any execution. There are no hidden permissive defaults: if a default cannot be safely resolved the call fails with 422 ERR_DEFAULTS_UNRESOLVABLE and no run executes. Runs created here always have judge fail-closed and verifier-owned completion enabled; clients cannot disable either.

Parameters

Request body

AgencyRequest Unknown fields are rejected with ERR_INPUT_UNSUPPORTED, including any attempt to disable judge fail-closed or verifier-owned completion. Extension properties named x-<name> are accepted.

workspace

Workspace. resources items are ResourceRef.

context

Array of ContextItem. Supplied context enters as UNTRUSTED unless policy grants a trust class.

authority

Authority. profile is read-only, code-safe or code-write, optionally pinned as name@version. Bypass-style names are rejected with ERR_AUTHORITY_PROFILE_FORBIDDEN. grants items (Grant): network (NetworkPolicy). Private-address, redirect-hop and DNS-rebind defenses are always on. environment (ExecutionEnvironment). Raw environment inheritance is never allowed.

budget

Budget. At least one of max_seconds or max_cost_usd is required when you supply a budget. On exhaustion the platform first hard-stops all billable and effectful execution, then asks or stops.

completion

CompletionCriteria. Items in require are registry IDs (a string, latest version) or pinned {id, version} objects (CriterionRef). Custom criteria items (Criterion):

capabilities (tier B)

CapabilityLimits

models (tier B)

ModelConstraints. Constrain by logical class, locality and trust. Model or vendor names are rejected.

graph (tier C)

GraphSpec. Treated as opaque until the public Graph contract is frozen.

runtime (tier D)

RuntimeHints. Hints never change semantics, eligibility, policy or evidence.

Responses

Example

The 202 response body is a Run with status: "accepted". A full response, including resolved, is shown in the overview. Error example, when defaults cannot be resolved:

List runs

Returns a page of runs, newest first.

Parameters

status takes a comma-separated list, for example ?status=running,needs_attention.

Responses

RunPage:

Example

The example item is shortened. Each item is a full Run.

Get a run

Returns the current run state. The default view hides kernel internals.

Parameters

Responses

Example

A completed run (shortened; resolved and links omitted):

Submit input

Answer an attention request, steer the run, or add data. approval and rejection must carry attention_id. An approval only resolves a policy ask; it can never override a hard policy deny (403 ERR_POLICY_DENIED). Input is recorded as a receipt before it takes effect.

Parameters

Request body

RunInput

Responses

InputAccepted:

Example

Pause a run

Asynchronous and idempotent. Nodes stop at the next safe boundary; in-flight effects finish and are receipted; leases are released. Status goes to paused. Pausing a paused run is a no-op (202, same Run).

Parameters

Request body

Optional. ControlRequest

Responses

Example

The response is the Run. Its status becomes paused once nodes reach a safe boundary.

Resume a run

Asynchronous and idempotent. Resumes from durable state and receipts, never from a transcript. A node interrupted in the middle of an effect is not blindly re-run: it resumes only if its effect is idempotency-keyed and receipted. Otherwise the run raises an attention request (reason unsafe_resume).

Parameters

Request body

Optional. ControlRequest (reason).

Responses

Example

Cancel a run

Asynchronous and idempotent. Status goes cancelling, then cancelled.
  • No new node is admitted or leased after the request is receipted.
  • Effects already dispatched are not silently abandoned. Each one completes, times out, or is rolled back where the node declares a rollback, and its outcome is receipted. Run.cancellation.effects_in_flight lists them until settled.
  • Open attention requests are withdrawn.
  • Repeating cancel on a cancelling or cancelled run returns 202 with the current Run.
  • Cancelling a run already completed, partial or failed returns 409 ERR_RUN_TERMINAL.

Parameters

Request body

Optional. CancelRequest

Responses

Example

The example is shortened to the fields that change.

Get the compiled graph

Disclosure tier C. Requires scope graph:read. This is not part of the Goal API. It shows the graph the request compiled into, and each node’s lifecycle position.

Parameters

Responses

GraphView:

Example