Loop & Retry

Field notes on building LLM agents that survive production. Concrete code, real failure modes, numbers over adjectives — context, tools, evals, cost, and the ways agents break.

Quarantine the tool result: a code-level defence for injected agent output

You can’t make a model reliably ignore instructions hidden in a web page or ticket, but you can make sure that when it fails, the damage is small. Three patterns you can apply today: wrap every tool result in a typed envelope the planner never treats as instructions, strip authority from tools once tainted data is in context, and keep a replay harness of injected payloads in CI so the defence is tested instead of assumed.

November 20, 2026 · 7 min · 1462 words · Loop & Retry

The timeout that might have worked: how to retry when you don't know if the first call landed

A timeout is not a failure. It’s an unknown, and retrying an unknown is how agents double-send emails and double-charge cards. A practical way to handle it: sort every tool into one of three classes, treat a timeout as a fourth outcome that needs its own branch, verify by reading the effect before you write again, and fall back to a reconciliation record when the tool gives you nothing to read.

November 13, 2026 · 7 min · 1435 words · Loop & Retry

Multi-agent livelock: when a critic and an executor politely hand the task back and forth forever

Livelock is the multi-agent failure that looks like diligence. A critic flags something, an executor fixes it, the fix trips a different check, and the crew spends real money making no net progress while every individual step looks correct. Why a per-agent loop cap cannot see it, the three shapes it takes (oscillation, escalation spiral, and the polite deferral loop), how to detect it from a hash of shared state instead of from the transcript, and a crew-level budget that turns an endless loop into a finite, reportable outcome.

November 6, 2026 · 13 min · 2624 words · Loop & Retry

Testing multi-agent crews: forcing split-brain, goal drift, and context drift to happen in CI

Coordination failures don’t show up in a test suite because the test run happens to schedule agents politely. Split-brain needs a specific interleaving, goal drift needs a specific chain of lossy handoffs, and context drift needs a correction that lands mid-run. All three can be forced deterministically: a scripted scheduler that controls who reads and writes when, a handoff chain with an assertion on the constraint ledger instead of on the output, and a mid-run policy change with a stale-holder check. Concrete harness code, what each test asserts, and why you should not assert on model output at all.

October 30, 2026 · 10 min · 1958 words · Loop & Retry

Tool design for reliable multi-agent crews: preventing coordination failures at the tool boundary

Every fix this cluster has proposed for split-brain, goal drift, and context drift is a discipline — something an agent has to remember to do. Agents are bad at remembering and excellent at doing what a schema requires, which makes the tool boundary the cheapest place to prevent a coordination failure: a tool that cannot express a stale write cannot cause a split-brain. Concrete signatures for compare-and-set state, constraint-carrying handoffs, and staleness-aware reads — plus the three tool shapes that manufacture these failures on purpose.

October 23, 2026 · 10 min · 1994 words · Loop & Retry

Observability for multi-agent systems: instrumenting for split-brain, goal drift, and context drift

Every coordination failure in a multi-agent system is a diff between two agents — and per-agent monitoring cannot express a diff. You can have complete, exception-free telemetry on every agent in a crew and still be structurally blind to split-brain, goal drift, and context drift, because each one lives in the comparison your telemetry has no join key for. What to actually instrument for each of the three, which probes are free and which cost a model call, and how to sample a crew for belief reconciliation without paying O(n) extra calls at every checkpoint.

October 16, 2026 · 10 min · 1939 words · Loop & Retry

Context drift: when a multi-agent crew's shared beliefs about the goal go stale

A cache that’s never invalidated doesn’t know it’s stopped being correct — it just keeps serving the value it read at write time. Give a multi-agent crew a shared objective instead of a shared cache and you get the identical failure with none of the tooling that usually catches it: every agent read the goal once, at spawn, and nothing tells it when that copy goes stale. This is multi-agent context drift — distinct from goal drift (the target itself moving) and split-brain (the crew’s facts about state disagreeing) — a concrete policy-escalation failure, the mechanism, and what to instrument before a customer hears a promise nobody’s operating on anymore.

October 9, 2026 · 9 min · 1786 words · Loop & Retry

Goal drift: how a multi-agent crew ends up solving a different problem

Loop drift is one agent staying busy without getting closer to done. Hand the same failure to a crew and every agent stays busy, produces defensible work, and the team’s collective objective still ends up somewhere your original request never sent it — a genuine multi-agent goal drift failure mode, not a mistake in any single agent’s reasoning. A concrete feature-build failure, the four things that make a goal decay one handoff at a time, and what to measure so a ‘done’ check compares against the original ask instead of the nearest upstream spec.

October 2, 2026 · 8 min · 1525 words · Loop & Retry

Split-brain: when multi-agent memory consensus quietly fails

In distributed systems, split-brain is what happens when a partition convinces two halves of a cluster that each is the sole leader, and both start accepting writes. Multi-agent systems build the identical topology every time more than one agent reads and writes a ‘shared’ memory store with no lock, no leader, and no version check — and the failure that follows is a genuine multi-agent memory consensus problem, not a bug in any one agent. The mechanism, a concrete incident-response failure, and what to instrument before it costs you a duplicate action.

September 25, 2026 · 8 min · 1585 words · Loop & Retry

Context engineering: what fits and what gets dropped

“Context engineering” is getting used as a rebrand for prompt writing, and that undersells it into uselessness. The actual discipline is deciding, every single turn, what earns a place in a bounded window and what gets evicted — and living with the fact that every eviction is a bet you’re making about the future of a run you haven’t finished yet. Here’s the physical constraint underneath the buzzword, the packing decision that’s actually hard, what it costs to get it wrong, and how to test whether your packing policy works.

September 18, 2026 · 11 min · 2209 words · Loop & Retry