← Patterns

Build with AI, Run Deterministic

Core principle: AI belongs at the construction layer (write the workflow, generate the spec, design the UI, codify the policy). The runtime should be deterministic, auditable, and thermodynamically efficient. The agent’s job is to write the workflow, not be the workflow.


The articulation

Matt Dean (Trabian, May 9 2026):

“Our thesis with AI is that AI should be used to build as much as possible and run as little as possible. By which I mean, you shouldn’t have to be able to use AI to do anything that’s deterministic. So our whole platform is built around this idea that you should be able to use deterministic, auditable, thermodynamically efficient, ultimately, tools to be able to run your workflows… but that AI should be able to help you create the right thing in the first place.”

“We’re not trying to run an agent to reinvent the wheel every single time you need to display a widget.”

In Mesh: the AI agent is the workflow constructor (operator-facing, conversational, gathers requirements, drafts the spec) but the runtime is Temporal + TypeScript — deterministic, durable, replayable. AI builds; Temporal runs.


Why the principle matters

Three properties get worse the more AI you push into the runtime:

  1. Determinism. Same input → same output is a non-negotiable invariant for financial workflows, audit trails, regulated environments. LLM inference is non-deterministic by design (sampling temperature, model updates, prompt drift).
  2. Auditability. Compliance, post-mortems, and debugging all depend on being able to reconstruct exactly what the system did. Deterministic code has a deterministic trace. Agent-in-the-loop runtime traces include “the model said X this time” — which can’t be re-derived.
  3. Thermodynamic efficiency. LLM inference at runtime burns tokens (and dollars and latency) for behavior that, once specified, can be encoded in microseconds of CPU. Re-paying for the same decision every request is the wrong cost curve.

The fourth, implied: legibility. A deterministic workflow is one a human can read, modify, and trust without watching it run. An agent-in-the-loop runtime is opaque.


The construction layer is where AI’s leverage lives

Inverting the principle: what gets better the more AI you push into construction?


Who else has converged on this

The counterexamples (chatbots, agentic copilots, anything ReAct-style) are intentionally agent-in-runtime because their task is conversation. But for any task that can be specified, AI in construction beats AI in runtime.


Where this is the wrong principle

Not all problems can be specified ahead of time. AI in the runtime is correct when:

The rule of thumb: if you can write the deterministic code, you should — and you should use AI to write it. If you can’t write the deterministic code (because the task itself is fuzzy), AI at runtime is the right tool.


How this changes engineering work

If you take the principle seriously, the shape of an engineering team changes:

The center of gravity moves from “writing the code” to “designing the system that AI writes the code into.” This is the same shift Augmentation-Over-Automation describes at the design-philosophy level — but sharper, applied to runtime architecture.


Tactical questions when applying

  1. Where in our stack is AI currently in the runtime that could be moved to construction? (e.g., classification logic that runs on every request and rarely changes.)
  2. Where in our stack do we run code generated by AI without auditing it once? (Construction without review is its own failure mode.)
  3. What’s the “spec → deterministic code” pipeline? If absent, AI’s construction-layer leverage doesn’t compound.
  4. Are we paying for inference at runtime when we could pay it once at construction? (Cost smell.)

Connections


Cross-References