Agent, Harness, Workflow, or Runtime? Choose the Missing Layer
Most AI architecture debates start with products. I think that is backwards. Start with the failure you cannot tolerate, then choose the smallest execution layer that owns it.
An agent, a harness, a workflow, and a runtime are not four names for the same loop. They own different kinds of state and failure. Confusing them produces systems that look sophisticated but have no clear recovery authority.
The four layers
| Layer | Primary job | State it should own | Failure it can answer |
|---|---|---|---|
| Agent | Decide the next action | Conversation and task-local reasoning | “What should I do next?” |
| Harness | Connect model, tools, limits, and observations | Turn state, tool results, budgets | “How does this model/tool loop run safely?” |
| Workflow | Encode known stages and dependencies | Business/process progress | “Which step is ready, blocked, or complete?” |
| Runtime | Govern execution across failures and side effects | Durable run state, policy, receipts, checkpoints | “May this operation resume, retry, compensate, or stop?” |
The boundaries can live in one codebase. They still need separate contracts.
Agent: use judgment where the path is not known
An agent is useful when the next step depends on interpretation: inspect a repository, choose a file, formulate a query, or decide which diagnostic to run. The OpenAI Agents SDK, for example, describes a runner loop that calls a model, executes tool calls, handles handoffs, and stops on a final output or turn limit.
That is valuable orchestration inside a run. It does not automatically settle what happens after a process crash halfway through an external mutation.
Harness: make the loop observable and bounded
A harness is the engineering shell around model behavior. It selects models, exposes tools, limits turns, records events, evaluates outputs, and isolates untrusted tool content. MCP standardizes a large part of the connection surface—resources, prompts, tools, capability negotiation, cancellation, and errors—but the protocol does not become your application’s recovery policy.
Choose a harness when the main problem is inconsistent model invocation or unsafe tool plumbing. Do not ask it to impersonate a durable workflow engine unless it actually persists transitions and side-effect receipts.
Workflow: make the route explicit
A workflow is right when stages are known: collect input, generate a patch, run tests, request approval, deploy. LangGraph’s persistence model illustrates the distinction well: checkpointers keep thread-scoped graph state, while stores keep application-defined data across threads.
A workflow answers where execution is in the graph. It may still need a stronger substrate when a node sends money, publishes a message, or changes production state. “Node completed” and “external effect is verified” are not equivalent facts.
Runtime: own recovery authority
A runtime becomes necessary when execution must survive interruption without guessing. Temporal defines workflow execution as durable function execution and uses replay to reconstruct progress. IOSM CLI takes a developer-runtime route with filesystem checkpoints, deterministic rollback order, policy decisions, traces, and persistent engineering artifacts.
The important property is not the label. It is authority. A runtime must be able to say:
operation: publish_release
intent_id: rel_2026_09_08_01
input_hash: sha256:...
policy: verify_before_retry
receipt: github_release_1842
observed_state: published
next_action: skip_retry
Without that record, “retry” is another model suggestion. With it, retry is a governed transition.
A failure-first decision matrix
| Your dominant failure | Add first | Why |
|---|---|---|
| Poor next-step choices | Agent | You need adaptive judgment |
| Tool calls are opaque or unbounded | Harness | You need limits, events, validation, and trust boundaries |
| Teams disagree about stage order | Workflow | You need explicit dependencies and gates |
| Runs die around side effects | Runtime | You need durable receipts, idempotency, replay, and compensation |
| All four appear | Layer them | No single abstraction should own every concern |
This avoids a common overbuild: adopting a durable platform for a read-only summarizer. It also avoids the opposite mistake: shipping a payment or deployment agent whose only recovery mechanism is conversation history.
The test I use
For every side-effecting step, ask four questions:
- What stable identifier names the intent?
- What evidence proves whether the effect happened?
- Who decides whether retry is safe?
- What state survives if the process disappears now?
If the answers are “the prompt,” “the last message,” “the model,” and “nothing,” the system does not yet have an execution contract.
This is why I separate the AI engineering runtime from the agent inside it. It is also why IOSM CLI stores checkpoints and artifacts rather than treating chat history as operational truth. FACET approaches the same boundary from the contract side: YAML is authoring; canonical JSON is the execution identity.
The practical rule is simple: do not choose the largest framework. Choose the missing owner of your failure. Then make its state explicit enough that another process—not another guess—can continue the work.