In the age of AI, we kind of forgot that there are things that should be kept deterministic — which is what programming gave us from the start. I would even venture to say that in the rush to make software intelligent, we are forgetting that much of software's value comes from being predictable. Surely, not every problem should be answered probabilistically. Some operations must remain deterministic: the same valid input should produce the same correct output, governed by explicit rules that can be tested, audited, and trusted.
Determinism does not guarantee correctness. A deterministic program can reliably produce the wrong answer. But it makes the behavior reproducible and inspectable. When something goes wrong, we can trace the execution, identify the faulty rule, write a regression test, and fix it.
With an LLM, the same request can take a different path each time. That flexibility is valuable when the problem is ambiguous. It becomes a liability when the answer is already known.
Simply stating that we need deterministic software is not enough. The issue becomes clearer when we look at how agents work today.
Consider a data agent that translates natural-language questions into SQL and queries an organization's structured and unstructured data. A question such as "What was recognized revenue by region last quarter?" may initially require genuine reasoning. The agent needs to identify the relevant metric, understand what "last quarter" means, locate the correct tables, determine the required joins, and produce a valid query.
But suppose the user provides the SQL directly. Sending the request through an LLM reasoning loop is wasteful. The system already knows exactly what operation was requested.
The same applies when the agent has generated and validated the query before. If users repeatedly ask for recognized revenue by region, the system should not regenerate the SQL every time. It should retain a parameterized query for future use and execute the query directly. The LLM should return only when the request no longer fits the known operation.
Coding agents have a similar problem. They often begin every task like a new employee on their first day. The agent searches the repository, opens configuration files, traces imports, rediscovers architectural conventions, and reconstructs the same mental model repeatedly.
The first exploration of a repository should produce a durable, structured artifact — a map, if you will, of the whole code. That artifact can be versioned against a Git commit. When the repository changes, the system should update the affected portions instead of rebuilding its understanding from scratch.
The agent still needs to reason about the new task. It does not need to spend tokens rediscovering the unchanged environment in which that task exists.
The same inefficiency appears in general tool-using agents. The tools that we love to give agents to do tasks for us? Tool-using language-model agents repeatedly rediscover procedures they have already executed, producing traces that mix reusable structure with retries, exploration, accidental ordering, and repeated lookups. An agent may resolve a customer identifier, retrieve invoices, calculate an outstanding balance, and create a report. On the next occurrence, it performs the same lookups, rereads tool descriptions, retries similar calls, and reconstructs the same sequence.
In these three use cases, we spend tokens to get a job done that we already know how to do, so we don't need the LLM to decide on that. My claim is that AI should resolve uncertainty once. When the uncertainty has been removed, the system should switch to a deterministic path and reuse what it has learned. Recent projects such as TraceCompiler, Etchplan, and AgentJIT explore versions of this idea: observe repeated agent behavior and compile its stable portions into reusable workflows.
What does it mean? Every successful agent execution should be treated as a candidate software artifact. In this way, agents should not merely remember what they did — they should progressively convert repeated reasoning into validated software, preserving an LLM only at the points where uncertainty genuinely remains.
We can call the layer responsible for this conversion a Deterministic Agent Harness.
A Deterministic Agent Harness is a runtime that identifies which parts of an agent task are already understood, executes those parts through validated deterministic workflows, and invokes model reasoning only where unresolved uncertainty remains.
Its basic loop is:
Observe -> Extract -> Validate -> Execute -> Monitor -> Invalidate
First, the harness records structured execution traces: tool calls, arguments, results, errors, permissions, environmental state, and validation outcomes.
It then looks for recurring operations. It separates required steps from exploration and retries, identifies variable inputs, and traces which outputs feed later operations.
The result becomes a candidate workflow. It is treated as untrusted generated code and subjected to appropriate checks: type validation, permission review, replay against successful traces, regression tests, dry runs, resource limits, and human approval where consequences justify it.
Once approved, the workflow becomes available as a deterministic fast path. A future request uses it only if the request, permissions, inputs, and environmental dependencies still satisfy its applicability contract. Otherwise, the system falls back to the agent.
The rule is simple: Deterministic when known. Agentic when necessary.
I built a reference implementation of this architecture in the Deterministic Agent Harness. It demonstrates how validated workflows can execute through a deterministic runtime while unsupported or invalidated requests fall back to an agent.
The same runtime carries a knowledge plane — an agent-maintained, versioned map retrieved deterministically — so the agent stops rediscovering the unchanged environment. The reference implementation covers the runtime, conservative routing, dependency-aware invalidation, and knowledge retrieval; automatic trace-to-workflow compilation is future work.