u/BlunderGOAT

You know the pattern. The agent rewrites a function that already exists six lines from where the new one landed. It deletes a migration it was supposed to leave alone. It reports the task complete while the build is quietly broken.

After enough of these, I stopped blaming the model.

The model isn't dumb. It's contextless. It opens fresh every session, can't see the decision you made in Slack last week, doesn't know which file you told it never to touch. It'll confidently rebuild a function that already exists six lines away because it can't see those six lines.

You can write the perfect prompt and it'll still happen next session. It's a harness problem.

A harness is the system around the model. Files it can read. Commands it can run. Rules it must obey. Memory it keeps between sessions.

The pattern's been named by people who'd know. Mitchell Hashimoto wrote it as Agent = Model + Harness. Claude Code is built around it (skills, hooks, AGENTS.md). And the data backs it up. LangChain's deepagents-cli jumped from Top 30 to Top 5 on Terminal Bench 2.0 (52.8 to 66.5) without touching the model, just the harness. Vercel rebuilt their text-to-SQL agent with 2 tools instead of 18 and it got better.

Five things any working harness needs:

  1. Context: a map, not a 1,000-page manual
  2. Constraints: deterministic rules that fire before the agent thinks
  3. Verification: force it to prove its work (tests, re-read files)
  4. Recovery: survive context resets and crashes
  5. Feedback loop: persist mistakes so next session doesn't repeat them

Skip any one and the harness fails the moment the project gets complicated.

I got tired of rebuilding this for every project so I open-sourced what I had: goat-flow.com. Works with Claude Code, Codex, Gemini CLI, Copilot CLI. But honestly, whether you use that or roll your own, the five concerns are the spec.

What have you all built (or skipped) to keep your agents from going off the rails?

u/BlunderGOAT — 17 days ago