Skip to content

The closed primitive set

The kernel executes a closed set of fifteen primitives, and a workflow reaches execution only as a graph over them. Every primitive has a typed contract and defined hook points, so every action passes enforcement and leaves evidence. This page covers what each primitive defines, why the set is closed, and how the kernel refuses anything outside it. The primitives are listed in Workflow primitives.

Two kinds of step

Everything in a workflow is one of two things:

  1. A call into reviewed, sealed code. The authoring keys do:, agent:, delegate: and include: all become calls: into a reusable capability block, an agent, a subagent or another published workflow.
  2. A primitive from the closed set. Control flow, failure handling, waiting, state writes and evidence emits.

Arbitrary computation lives inside a sealed block. Outside a block, a workflow author's only computation is the constrained expression language of when: and bind:, which is reviewed and locked as a language. Which language that is (CEL, restricted Starlark or a custom DSL) is an open decision.

What each primitive defines

Part What it fixes
Typed input record What the primitive accepts
Typed output record What it produces
Declared failure modes How it fails, as typed outcomes that try and catch can match
Lowering target The IR form the workflow compiler produces for it
Hook points The moments in its execution at which enforcement runs

Why the set is closed

Enforcement covers every action. The six hooks are attached to defined moments of primitive execution. With a closed set, every call, state write, model request, delegation and emit passes its hook.

Every path is a step. Each branch, retry, wait and failure path a run can take appears as a step of the workflow, in order.

Checkpoint and resume hold for every step. Suspend, checkpoint and resume are defined for each primitive, so a suspended run resumes at the step where it stopped.

Every step leaves typed evidence. Each primitive emits typed events that carry the run fingerprint, so the record of a run follows its structure.

One kernel serves every project. New workflows and agents compose the same fifteen primitives.

The set changes only through a change to the kernel contract.

Refusing an IR outside the set

flowchart TB
  subgraph CP["CONTROL PLANE"]
    direction TB
    COMP["Workflow compiler<br/>lowers to the closed set"]
  end
  subgraph XCK["KERNEL"]
    direction TB
    VAL{{"Run-plan validation<br/>every operation in the set?"}}
    RUN["Primitive execution"]
    REJ(["Rejected before step one"])
  end
  COMP -->|"1. compiled IR in the sealed run-plan"| VAL
  VAL -->|"2. yes"| RUN
  VAL -->|"2. no"| REJ

Workflow compiler produces IR over the closed set only. Run-plan validation checks the IR again at run start, together with the run-plan's signatures and hashes, and a run-plan with any operation outside the set reaches Rejected before step one with no step executed.