Harness Engineering Across Real-World Contexts: One Pattern, Nine Domains
The same agent harness โ context, model, planning loop, tools, state, verification, approvals, action โ now runs code reviews, contact centres, sales pipelines, legal review, procurement, hospital operations, construction projects, factories and research teams. What changes from one domain to the next is not the loop but its parts: where context comes from, which tools the agent may touch, how its work is checked, and when a human must say yes. This visual guide walks the universal pattern, nine domain adaptations, real incidents that show what a missing layer costs, the regulation that now requires some layers, and a runnable model of how much autonomy each domain can afford.
01 The Universal Harness Pattern
Strip away the domain vocabulary and every production agent follows nine stages. A request arrives; the harness assembles context; the model reasons; a planning loop breaks the job into steps and picks tools; tools act on external systems; the harness observes results and handles errors; durable state records what happened; verification and approvals check the work; and only then does a final action or answer leave the system. Stages 4โ7 repeat until the plan is done. Press play to follow one task through โ then switch domain to see the same stages with different contents:
Two properties make this pattern reusable. First, the model is the only part that is general-purpose; everything around it โ the connectors, the tool permissions, the checks, the approval rules โ encodes domain knowledge. Second, the loop is closed by observation: an agent that cannot see the result of its own action (a failing test, a rejected API call, an out-of-range sensor reading) cannot correct itself, whatever the domain.
02 Core Building Blocks and the Harness "Equation"
The nine stages are built from eight reusable blocks. A popular way to summarise it is an equation: Model + Context + Tools + State + Governance + Verification = Domain Harness. The equation is a useful checklist but a misleading formula: the blocks don't add, they multiply. A harness with a superb model and no verification isn't 85% safe โ it's as weak as its missing layer. Switch blocks off to see which failures become possible:
| Block | What it provides | Typical implementation |
|---|---|---|
| Model intelligence | Language, reasoning, planning | Frontier or domain-tuned LLM; routing between cheap and strong models |
| Domain context / retrieval | The facts the model doesn't know | RAG over documents, database queries, code indexes, knowledge graphs |
| Tools / APIs | The ability to act | Function calling, MCP servers, scripted actions, RPA |
| Durable state & memory | Continuity across steps, sessions, crashes | Session stores, checkpoints, durable workflows, artifact storage |
| Policies, permissions & guardrails | What the agent may and may not do | Scoped credentials, allow-lists, input/output filters, rate and spend limits |
| Verification / evaluation | Evidence the work is right | Tests, citation checks, rule engines, simulations, LLM judges, evals |
| Human-in-the-loop | Accountability for consequential actions | Approval queues, escalation, take-over, sign-off |
| Observability / logging | The ability to audit and improve | Traces, metrics, audit logs, replay |
03 Nine Domains, One Loop
Each domain plugs its own sources, tools and checks into the same loop. Pick a domain to see its flow โ sources on the left, the agent's actions in the middle, the output and its gate on the right โ plus what the harness has to change and a real-world anchor:
Read across the nine and a pattern appears. Context sources go from text-heavy (code, tickets, contracts) to structured and physical (ERP ledgers, EHR records, BIM models, SCADA telemetry). Verification goes from mechanical and cheap (unit tests, schema checks) to expert and expensive (clinical review, engineering sign-off). And the final action goes from easily reversible (a pull request nobody merged) to irreversible (a payment sent, a medication scheduled, a valve opened). The further right a domain sits on those three axes, the more of the harness is about control rather than capability.
04 How the Harness Changes by Context
The same six dimensions, compared across six representative domains. Hover a cell for detail; the colour shows how demanding that dimension is:
One nuance the matrix hides: risk belongs to actions, not domains. A software agent that edits code in a branch is low-risk; the same agent running DROP TABLE against production is not (see the Replit incident below). A customer-service agent answering "where is my parcel?" is low-risk; the same agent promising a refund creates a binding commitment (see Air Canada). Good harnesses therefore tier approvals by action within a domain, not only by domain.
05 How Much Autonomy Can a Domain Afford?
Every harness picks a point between "the agent just acts" and "a human approves everything". The right point depends on four numbers: how often the agent is wrong, how many of those errors automated checks catch, what an error that escapes costs, and how long a human takes to review. Pick a preset or move the sliders; the chart shows expected cost per 1,000 tasks for four policies:
"""Same harness, different domains: which level of autonomy is cheapest?
For each domain we model 1,000 agent tasks and compare four harness policies:
auto - agent acts directly, no checks
verify - automated verification (tests, citation check, rules, simulation) catches a share of errors
human - automated verification, then a human approves every task
tiered - automated verification; a human approves only the riskiest 20% of tasks,
which (by assumption) hold 80% of the potential damage
Expected cost = errors that escape x cost per error + human review minutes x $2/min.
All numbers are illustrative assumptions, not measurements. Standard library only.
"""
N, HUMAN_CATCH, RATE, TIER_SHARE, TIER_RISK = 1000, 0.90, 2.0, 0.20, 0.80
# domain error auto-check $ per escaped review
# rate catches error minutes
DOMAINS = [("Software", 0.15, 0.70, 50, 8),
("Customer service", 0.05, 0.30, 30, 3),
("Sales / RevOps", 0.08, 0.20, 20, 2),
("Research", 0.12, 0.50, 200, 12),
("Finance", 0.04, 0.80, 2000, 5),
("AEC / construction",0.10, 0.40, 5000, 15),
("Legal", 0.10, 0.50, 20000, 25),
("Healthcare ops", 0.06, 0.40, 50000, 6),
("Industrial", 0.05, 0.60, 100000, 10)]
def costs(err, check, dollars, minutes):
after_check = err * (1 - check)
auto = N * err * dollars
verify = N * after_check * dollars
human = N * after_check * (1 - HUMAN_CATCH) * dollars + N * minutes * RATE
tiered = (N * after_check * (TIER_RISK * (1 - HUMAN_CATCH) + (1 - TIER_RISK)) * dollars
+ N * TIER_SHARE * minutes * RATE)
return {"auto": auto, "verify": verify, "human": human, "tiered": tiered}
print(f"Expected cost per {N:,} tasks (errors that escape + human time)\n")
print(f"{'domain':<20}{'auto':>12}{'verify':>12}{'human':>12}{'tiered':>12} best")
for name, *p in DOMAINS:
c = costs(*p)
best = min(c, key=c.get)
print(f"{name:<20}" + "".join(f"{'$' + format(round(v), ','):>12}" for v in c.values()) + f" {best}")
print("\nSame harness, same policies: cheap mistakes favour automated checks alone; mid-cost ones a risk-tiered\nhuman gate; expensive, hard-to-reverse ones a human on every action.")Output:
Expected cost per 1,000 tasks (errors that escape + human time) domain auto verify human tiered best Software $7,500 $2,250 $16,225 $3,830 verify Customer service $1,500 $1,050 $6,105 $1,494 verify Sales / RevOps $1,600 $1,280 $4,128 $1,158 tiered Research $24,000 $12,000 $25,200 $8,160 tiered Finance $80,000 $16,000 $11,600 $6,480 tiered AEC / construction $500,000 $300,000 $60,000 $90,000 human Legal $2,000,000 $1,000,000 $150,000 $290,000 human Healthcare ops $3,000,000 $1,800,000 $192,000 $506,400 human Industrial $5,000,000 $2,000,000 $220,000 $564,000 human Same harness, same policies: cheap mistakes favour automated checks alone; mid-cost ones a risk-tiered human gate; expensive, hard-to-reverse ones a human on every action.
Three lessons fall out of the numbers. Automated verification is almost always worth it: it beats "auto" in every row because it costs no human time. A human on every action only pays when errors are expensive โ in software and customer service it multiplies cost several-fold. And risk tiering is the middle ground: sending only the riskiest fifth of tasks to a human wins in sales, research and finance. The crossover moves with the cost per error, which is why the same harness ships with different approval rules per domain. (The model ignores reputational and legal costs that don't scale linearly โ the reason regulated domains keep humans in the loop even when the arithmetic is close.)
06 Real Incidents: What the Missing Layer Was
Public incidents are the clearest evidence of which layers matter. Each of these four maps to a building block that was missing or weak. Select one:
07 Where Regulation Requires Layers
In several domains the human-in-the-loop, logging and verification blocks are no longer optional design choices:
| Rule | Scope | Harness layers it requires |
|---|---|---|
| EU AI Act, Article 14 (human oversight) | High-risk AI systems (e.g. employment, credit, essential services, critical infrastructure) | Interfaces that let people monitor, interpret, override and stop the system; trained overseers. Stand-alone high-risk obligations apply from 2 Dec 2027 and product-embedded ones from 2 Aug 2028, after the Digital Omnibus (Regulation (EU) 2026/1744) deferred the original 2 Aug 2026 date. |
| EU AI Act, Article 12 (record-keeping) | High-risk AI systems | Automatic event logs over the system's lifetime โ the observability block. |
| HIPAA "minimum necessary" standard | US protected health information | Scoped retrieval and permissions: the agent should see only the PHI a task needs. |
| Court and bar rules on AI-drafted filings | Legal practice (many courts, after Mata v. Avianca) | Citation verification and a lawyer's sign-off on every filing. |
| Consumer-protection liability | Customer-facing statements (Moffatt v. Air Canada) | Policy-grounded answers and approval for commitments: the company is bound by what its bot says. |
08 Adoption Sweet Spots
Domains adopt in waves, ordered by how cheap mistakes are and how easy the work is to sandbox. Drag the slider along the risk axis to see which wave you are in and what the harness must add to move right:
09 Design Principles Checklist
Twelve principles that carry across every domain. Tick the ones your harness already follows to get a readiness score:
Next: Recursive Harness Self-Improvement: How Agents Are Starting to Improve the Systems That Run Them โ