D6 · Long-running harness
Family: Context and memory
One agent sets up the environment, then another moves forward one feature at a time across several sessions.
Principle
An initializer agent sets up the environment: startup script, feature list, progress file, first commit. A coding agent then moves forward feature by feature, session after session, leaving structured traces for the next one. A variant splits planner, generator and evaluator.
The problem it solves
A task of several hours exceeds one context window, and the agent tends to do too much at once and leave work unfinished.
When to use it
- The work lasts several hours and spans several sessions: application development, work on a large codebase.
- An automatic oracle, such as tests, says whether each feature is done: long autonomy mostly works in that case.
When to avoid it
- The task fits in one session: a plain agent loop (C1) is enough.
- The harness was built for a weaker model: each component encodes an assumption about what the model cannot do alone, to be challenged with every new model.
Common pitfalls
The anti-patterns that misuse this pattern, best established first. Each sheet describes the symptoms, the public incidents and the remedies.
Framing and choice of level
- AP08 · Demo-driven autonomy — One successful demo is enough to put the agent into autonomous execution, with no intermediate stage.
Context and memory
- AP25 · Unmanaged context growth — Everything piles up in the window, and the agent makes less and less use of what is right in front of it.
- AP30 · Cache-busting prefix — A timestamp or a reordered JSON at the top of the prompt, and every call pays full price for the whole context again.
Loop, stopping and orchestration
- AP36 · Premature completion — The agent says “done”, and nobody checks the actual state before believing it.
- AP43 · No durable execution or idempotence — A failure halfway through, and the agent starts over, sending again the email it had already sent.
- AP44 · Big-bang agent deploy — A new version replaces the old one in one go, right in the middle of the agent sessions that relied on it.
Verification and evaluation
- AP50 · Agent-writable oracle — The agent can see or rewrite what grades it, and ends up optimising the grade rather than the task.
Security and permissions
- AP63 · Security policy left to the prompt — The “don’t touch production” rule only lives in the prompt; nothing enforces it when a tool is called.
- AP64 · Unseparated environments — The development agent can reach production, and the backups share its blast radius.
- AP65 · Agent that rewrites its own configuration — The agent can write to the files that set its permissions: an injection no longer bypasses approval, it switches it off.
- AP66 · Confirmations disabled outside a sandbox — The agent runs with no confirmations at all on a machine that holds secrets and keeps open network access.
- AP68 · Secrets within the agent’s reach — Credentials are readable by the agent, in its context or its files, instead of being injected outside the model.
Oversight, operations and governance
- AP75 · Flying blind — In production with no step-level traces: no way to replay a session or tell where it failed.
- AP76 · Agent narrative as audit trail — You know what the agent says it did, not what it did: no independent log to investigate from.
- AP83 · Stale scaffolding — A breakdown, a tool or an instruction made up for an older model; it still costs and no longer adds anything.
- AP84 · One-way harness — Rules that are never checked, or alerts that never change the rules: the harness does not learn.
Synonyms by vendor
- Harnais pour agents de longue durée (initialisateur + agent de codage) (Anthropic (nov. 2025))
- Planificateur, générateur, évaluateur (Anthropic (mars 2026))
Neighbouring patterns
Sources
- Harness design for long-running application development — Anthropic (P. Rajasekaran), 2026-03-24
- Effective harnesses for long-running agents — Anthropic (J. Young), 2025-11-26
- Time Horizon 1.1 — METR, 2026-01-29
- Rakuten et Claude Code — Anthropic (étude client)
Content reviewed on 2026-10-02