Slides · Harness engineering
Orchestration, subagents and people in the loop
1 / 26
Orchestration, subagents and people in the loop
Once a task is split, the harness decides how work is handed over, who checks it, where each agent works and where a person stands.
By the end you can explain what a subagent buys and costs, write a delegation contract, split building from checking, isolate parallel agents, and place people on an autonomy ladder.
Concept
Start with the simplest design
- Anthropic’s December 2024 guide recommends the simplest solution that works, adding complexity only when needed.
- For many applications, the same guide says, one LLM call with retrieval and in-context examples is usually enough.
- It also notes that agentic systems often trade latency and cost for task performance.
- Each step up the ladder costs more: single call, fixed workflow, one agent, several agents.
- Splitting a task is a decision you have to justify with a measured gain, not a default.
Concept
Why a split can make things worse
- Anthropic reports that vague task descriptions led subagents to overlap with each other, leave parts of the task untouched, or lack information they needed.
- Cognition argues that parallel agents without shared context make conflicting implicit decisions, and calls multi-agent collaboration fragile as of 2025.
- Handoffs lose detail, one agent’s mistake becomes another’s input, and five traces are harder to read than one.
- These are harness problems: the fixes below are contracts, isolation and a review point.
Sources[2] How we built our multi-agent research system[3] Don't Build Multi-Agents
Concept
Mental model: the supervisor and the ticket queue
- Checking every action makes work crawl; checking only the end sees too little, too late.
- The better move is to change the jobs, not the supervisor’s position.
- Give each agent its own slice of the queue, so two cannot pick up the same ticket.
- Hand each a brief that says what the job is and what to return.
- The supervisor reads only what comes back.
That is three ideas: a contract, an isolation boundary and a review point.
Diagram
A subagent isolates context
Worked example
Worked example: isolation has a fixed overhead
Illustrative numbers. The parent starts at 15,000 tokens. Each subagent costs the parent a 600-token brief it writes and a returned summary. Compare a small read with a large one.
| Aspect | Small: one 3,000-token file | Large: eight 25,000-token log files |
|---|---|---|
| Parent context, parent reads | 15,000+3,000=18,000 | 15,000+8×25,000=215,000 |
| Parent context, delegated | 15,000+600+1,000=16,600 | 15,000+8×(600+1,000)=27,800 |
| Total work, parent reads | 3,000 | 200,000 |
| Total work, delegated | 3,000+600+1,000=4,600 | 200,000+8×1,600=212,800 |
| Extra total work | 1,600, about 53% more | 12,800, about 6.4% more |
The overhead per subagent is roughly fixed (a brief plus a summary), so it is large against a small read and small against a big one. That is why subagents suit broad, heavy exploration and not quick lookups. This count ignores that a big parent window is re-read on later turns, and real systems cost more (next slide).
Compare
What multi-agent really costs, and when it pays
Anthropic (13 June 2025) measured its own research system: agents used about 4 times the tokens of chat, and multi-agent systems about 15 times. Token use alone explained 80 percent of the variance on one benchmark (BrowseComp).
| Aspect | Likely worth it | Likely not worth it |
|---|---|---|
| Task shape | Broad search, many independent reads | Small task, quick answer |
| Context | Information exceeds one window | All agents need the same context |
| Parallelism | Heavy parallel parts | Few parallel parts (the post says most coding tasks have fewer than research) |
| Value | High value per task | Low value, cost-sensitive |
The post’s own fit list also includes tasks with many complex tools. Pay for isolation and parallelism only when the task is on the left.
Concept
The delegation contract
Anthropic’s write-up lists four things to hand every subagent: a goal, the shape of the result, which tools and sources to use, and the limits of its task. A usable brief states:
- Objective and what a good result looks like.
- Constraints: scope, what is out of bounds, a budget.
- Allowed tools, and which of them can change anything.
- Output format: a structure the parent can read without redoing the work, with file pointers for detail.
- Stop condition, and where to write artefacts.
Missing fields show up as duplicated work, runaway reading or a reply too long to use.
Diagram
Brief out, structured result back
Code
Contract as code: check the brief and the result
Python
import posixpath
REQUIRED_BRIEF = {"objective", "constraints", "allowed_tools", "output_schema", "stop_condition", "artifact_dir"}
MAX_SUMMARY_CHARS = 2000 # roughly 500 tokens; tune per system
STATUSES = ("done", "blocked", "budget_exhausted")
def _empty(value):
return value is None or (isinstance(value, str) and not value.strip())
def check_brief(brief: dict) -> list[str]:
"""Return the missing or empty contract fields. An explicit empty allowed_tools list means 'no tools'."""
return sorted(f for f in REQUIRED_BRIEF
if f not in brief or _empty(brief[f])
or (f != "allowed_tools" and not brief[f]))
def check_result(result: dict, artifact_dir: str) -> list[str]:
"""Reject a subagent result the parent should not trust or cannot afford to read. POSIX paths only."""
if not isinstance(result, dict):
return ["result must be a dict"]
problems = []
status = result.get("status")
if not isinstance(status, str) or status not in STATUSES:
problems.append("status must be done, blocked or budget_exhausted")
summary = result.get("summary", "")
if not isinstance(summary, str) or not summary:
problems.append("summary missing")
elif len(summary) > MAX_SUMMARY_CHARS:
problems.append("summary too long: write detail to a file and point to it")
files = result.get("files", [])
base = posixpath.normpath(artifact_dir) # "./out/sub-a/" becomes "out/sub-a"
inside = lambda p: "\\" not in str(p) and posixpath.normpath(str(p)).startswith(base + "/")
if not isinstance(files, list) or not all(inside(p) for p in files):
problems.append("files outside the artifact directory")
return problemsI ran these checks with a test script (15 cases, all passed):
| Case | Outcome |
|---|---|
Complete brief; empty allowed_tools list (means no tools) | accepted |
| Empty or whitespace-only stop condition | flagged |
| Good result | accepted |
| 5,000-character summary | rejected |
File in a sibling directory, a name-prefix sibling (out/sub-aa), a .. escape, or a backslash path | rejected |
Artifact directory written as ./out/sub-a/ | normalised, good file accepted |
Artifact directory . | rejects everything (fails safe) |
| Unknown or unhashable status, or a result that is not a dict | rejected without a crash |
Limits: POSIX paths only, the result must be a dict, symlinks are not resolved, and 2,000 characters is an arbitrary cap to tune.
Process
Hand over artefacts, not transcripts
- Write the task, plan and status to files with a job identifier.
- Give every inter-agent message a schema, and validate it on receipt.
- Have the subagent write detail to its own artefact directory and return pointers.
- Add a status field so a handoff can resume after a failure.
- Name one owner for each artefact, so two agents never edit the same thing.
Check yourself
Check: three agents, one bug
A lead agent asks three subagents to “look into why checkout is slow”. Two come back with the same finding about the database, and nobody looked at the front end. Which parts of the contract would you add to prevent both problems?
Answer
Give each subagent a distinct objective and boundary (for example database, API layer, front end) so the work does not overlap and nothing is left out. Add an output format with file pointers so the parent can merge findings without rereading. This is the failure Anthropic describes: vague task descriptions led to duplicated work and gaps. Splitting by area also gives each artefact one owner.
Diagram
Building and checking are different jobs
Concept
Rules for the checker, and the cost
- An agent that writes work and also approves it is grading itself.
- Prefer a deterministic test; use a second agent for what tests cannot see.
- Define done before the work starts, so the checker does not move the goalposts.
- Anthropic (9 January 2026) advises, as a general lean, grading the result the agent produced rather than the route it took, and reading transcripts to see whether a grader rejects valid work.
- The cost is a second pass over each unit of work. Pay it where a defect is expensive.
Compare
Route models by step type
| Aspect | Stronger model | Smaller, faster model |
|---|---|---|
| Step type | Planning, ambiguous decisions | Extraction, formatting, classification, routine checks |
| Risk | High | Low |
| Context size | Large, tangled | Small, well-defined |
| Fallback | Final authority | Escalate to the stronger model when confidence is low |
- Decide by step type, risk and context size, and re-evaluate when a new model appears.
- Route at boundaries of work. This is course reasoning, not a sourced rule: a mid-conversation switch may lose any cached prompt prefix, so test the cost on your provider before routing inside a conversation.
Check yourself
Check: where is a checker worth paying for?
A team runs two agent jobs: fixing typos in an internal wiki, and migrating payment records. They can afford a separate checker for only one. Which, and why?
Answer
The payment migration. A checker adds a second pass over every unit of work, so it pays where a defect is expensive and hard to undo. Typos are cheap to spot and to revert. Where possible make the payment checker deterministic (row counts, totals, schema checks) rather than another agent, and agree what done means before the migration starts.
Process
Parallel agents on one codebase
Several agents in one repository bring merge conflicts, duplicated work, inconsistent assumptions and fights over ports and databases. The measures, in order:
- A separate working copy or container per task.
- Ownership by directory or module: one owner per artefact.
- A queue with locks for shared resources such as a test database.
- Small changes, so conflicts stay small.
- An integration step (an agent or CI) that decides what merges.
This course’s judgment, not a measured result: coordination overhead tends to grow faster than throughput, so measure before adding agents.
Worked example
Worked example: five agents, one monorepo
Illustrative layout for five tasks.
| Agent | Working copy | Owns | Shared resource |
|---|---|---|---|
| A | wt-auth | services/auth/ | none |
| B | wt-billing | services/billing/ | test database (lock) |
| C | wt-search | services/search/ | none |
| D | wt-docs | docs/ | none |
| E | wt-shared | libs/common/ (everyone else may only request changes) | none |
- B and any other agent that needs the test database queue for the lock, so tests do not clobber each other.
- A change to
libs/common/is a request to E, so the module five services depend on has one owner. - The integration step merges in dependency order, runs the full tests, and rejects a branch that touches paths it does not own.
Concept
A practice is right under its conditions
- A team that merges with minimal blocking review reflects its throughput, cheap corrections and test coverage.
- In a low-volume or high-risk setting the same practice is a poor choice.
- Before copying a practice, write down the conditions it depends on and check whether you share them.
- In an interview, state the conditions first, then the practice.
Concept
Where people stand
Böckeler describes the human role as improving the harness over time: when an issue recurs, strengthen the controls so it becomes less likely. A good harness directs human attention to where it matters most; it need not remove it entirely. Put people at:
- Intent and acceptance, before work starts.
- Irreversible or high-impact actions, as approval gates.
- Escalations, when the agent needs a judgment.
- The steering loop: reading traces and turning recurring failures into guides, sensors and hooks.
Experienced developers also bring an implicit harness of conventions, accountability and organisational context that agents lack.
Diagram
The autonomy ladder
Worked example
Worked example: a docs-maintenance agent
Illustrative judgment for an agent that maintains a documentation site.
| Action | Reversible? | Starting rung | Evidence to move up |
|---|---|---|---|
| Read pages, search | n/a | Act alone | none needed |
| Fix typos in a draft branch | yes | Act and notify | Reviewers accept nearly all after a trial period |
| Open a pull request with a rewrite | yes, before merge | Act with approval | Low rejection rate over many changes |
| Publish to the live site | partly | Act with approval | Checks pass on staging, rollback proven |
| Delete a page, email authors | no | Suggest only | Rarely moves up |
The agent is not on one rung. Each kind of action sits where its reversibility and verification justify.
Check yourself
Check: pick a rung for each action
A travel-booking agent can search flights, hold a seat (free to cancel for 24 hours), buy a non-refundable ticket and email the passenger a confirmation. Assign each action a starting rung and say what evidence would move one up.
Answer
One reasonable assignment (a judgment, not a rule): searching is read-only, so act alone. Holding a seat is reversible within 24 hours, so act and notify. Buying a non-refundable ticket cannot be undone, so act with approval. Emailing the passenger cannot be recalled and speaks for the company, so also act with approval at first. What would justify more autonomy is specific to each action: for example, many confirmation emails approved without edits could eventually justify sending them with a notification, while the ticket purchase stays gated until refunds and errors prove rare. Each action is judged on its own record.
Summary
Recap
- Start with the simplest design; add agents only for measured gains.
- Subagents isolate context and return short results; you pay in total tokens (about 4 times for agents and 15 times for multi-agent systems in Anthropic’s system).
- Delegate with a contract: objective, constraints, tools, output format, stop condition. Pass artefacts, not transcripts.
- Separate builder from checker, define done first, and route models by step.
- Parallel work needs a working copy per task, ownership, a queue and an integration step.
- Put people at intent, irreversible actions, escalations and the steering loop, and raise autonomy per action.
References
References & Sources (1 of 2)
Building effective agents (opens in a new tab)
Erik S., Barry Zhang2024Article
https://www.anthropic.com/engineering/building-effective-agents
Used for Recommends the simplest solution that works and notes that agentic systems often trade latency and cost for performance (19 December 2024).
How we built our multi-agent research system (opens in a new tab)
Jeremy Hadfield, Barry Zhang, Kenneth Lien, Florian Scholz, et al.2025Article
https://www.anthropic.com/engineering/multi-agent-research-system
Used for Token multipliers (about 4x for agents, 15x for multi-agent), the 80 percent variance finding on BrowseComp, the delegation fields and the duplicated-work failure, and when multi-agent fits (13 June 2025).
Don't Build Multi-Agents (opens in a new tab)
Walden Yan2025Article
https://cognition.com/blog/dont-build-multi-agents
Used for The argument that parallel agents lacking shared context make conflicting implicit decisions.
Effective context engineering for AI agents (opens in a new tab)
Prithvi Rajasekaran, Ethan Dixon, Carly Ryan, Jeremy Hadfield2025Article
https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
Used for Subagents work with clean context windows and return condensed summaries, often 1,000 to 2,000 tokens (29 September 2025).
Demystifying evals for AI agents (opens in a new tab)
Mikaela Grace, Jeremy Hadfield, Rodrigo Olivares, Jiri De Jonghe2026Article
https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents
Used for Grade what the agent produced rather than the path, and read transcripts to check graders (9 January 2026).
References
References & Sources (2 of 2)
Harness engineering for coding agent users (opens in a new tab)
Birgitta Böckeler2026Article
https://martinfowler.com/articles/harness-engineering.html
Used for The human steers by iterating on the harness, and a good harness directs human attention instead of removing it (2 April 2026).
Keys: ← → move, Home End first and last, F full screen.