$ fssg build --deterministic --validate |

Workflow, Framework, Harness, or Runtime? Choose by Failure Ownership

AI Engineering

The fastest way to choose an agent stack is to stop comparing feature lists and ask a harsher question: which layer owns the failure when the model, worker, process, or external system misbehaves?

“Workflow,” “framework,” “harness,” and “runtime” are often presented as competing product categories. They are not. They are control layers with different responsibilities, and a serious system may need several of them at once. The useful distinction is not how much AI each contains. It is which failure boundary each one can actually enforce.

The four layers in one table

Layer Primary job What it should own What it does not automatically solve
Workflow Fix the route through a task Step order, branching, approvals, explicit gates Open-ended tool use, durable recovery, isolation
Framework Provide agent-building primitives Tool schemas, model calls, handoffs, memory interfaces, guardrails Process survival, effect deduplication, infrastructure
Harness Run a useful agent loop Tool execution, context compaction, iteration, local session behavior Durable business state, distributed coordination, exactly-once effects
Runtime Preserve execution semantics over time State, checkpoints, pause/resume, replay, scheduling, observability A good task model, safe tools, correct product policy

This is an ownership map, not a maturity ranking. A workflow is not a primitive runtime. A harness is not a “more advanced” framework. Each layer becomes necessary when a particular class of failure becomes expensive.

Start with the cheapest layer that contains the uncertainty

Anthropic draws a useful line between workflows, where code determines the path, and agents, where the model dynamically directs its tool use. I would turn that distinction into a design rule:

  • if the route is known, encode the route;
  • if the route is uncertain but the available actions are known, use an agent loop;
  • if the work must survive interruption, add durable execution;
  • if actions cross a trust boundary, add authorization and effect controls independently of all three.

This prevents a common architectural mistake: buying autonomy to solve a routing problem. A document pipeline with five stable stages does not need a planner to rediscover those stages on every run. It needs explicit transitions and perhaps one bounded model decision inside a stage.

The opposite mistake is forcing an exploratory coding or research task into a giant static graph. When the next useful step depends on what the tools reveal, a harness is the natural execution surface. It can inspect, act, observe, and continue. The graph should describe the hard boundaries around that loop, not pretend to know every step inside it.

Frameworks answer “how do I build the agent?”

An agent framework gives application code a vocabulary: agents, tools, handoffs, sessions, guardrails, traces. The OpenAI Agents SDK, for example, exposes agents with instructions and tools, handoffs, guardrails, sessions, and tracing. These are valuable construction primitives.

But a framework-level session is not automatically a durable process. If a worker dies after an external side effect and before local state records success, the next attempt may repeat the effect. A trace can show that duplication happened; it does not prevent it. A guardrail can reject an invalid model output; it does not restore a crashed process.

Choose a framework when the main engineering problem is composing model behavior inside an application. Do not infer that its agent abstraction also owns recovery, scheduling, sandboxing, or effect identity unless the documentation and your tests show that explicitly.

Harnesses answer “how does the agent keep working?”

A harness supplies an opinionated loop around the model: tool discovery, tool execution, iteration, context management, and often file or shell access. This is why coding agents feel immediately capable. The difficult local mechanics already exist.

The trade-off is hidden policy. The harness decides when to compact context, how to represent tool results, which errors return to the model, and when a run is complete. Those decisions become part of application behavior even when they are not expressed as product code.

I use three questions to evaluate a harness:

  1. Can I observe the exact sequence of model decisions and tool effects?
  2. Can I constrain authority separately from capability?
  3. Can I resume after interruption without guessing which effects already happened?

A “no” does not make the harness useless. It defines where another layer must take over. IOSM CLI is useful here as a concrete example of a terminal-native harness/runtime boundary: sessions, contracts, checkpoints, permissions, orchestration, and machine-readable modes surround the agent loop. Those controls still do not turn every external API call into a durable transaction. The effect boundary remains an application responsibility.

Runtimes answer “what survives?”

A runtime becomes necessary when execution outlives one process, one request, or one human attention span. LangGraph documents checkpointed state, pause/resume, and replay-based durable execution. Temporal models workflow execution through an event history that workers replay to reconstruct state.

That changes the failure model, but it does not abolish failure. Replay makes determinism and idempotency design constraints. LangGraph explicitly warns that resumption may replay from an earlier point and recommends isolating non-deterministic operations and side effects in tasks or nodes. Temporal similarly separates workflow logic from activities that interact with the outside world.

The practical test is simple: kill the worker immediately after a tool changes an external system. Then resume the run. If the action is repeated, skipped, or left ambiguous, the runtime boundary is incomplete for that effect.

This is why I define an AI engineering runtime by responsibilities rather than by packaging. A runtime must make state transitions, authority, evidence, and recovery explicit. “Long-running” is not enough. The system has to explain what completed, what may be retried, and what requires compensation or human review.

Choose by the failure you cannot afford

Use this decision matrix before comparing vendors:

Unacceptable failure Minimum control layer to evaluate Required proof
The model takes an invalid route Workflow or constrained graph Branch tests and explicit stop conditions
A tool receives malformed arguments Framework plus schema validation Rejected invalid calls
The agent edits outside scope Harness plus permission boundary Denied unauthorized operation
A crash loses hours of progress Durable runtime Kill-and-resume test
A retry sends the same message twice Runtime plus idempotent effect adapter Stable effect ID and duplicate suppression
An approval is bypassed after resume Workflow/runtime authorization gate Replay test across the approval boundary
Nobody can explain the final change Trace and evidence contract across layers Linked decisions, tool results, and artifact diff

Notice the repeated “plus.” No single label is enough. Durable execution without safe effects can repeat damage reliably. A sandbox without a state model can lose work safely. A framework with excellent traces can document an architecture that still cannot recover.

A stack should compose, not collapse

A robust architecture often looks like this:

product workflow
  -> durable run state
    -> agent harness
      -> framework primitives
        -> authorized tools
          -> idempotent effect adapters

The model may choose the next investigative step inside the harness. The workflow still owns approvals. The runtime still owns resumable state. Tool adapters still own effect identity. Product policy still decides which transitions are legal.

This layered view also clarifies where formal contracts belong. FACET can constrain inputs, outputs, budgets, and failure semantics around model execution. It should not be stretched into a substitute for a scheduler or a sandbox. Likewise, a durable engine should not be expected to understand the semantic validity of a model result unless that contract is supplied.

The selection exercise I would run

Before adopting a stack, implement one representative task and force five failures:

  1. return an invalid tool argument;
  2. deny a requested permission;
  3. terminate the worker before a tool call;
  4. terminate it immediately after an external side effect;
  5. change the code or prompt before resuming an old run.

Record which layer detects each condition, which layer decides the next transition, and which artifact proves the outcome. If ownership is unclear, the architecture is unclear.

This exercise does not produce a universal winner. It produces something more useful: a boundary map for your system. You may discover that a small workflow plus a framework is enough. You may need a harness inside a durable engine. You may need no autonomous loop at all.

Choose the stack that owns your expensive failures. Everything else is ergonomics.

Sources

FACET AI CLI Terminal
facet@ai:~$