What should be an agent — and what should be normal code?

Four questions — ambiguity, repetition, failure cost, auditability — that decide whether a task deserves an agent or a script, with the measured evidence from this rig's own routing decisions.

8/29/2026

The most expensive mistake in agent work is using an agent where a script belongs. It is also the most common one, because agents are exciting and scripts are not. This article offers four questions that settle it, and the evidence from this rig's own decisions.

Four questions: is it ambiguous, does it repeat, what does failure cost, who must audit it
A working heuristic, not a formal theory. The honest answer is usually code. Evidence date: 29 August 2026. Download the editable Excalidraw source.

The four questions

Is it ambiguous? If the input varies in ways rules cannot enumerate — a messy brief, an unclear spec, a weird repo state — judgment is required, and that is an agent's home turf.

Does it repeat? Same input, same output, every time. Repetition is a script's home turf. An agent on a deterministic job burns tokens for variance you did not want.

What does failure cost? Cheap failure (a draft nobody ships, a suggestion nobody takes) tolerates agents. Expensive failure (payments, publishing, anything client-facing) needs deterministic paths and guardrails.

Who must audit it? If a decision needs to be traced after the fact — compliance, billing, client disputes — you need either normal code or a fully logged agent with provenance attached.

Decision tree resolving the four questions into normal code, an agent, or a logged agent
Work through the questions in order. Most tasks resolve before the third question. Evidence date: 29 August 2026. Download the editable Excalidraw source.

A decision in sequence

Five steps: task arrives, ask ambiguity, ask repetition, ask failure cost, choose code, agent, or hybrid
This sequence is how this rig's own automation decisions are made. Evidence date: 29 August 2026. Download the editable Excalidraw source.

The measured before and after

Before: an agent on a deterministic job producing nondeterministic output and burning tokens. After: deterministic code that is fast and auditable, with the agent freed for real judgment
The deterministic path was measured: same output, lower cost, no variance. Known from this rig's routing decisions. Evidence date: 29 August 2026. Download the editable Excalidraw source.

The hybrid pattern that usually wins

Most real work is a script with an agent at the edges: deterministic pipeline for the 90% that repeats, agent for the 10% that needs judgment, with the handoff explicit.

Where to go next

This site's own routing system is a working instance of the hybrid pattern: cheap workhorse for routine work, frontier escalation only when the questions above say the judgment is real.