Agent harnesses look like magic until you see the four lines at the centre of one. This walks you through the five layers of a real harness — the loop, what it can read, what it can change, how it remembers, and what stops it — explaining each capability as you switch it on. At the end you get a staged build brief to paste into Claude Code or Codex, written so the agent stops and teaches you at every stage instead of dumping a finished repo on you.
Under the hood
01
Messages in, tool call out, run it, append the result, repeat until the model stops asking. That is the whole engine, and it fits on one screen. Everything people call "agent framework" is a tool you hand that loop or a rule about when it may fire.
02
Editing files without reading them first is how agents overwrite work. Opening PRs without approval gates is how they embarrass you. The generator enforces these chains, so you see which foundations a capability actually rests on before you add it.
03
Approval gates, a sandbox, run traces and an eval suite are the layer everyone skips and the one that decides whether you can leave the thing running. The difference between a demo and a tool you trust is almost entirely here.
Layer 00
A harness is not one thing — the right set of capabilities depends entirely on the job. Say what yours is for and the generated brief will aim at that rather than at a generic agent.
Be specific. “A coding agent” produces a generic brief; one concrete job produces a harness that does it.