· 1 min read
The year the stack grew a loop
The new piece in a 2026 backend is a loop: a model, a few tools, and a place it is allowed to stop.
By this year the new piece in a backend was not another framework. It was a loop. A model, a handful of tools, and a condition that ends the run. Editors grew an agent. A shared tool protocol made those tools look the same from one client to the next. Local models got good enough to draft, and still bad enough that you read the diff.
A tool is an API
The diagram is easy. Owning the loop is not. A tool that calls your system is an API with a worse error message, unless you refuse to let it be one.
type ToolResult =
| { ok: true; value: string }
| { ok: false; error: string };
That shape is the whole contract I want back from a tool: a value the next step can use, or an error the trace can show. No prose in the middle. Timeouts, auth, and idempotency stay on the tool, the same as they would on a route a human client calls.
Where the loop should die
“Keep going” is how you get a bill and a bad migration. The stop condition is the product.
- Bound the number of calls, and the money, before the first call.
- Log the calls, not a paragraph about what the model meant to do.
- If a step writes, make the write something you can replay or refuse. A loop that mutates on a shrug is not an agent. It is a script you cannot read.
The trace matters more than the prompt. When the run fails, the prompt tells you what you hoped. The trace tells you what happened.