The rules I keep coming back to, mostly learned from agents that got something wrong on a real app.
Ground the model in evidence
Agents decide from what is really there: the DOM, screenshots, parsed routes, retrieved tests. Not from a guess about the page.
MeasuredMade a model choose from what a parser had already found instead of writing freely: invented answers 52% → 0%, 9.6× fewer tokens, and one step went from 22 min → 3 min.
Record the gap, don’t invent
If a fact isn’t in the source, the pipeline says so instead of writing a test for it.
MeasuredOn one open-source app, 36% of generated test cases checked for translation keys as if they were visible text. A lint now holds those back instead of shipping them.
Fix the general case
When a model gets something wrong, I fix what it misunderstood, not the one page it failed on. A patch for one app is a bug for the next.
MeasuredOne shared sign-in step instead of one per test: “missing prerequisite” failures 92–100% → 0%.
Measure on real runs
Benchmarks with known answers and replays of recorded sessions decide changes, not one good run. Every call’s tokens, latency and cost are tracked.
MeasuredOn a fixed benchmark of 58 scenarios, coverage went 7 → 38–41, with run-to-run noise measured at ±3 before trusting any gain.
Never overstate the result
A partial run says it’s partial. Counts show what was delivered, and a zero says whether anything was actually searched.
MeasuredFound runs reporting about a third of their real cost, because some loop steps and thinking tokens weren’t counted. Fixed, then checked against production: zero difference.
Plan for failure and load
Token and time budgets, bounded retries, partial results kept, a fallback when something new breaks, and no single request allowed to take a server down.
MeasuredAn endpoint that was running servers out of memory: 37 s → 1.6 s, and 150 MB → 81 KB per request.
Measured lines come from my own work in 2025–26: recorded runs, fixed benchmarks and production data. I’ve left the products and features unnamed.