Your agent's p99 is a different animal

Average latency is the number you demo and the number nobody experiences. A multi-step agent is a sum of random variables, so its total time is dominated by the tail of each step — and the more steps you add, the more certain it becomes that at least one of them is slow. Here’s the model, why the p99 of the whole is worse than the p99 of the parts, and the two levers that actually move it.

July 13, 2026 · 6 min · 1264 words · Loop & Retry

Compaction is a lossy operation

When the context window fills up, the standard fix is to summarize the old turns and keep going. That summary is a lossy compression step, and the thing it silently drops is usually the one early constraint the agent needs a hundred turns later. Here’s why recency-based compaction fails, a simulation of how often the load-bearing fact survives, and the rule that actually protects it.

July 13, 2026 · 7 min · 1286 words · Loop & Retry

Tool output is untrusted input: prompt injection is a data-flow bug

Prompt injection isn’t a prompting problem, so you can’t prompt your way out of it. It’s the same class as SQL injection: data from an untrusted source crosses into a control channel and gets executed as instructions. The web page your agent just fetched, the ticket it just read, the email in its inbox — all of it is attacker-controllable input flowing straight into the one component that can’t tell data from commands. Here’s the data-flow framing, why ‘ignore injected instructions’ can’t work, and the boundary that actually helps.

July 13, 2026 · 8 min · 1517 words · Loop & Retry

Your retry just sent the email twice: idempotency keys for agents

Retrying a read is free. Retrying a write can charge a card twice, send two emails, or book two rooms — and the model has no idea it happened. Retry safety is a property you build into the tool, not a flag you set on the loop. Here’s why at-least-once delivery is the default you’re actually running, how to derive a stable idempotency key from an agent’s intent, and a dedup wrapper that makes any write safe to retry.

July 13, 2026 · 8 min · 1535 words · Loop & Retry

Postmortem: the agent that spent $200 retrying a 400

An agent burned ~$200 overnight retrying an HTTP 400 — a request that was defined to fail. No component was buggy; each layer retried “reasonably.” The teardown: why retryability is a property of the error and not a default, how three nested retry caps multiply into 75 doomed attempts per item, and why per-step caps never bound a bill. With the two-line fix and a circuit breaker.

July 12, 2026 · 10 min · 1973 words · Loop & Retry

When not to build an agent

An agent is an LLM that controls its own control flow — and that autonomy has a price you pay on every run: quadratic token cost, serial latency, and a failure surface you can’t unit-test. Most tasks people reach for an agent on are a fixed pipeline wearing a costume. Here’s the decision checklist I use, the arithmetic on what the agent tax actually costs, and the same task built both ways so you can see the difference.

July 8, 2026 · 9 min · 1911 words · Loop & Retry

Your LLM-as-judge is lying to you

A model grading your agent’s output is the only thing that scales for subjective quality — and it’s a biased instrument you’re reading as a ruler. Here are the biases that actually move scores (position, verbosity, self-preference, leniency), why raw agreement with a human hides them, and how to validate and harden a judge with code — including why you should be reporting Cohen’s kappa, not accuracy.

July 8, 2026 · 10 min · 1958 words · Loop & Retry

What to actually measure when your agent "works"

“It works” is a demo result, not a measurement. An agent is a trajectory, not a function, and grading only the final answer throws away most of what decides whether it’s reliable. Here’s a five-layer scheme for what to measure — outcome, trajectory, cost, failure class, and stability under nondeterminism — with a small harness that computes it.

July 7, 2026 · 10 min · 2112 words · Loop & Retry

The context window is a cache, not a memory

Treating the context window as append-only memory is how agents get slow, expensive, and quietly wrong. The fix is to run it like a cache with a budget and an eviction policy: decide what earns its tokens every turn. Here’s the cost math, the accuracy failure mode, and a working context manager.

July 7, 2026 · 9 min · 1826 words · Loop & Retry

Loop drift: how agents convince themselves they're making progress

The worst agent failures don’t crash — they keep working. A postmortem on loop drift: an agent that stayed busy for 40 steps without getting closer to done, why the model’s own progress reports can’t catch it, and the external signals and evals that can.

July 7, 2026 · 9 min · 1737 words · Loop & Retry