Three Harness Design Patterns
Workflow automation / file-system persistent memory / sub-Agents and background tasks — three pillars of Agent runtime
THE QUESTION THIS PAGE ANSWERS
ANSWER FIRSTWhat is the key idea behind “Three Harness Design Patterns”?
Workflow automation / file-system persistent memory / sub-Agents and background tasks — three pillars of Agent runtime
Make the claim earn its place. Use this page as a decision aid, not a definition to memorize. Connect the idea to one real task, one observable result, and one failure that would change your mind.
Write one question you could answer with evidence after trying this idea.
A conclusion that sounds complete but leaves the key assumption untested.
- Plan → Execute → Observe/Test → Improve → Execute again: Every generation round is the starting point for the next optimization round.
- Analyze its own trajectory: A high-quality Agent looks back at what it did in previous rounds, where it failed, and why — then adjusts its strategy to avoid repeating the same Prompt.
- Emphasis on runtime iteration: Improvement happens during Agent execution, not by relying on static templates written by humans in advance. The Agent learns, adapts, and optimizes within each run.
- Failure is a signal, not a termination: Test failures, command errors, and unexpected outputs are all triggers for the Agent to self-correct.
- Diverse artifact types: Experiment logs, code diffs, paper summaries, error trace records, and full past execution trajectories — all valuable state that cannot fit in context.
- The right Harness approach: Store persistent state in the file system and teach the Agent to read and write on demand. Never try to cram the entire work history into the Prompt.
- File I/O is a core LLM skill: Reading and writing the file system requires no complex external toolchain — it benefits from improvements in the core model. Smarter models manage files more efficiently.
- Structured storage: A well-designed Agent maintains its own scratchpad, todo lists, and experiment records — managing its workspace like a human programmer.
In the file system: Historical experiment results, accumulated error logs, summaries of completed subtasks, and long-term strategies and rules — information that needs persistent storage but doesn't need to be in view at all times.
Key principle: Context is working memory; the file system is long-term memory. A good Harness, like the human brain, intelligently moves information between the two.
- Parent Agent as process manager: Launch subtasks, check logs and progress, cancel failed branches, merge successful results. This is an OS-level mental model.
- Parallelism must be explicit and inspectable: No "fire and forget." The parent Agent must be able to check the status, output, and errors of each sub-agent.
- Persist sub-agent outputs: Each sub-agent's result is stored as a file, log, or status record (not just returned into the parent's context), so execution can be resumed even after interruption.
- Fault tolerance and recovery: Background tasks may time out, crash, or produce low-quality results. The Harness needs retry strategies and graceful degradation mechanisms.
| Tool Group | Core Capability | Typical Tools |
|---|---|---|
| File System | Read, write, search, and edit files; manage workspace state | Read, Write, Edit, Glob, Grep, StrReplace |
| Shell Execution | Run terminal commands, execute tests, install dependencies | Shell, BashExec, RunCommand |
| I/O | Interact with the user, confirm actions, display results | Ask, UserConfirm, ShowResult |
| External Context | Fetch external information, documents, and API responses | WebFetch, ReadURL, DocSearch |
| Web Search | Search the internet for up-to-date information | WebSearch, BingSearch |
| Artifacts | Generate, manage, and version artifacts | CreateFile, SaveArtifact, VersionControl |
| Backend Processes | Run long-running tasks in background, monitor process status | BackgroundShell, AwaitProcess, Monitor |
| Agent Delegation | Spawn sub-agents, assign parallel tasks, merge results | Task, Subagent, Fork, ParallelRun |
File system memory provides the hard drive for the loop: results of each iteration are never lost, even if context is flushed.
Sub-agent parallelism provides multi-core for the loop: when tasks are decomposable, parallel acceleration replaces serial waiting.
Combined, an Agent gains the capability of iterative optimization × long-term memory × parallel scaling. This is precisely the common architecture of today's most capable coding Agents.
Why “From loops to memory, from monolith to multi-agent: Three foundational infrastructure patterns of Harness” depends on the operation
“Workflow automation / file-system persistent memory / sub-Agents and background tasks — three pillars of Agent runtime” makes the structure concrete. The useful comparison is not which name sounds more advanced, but how the data is arranged and how far the most common operation has to travel.
Read a structure through access and change
“Workflow automation / file-system persistent memory / sub-Agents and background tasks — three pillars of Agent runtime” exposes a trade-off that is easy to miss: reading by position, looking up by key, adding at either end, inserting in the middle, and traversing relationships do not favor the same organization. A structure that is fast for one operation is not automatically fast for all of them.
- Plan → Execute → Observe/Test → Improve → Execute again : Every generation round is the starting point for the next optimization round
- Analyze its own trajectory : A high-quality Agent looks back at what it did in previous rounds, where it failed, and why — then adjusts its strategy to avoid repeating the same Pro…
- Emphasis on runtime iteration : Improvement happens during Agent execution, not by relying on static templates written by humans in advance. The Agent learns, adapts, and optimizes…
Count scale and update frequency together
Use “Workflow automation / file-system persistent memory / sub-Agents and background tasks — three pillars of Agent runtime” as a boundary check. Write down the data size, the dominant operation, and the latency you can accept before deciding whether an AI-generated structure actually fits.
From “From loops to memory, from monolith to multi-agent: Three foundational infrastructure patterns of Harness” to “Pattern 1”
“From loops to memory, from monolith to multi-agent: Three foundational infrastructure patterns of Harness” grounds the problem in “In "Harness Engineering for Self-Improvement" (Lilian Weng, 2026.07), three design patterns that appear repeatedly in successful Agent systems are identified: workflow automation, file system as persistent memo…”. “Pattern 1” then moves it toward “1 Workflow Automation Workflow Automation Core idea: An Agent is a goal-directed loop — it should never be treated as a one-shot script. Plan → Execute → Observe/Test → Improve → Execute again : Every generatio…”. Together, they show that the lesson is not just a conclusion to remember, but a claim with conditions.
Carry the judgment into the next situation
When you meet a new data structure, do not begin by memorizing its definition. Write down the most frequent operation, estimate scale and update behavior, and check whether the structure satisfies all three conditions.
- “From loops to memory, from monolith to multi-agent: Three foundational infrastructure patterns of Harness”: In "Harness Engineering for Self-Improvement" (Lilian Weng, 2026.07), three design patterns that appear repeatedly in successful Agent systems are identified: workflow automation, file system as persistent memo…
- “Pattern 1”: 1 Workflow Automation Workflow Automation Core idea: An Agent is a goal-directed loop — it should never be treated as a one-shot script. Plan → Execute → Observe/Test → Improve → Execute again : Every generatio…
- “The closing point”: Diverse artifact types : Experiment logs, code diffs, paper summaries, error trace records, and full past execution trajectories — all valuable state that cannot fit in context
The final “The closing point” brings the discussion to “Diverse artifact types : Experiment logs, code diffs, paper summaries, error trace records, and full past execution trajectories — all valuable state that cannot fit in context”. The useful thing to carry forward is knowing which judgments must be revisited when input, scale, or risk changes.
I turned one judgment from this article into a small experiment I could run today. Knowing what to observe next is more useful than simply remembering the conclusion.
After reading this, I first looked for the conditions behind the idea instead of copying the method into a project. That order made the later trade-offs much clearer.
When this judgment reaches real work, which constraint should be added first? I am curious which step matters most between reading and the first practical attempt.
No discussion on this article yet.