Concept · Agent harness

    What is an agent harness?

    An agent harness is the software wrapped around an AI agent that decides what the agent may do, how long and how expensively it may run, how its work is checked, and what gets recorded. The model does the reasoning; the harness makes the run bounded, verifiable and repeatable.

    MartinLoop is an open-source harness for coding agents: the agent writes the code, MartinLoop decides whether the run is allowed to be called done.

    What does an agent harness actually do?

    • Bounds the job — one task, a known working directory, a clear definition of success.
    • Enforces limits during the run — a spend ceiling and an iteration cap that end the run without you.
    • Verifies externally — your tests, build or lint run after the agent stops and decide the outcome.
    • Classifies failure — a failed run gets one of 13 named failure classes instead of a vague “it broke”.
    • Records everything — task, spend, stop reason and files touched, in an inspectable JSONL run record.

    Why do coding agents need a harness?

    A coding agent judges its own work with the same reasoning that produced it, so “done” is a claim, not evidence. Without a harness, people compensate by watching every step. We built MartinLoop after one unattended overnight run spent $65 before anyone checked — nothing was there to stop it.

    Agent loops vs agent graphs: does the harness change?

    Loop engineering repeats one plan-act-check cycle until a stop rule fires. Graph engineering connects several steps or agents with explicit branches. The harness requirements are the same in both: a limit on every step, a rule that ends stalled work, a check the agent cannot fake, and a record of every transition. MartinLoop applies those controls to coding-agent runs today; see how agent loops work and running several coding agents at once.

    Which agents does MartinLoop work with?

    Native coding-agent CLIs — Claude Code, Codex and Gemini CLI — and IDEs such as Cursor through MCP. Raw model endpoints do not get the same end-to-end guarantees yet.

    What a harness does not prove

    VERIFIED means the checks you configured passed for that run. It is not a warranty that the software is bug-free, secure, compliant or safe to merge.

    FAQ

    Keep reading: how to stop babysitting coding agents · guardrails against scope creep and runaway loops · the 13 ways agent runs fail · coding agents for non-engineers