FIELD MANUAL FM-01  //  AI AGENT SYSTEMS  //  WHAT · HOW · WHEN · WHY

The Harness

The model is the engine. The harness is the rest of the car — the loop that drives it, the tools it can reach, the context plumbing, the brakes, the instruments. Same engine, wildly different vehicle.

This manual covers the whole machine: what each subsystem does, how to build it, when to add it, and why the same model behaves so differently inside different harnesses. Below is a harness, running. Everything in this document is color-coded to these five subsystems.

Context Model Gates Tools Verification
Stage 1 Context
Assemble what the model sees: instructions, history, tool results.
Stage 2 Model
One inference. Decides: call a tool, or answer.
Stage 3 Gate
Is this action allowed? Auto, ask a human, or block.
Stage 4 Tool
Execute in the real world. Capture the result — or the error.
◀ RESULT APPENDS TO CONTEXT · LOOP REPEATSEXIT WHEN VERIFIED OR BUDGET STOPS
IDLE — pick a scenario
TURN 0 CONTEXT 0 tok TOOL CALLS 0 STATE idle
— trace console · every line here is something your harness code does, not the model —
Module 00 // The claim

Why harnesses exist

A language model is a text predictor with no hands, no memory of your systems, and no way to check its own work. A harness is the software wrapped around it that supplies all three — and it turns out that software determines most of what the agent can actually do.

Strip the vocabulary away and a harness is four things: a loop that calls the model repeatedly instead of once; tools that let its output cause real effects; plumbing that decides what the model sees each turn; and controls that decide what it's allowed to do and when it's done. Chat interfaces are minimal harnesses (one turn, no tools). Coding agents are heavy harnesses (hundreds of turns, dozens of tools, compaction, sandboxes, test loops).

The reason "harness" became the word of the moment: teams kept discovering that swapping the harness moved results as much as swapping the model. The same frontier model that meanders in a bare chat window ships working code inside a well-built coding harness — because the harness feeds it test output, lets it retry, keeps its context clean, and stops it when it's done. Capability lives in the pair, not the model.

INSTRUMENT · SAME TASK, DIFFERENT PAIRINGS
Mid-tier model · bare loop, no verification
Frontier model · same bare loop
Same mid-tier model · full harness (verify · compact · gates)
Numbers are illustrative, not a benchmark citation — but the shape matches what agentic leaderboards keep showing: scaffold changes rival model changes. Every published agent score is a model + harness score.
The line to teachBenchmarks measure pairs. When someone says "model X scores 60% on SWE-bench," the honest sentence is "model X, inside harness Y, scores 60%." Change the harness and the number moves — sometimes by more than a model generation.

How we got here

OCT 2022
ReAct formalizes the pattern: interleave reasoning with actions and feed observations back. The agent loop gets its paper.
JUN 2023
Native function calling lands in mainstream APIs. Tool use stops being regex-parsing hacks and becomes a first-class, structured contract.
OCT 2023
SWE-bench ships: real GitHub issues as an agent benchmark. The raw scores start low — but a shared yardstick for agents now exists, and scaffold builders start competing on it.
2024
Within months, SWE-bench leaderboards make harness quality separately visible: the same model posts wildly different scores under different scaffolds. Meanwhile computer use (models driving screens) and MCP (an open protocol for wiring tools to models, Nov 2024) arrive — tools become an ecosystem instead of bespoke glue code.
2025
The agentic coding boom. Claude Code, Codex-style CLIs, and IDE agents make harnesses a mass-market product. MCP is adopted across vendors. Long-horizon work — hours of autonomous operation — becomes normal, and it's harness engineering that makes it survivable.
2026
Harness-first thinking. The discourse flips from "which model?" to "which pairing?" Teams version, test, and eval their harnesses like any other production system. That's the skill this manual teaches.
Module 01 // The core mechanism

The agent loop

Every harness — from a 50-line script to Claude Code — is one while-loop wearing different amounts of armor. Learn the loop cold and every framework becomes readable, because they're all decorating this.

# the whole field, in one loop — colors match the manual's legend
history = [system_prompt, tool_definitions, user_task]

while True:
    reply = model(history)                     # ① one inference

    if reply.tool_calls:
        for call in reply.tool_calls:
            if not gate.allows(call):           # ② permission check
                result = ask_human(call)         #    or block outright
            else:
                result = execute(call)            # ③ real side effects
            history += [call, result]            # ④ feed result back

    else:                                    # model thinks it's done
        if verified(reply): return reply       # ⑤ check, don't trust
        history += [critique(reply)]           #    send it back to work

    history = compact(history)               # ⑥ manage the window
    if budget.exceeded(): return escalate()  # ⑦ stop conditions

Seven numbered lines, seven design decisions — and the rest of this manual is those lines expanded. Notice what the loop implies:

  • The model never acts. It emits a request to act. Your code executes. Everything you control about safety and reliability lives in that gap.
  • Results are just more context. The model "perceives" the world only through what you append to history. Garbage tool output in, garbage decisions out.
  • Stop conditions are yours to write. Turn caps, token budgets, wall-clock limits, cost ceilings, "no progress in N turns." A loop without them is an outage generator.
INSTRUMENT · STEP THROUGH A REAL TASK: "FIX THE FAILING TEST"
— press STEP to watch one loop iteration at a time —
PHASE: IDLE
TURN0 / 12 cap
TOOL CALLS0
CONTEXT USED0%
VERIFICATIONnot yet run
STOP CONDITIONnone hit
Watch the state panel, not just the log: context only grows, tool errors become input rather than crashes, and the run ends on a verified exit — not on the model's self-report.
When / whyWhen do you need a loop at all? One-shot generation (summarize, draft, classify) doesn't. The loop earns its complexity the moment a task needs feedback — when step 2 depends on what the world said after step 1. That's the real boundary between "LLM feature" and "agent."
Module 02 // Steering in text

The instruction layer

The system prompt is the harness's configuration file written in prose. Production prompts aren't one paragraph of vibes — they're a layered document where each layer has a job, and each missing layer has a signature failure.

INSTRUMENT · ANATOMY OF A PRODUCTION SYSTEM PROMPT — TAP A LAYER
Share percentages are typical of serious agent prompts — note how little is "personality" and how much is operating procedure.

The rule of thumb that separates hobby harnesses from production ones: steer with code when you can, prose when you must. "Never call delete_db in prod" written in the prompt is a suggestion the model will occasionally ignore under pressure; the same rule written as a gate in code is physics. Prompts steer judgment (tone, priorities, when to ask vs. act). Code enforces invariants (permissions, budgets, formats).

  • Instructions compete with everything else in the window. A 6,000-token prompt the model half-follows loses to a 1,500-token prompt it fully follows. Cut until every sentence has changed behavior in a trace you've read.
  • Positive beats negative. "Cite the file path for every claim" outperforms "don't make things up." Models follow patterns better than prohibitions.
  • Examples are the strongest steering tokens you own. One worked example of a perfect tool call or output format outperforms three paragraphs describing it.
  • Version it like code. The prompt is a build artifact: diff it, review it, and eval every change (Module 07). Silent prompt edits are how regressions ship.
When / whyWhen does the prompt stop being enough? When you notice yourself writing "ALWAYS" and "NEVER" in caps for the third time about the same behavior — that instruction wants to be a gate (Module 05) or a verifier (Module 06), not louder prose.
Module 03 // Hands for the model

Tool design

A tool is a function you expose plus a description the model reads. That description is not documentation — it's part of the prompt, consulted at decision time, every turn. Most harnesses are won or lost here, not in the system prompt.

The model chooses tools the way you'd choose from a menu written by a stranger: entirely from the names, descriptions, and parameter hints. It can't read your source. So the schema is the entire interface — and vague schemas produce an agent that guesses, thrashes between similar tools, and hallucinates parameters.

INSTRUMENT · THE SAME TOOL, TWO SCHEMAS

        
    Same backend function. The production schema costs ~90 extra tokens and removes four failure modes before the first inference runs.

    Design rules that generalize

    • Name by intent, scope by task. search_orders beats query_db. If two tools overlap, the description must say when to pick each — or the model will alternate between them at random.
    • Errors are teaching moments. A stack trace teaches nothing; {"error":"date_range too wide","hint":"max 90 days — split the query"} lets the model self-correct on the next turn. Design error returns for a model reader.
    • Budget the output. Every byte a tool returns is context you pay for (Module 04). Return the 20 rows the task needs with a total_matches count, never the 10,000-row dump.
    • Fewer, sharper tools. Past a couple dozen tools, selection accuracy degrades. Consolidate (file_read/file_write/file_list → one file tool with an action enum) or gate tool visibility by task phase.
    • Mark side effects. Distinguish read-only tools from world-changing ones in the schema itself — your gate layer (Module 05) keys off exactly this.
    The ecosystem moveMCP (Model Context Protocol) standardized the tool contract: servers expose tools, any compliant harness can consume them. Adopted across major vendors in 2025, it's why "add Gmail / GitHub / your database to your agent" went from a weekend of glue code to a config line. Design lesson unchanged: an MCP server is just tool schemas — the rules above still decide whether it works.
    When / whyWhen to add a tool at all: when the model needs facts or effects it can't produce from weights. When not to: when a deterministic pipeline step could do it without a decision. Tools are for choices; code is for certainties.
    Module 04 // The scarce resource

    Context management

    The context window is the agent's entire perceived universe, and it's a finite budget that every subsystem spends from. Long-running agents don't die from bad reasoning — they die from context mismanagement.

    Two facts drive everything in this module. First: in a loop, context compounds. Every tool result, every retry, every file read stacks into history — a 40-turn session can eat a six-figure token window on results alone. Second: quality degrades before capacity runs out. Models attend less reliably to material buried in a huge window ("context rot"), so an agent at 90% capacity isn't almost-fine — it's already reasoning worse.

    INSTRUMENT · THE WINDOW AS A BUDGET
    System prompt Tool schemas Conversation Tool results
    04% usedwindow budget (e.g. 200K)
    WHEN IT'S FULL, PICK A STRATEGY:
    Advance turns to watch results (dark violet) dominate the budget — then try each strategy and read its tradeoff.
    Real harnesses layer these: compact continuously, spawn sub-agents for context-heavy detours, and keep a memory file for anything that must survive the session. Claude Code does all three.

    The wider toolkit

    • Just-in-time retrieval beats preloading. Don't stuff every maybe-relevant document in up front — give the agent search/read tools and let it pull what the current step needs. Lighter window, fresher attention.
    • Compaction is lossy — test the loss. A summary that drops the one constraint that mattered ("customer said don't email them") is worse than truncation. Treat your summarizer as a component with its own evals (Module 07).
    • Memory files are the cheapest long-horizon trick. A plain markdown file the agent reads at start and appends decisions to (NOTES.md, CLAUDE.md) gives persistence across sessions with zero infrastructure — and you can read it, which matters for debugging.
    • Cost is a context problem. Loops multiply tokens: 30 turns × a fat window is real money per task. Compaction and output-budgeted tools (Module 03) are your cost levers as much as your quality levers.
    When / whyWhen to invest here: the moment sessions regularly pass ~20 turns, or you catch the agent "forgetting" its own earlier findings. Before that, a plain growing history is honestly fine — premature context machinery is its own failure mode.
    Module 05 // Blast radius control

    Gates & permissions

    The model requests; your code disposes. Gates are the layer that decides — per action, per environment — whether execution is automatic, announced, approved by a human, or refused. This is where agent safety actually lives.

    Score every tool call on two axes: reversibility (can you undo it?) and scope (who or what does it touch?). Reading a file is reversible and private — automate it. Sending an email is irreversible and external — a human sees it first. Deleting production data is irreversible and systemic — the harness shouldn't even own that capability. The matrix below encodes the pattern:

    INSTRUMENT · WHAT GATE DOES THIS ACTION EARN?
    AUTO

    Reversible, private, no external blast radius — gating this would only train your team to click "approve" without reading.

    Four gate levels: AUTO (just log it) · NOTIFY (do it, tell a human) · APPROVE (human confirms first) · FORBID (capability doesn't exist in this harness).

    Patterns that hold up

    • Allowlist, don't blocklist. Enumerate what's permitted; everything else fails closed. Blocklists lose to creativity — yours and the model's.
    • Draft, don't send. For anything external (email, posts, messages), the agent produces the artifact and a human fires it. You keep 95% of the leverage and 0% of the "it emailed the whole client list" incidents.
    • Sandbox first, always. Give the agent a disposable environment where AUTO is safe, and promote actions outward only with evidence. Cheap sandboxes are the highest-ROI safety spend in the field.
    • Budgets are gates too. Token ceilings, dollar caps, wall-clock limits, max-turns — quantitative gates that stop runaway loops no rule anticipated.
    • Audit everything. Every call, every gate decision, every human override into an append-only log. When something goes wrong, the trace is your only forensics.
    • Approval fatigue is a failure mode. Gate too much and humans rubber-stamp; the gate becomes theater. Ruthlessly automate the safe stuff so attention is spent where it counts.
    In a ready-made harnessThis ladder isn't theory — it's the settings screen of the tools you may already run. In Claude Code, the permission mode sets the default gate (plan-only up through auto-accepting edits), allow/deny rules pin specific tools and commands to AUTO or FORBID, and hooks run your own code before any tool fires — a programmable gate. Codex CLI ships the same ladder as approval modes, from suggest-only to full-auto. Both offer sandbox flags that make AUTO safe by construction. Setting these deliberately instead of accepting defaults is most of what separates a careful operator from a lucky one — the Operator Course (FM-03) works through these controls hands-on.
    When / whyWhen gates become mandatory: the first moment any tool has side effects beyond a sandbox. Not after the pilot, not at "scale" — the first side-effecting tool. Retrofitting gates after an incident is the industry's most repeated mistake.
    Module 06 // Closing the loop

    Verification

    Generating is easy; knowing it's right is the hard part. The single biggest reliability upgrade in any harness is refusing to accept the model's "done" — and checking instead.

    The organizing idea is the generator–verifier gap: tasks where checking is much cheaper than doing are the tasks agents crush. Code is the flagship case — tests and compilers are free, instant, incorruptible critics — which is exactly why coding agents matured years ahead of everything else. The engineering corollary: you can often make a task agent-ready by making it checkable — demand structured output you can validate, define acceptance tests up front, decompose fuzzy work into steps with crisp pass/fail edges.

    Deterministic checks

    Compilers, test suites, linters, type checkers, schema validators. Free, instant, zero false authority. Route their raw output straight back into context — this feedback loop is the agentic coding revolution.

    Property & policy checks

    Domain rules as code: "totals reconcile," "no PII in output," "response cites a source for every figure." Cheap to write, brutal at catching plausible-but-wrong.

    LLM-as-judge

    A second model grades against a written rubric — for the fuzzy qualities (tone, completeness, reasoning) nothing deterministic can score. Powerful, but it's a model: it drifts, flatters, and needs its own eval (Module 07) before you trust it.

    Human review

    The scarce resource. Spend it where stakes are highest and automation is weakest — sampled, not universal, and always downstream of the cheaper rungs above.

    INSTRUMENT · WHAT A VERIFY LOOP BUYS — AND COSTS
    Task success
    Cost per task
    Latency

    Verification off: fast, cheap, and you're shipping the model's first draft with its confidence as your only quality signal.

    Illustrative numbers. The trade is universal though: verify loops buy correctness with tokens and time. For anything customers see, it's the best trade in the building.
    When / whyWhen to wire this in: before you try to "improve the prompt." Teams burn weeks tuning instructions when a test-feedback loop would have let the agent fix itself in one retry. Verification isn't the polish step — it's the second thing you build, right after the loop runs at all.
    Module 07 // Knowing it works

    Evals

    An eval is a repeatable test of the whole harness: same tasks in, scored outcomes out, run on every change. Without one, "we improved the prompt" is a mood. With one, it's a diff.

    Harness evals are not model evals. Model benchmarks (MMLU, coding leaderboards) tell you about the engine. Your eval tests your car: your prompt, your tools, your compaction, your gates, on your tasks. The recipe is unglamorous and universal:

    • A golden set — 10 to 50 real tasks with known-good outcomes. Start with the failures that made you swear; those are your regression tests forever.
    • A grader per task type — deterministic where possible (exact match, tests pass, schema valid), an LLM judge with a written rubric where not. Judges get spot-checked against human grades before you trust them.
    • Multiple runs per task. Agents are stochastic: a task that passes 6 of 10 runs is a coin flip in production. Track pass rates, not pass/fail.
    • Run on every change — prompt edit, tool rename, model swap, compaction tweak. The harness is a system; any change can regress any behavior.
    • Read traces. Scores tell you that it broke; the transcript tells you where. The core practitioner skill of this whole field is reading agent traces the way a mechanic listens to an engine.
    INSTRUMENT · YOU CHANGED THE HARNESS. WHAT CAN SILENTLY BREAK?

    BLAST RADIUS

    The uncomfortable pattern: every row ends in "…so run the full golden set." That's the point — component changes have system-level consequences.
    When / whyWhen to build the eval: the moment the harness sort-of works — before the first "improvement." Every tweak made without an eval is a bet placed blind, and the losses compound silently until a customer finds them for you.
    Module 08 // Shapes of the machine

    Architecture patterns

    Five shapes cover essentially every agent system in production. Each is the plain loop from Module 01, multiplied or specialized — pick by task shape, not by ambition.

    When / whyThe upgrade path is a ladder, not a menu: start P1, split into P2 when steps become fixed and repeatable, add P3 when traffic diversifies, add P4 when one window can't hold the work. P5 is a research trip — take it on purpose or not at all.
    Module 09 // Ways to build one

    The landscape

    Every option on the market is one of four routes. Named tools below are the early-2026 snapshot — names churn quarterly; the four routes haven't moved in years.

    ROUTE ARaw loop — own everything

    A provider SDK, your ~100-line loop, your tools. Every behavior is yours to see and change.

    Anthropic / OpenAI / Gemini APIs · any OpenAI-compatible endpoint
    Pick when: learning the field, maximum control, tight custom products. Everyone should build one once — it demystifies every framework forever.

    ROUTE BAgent frameworks & SDKs

    Libraries that ship the loop plus the hard extras: durable state graphs, retries, streaming, tracing, handoffs.

    LangGraph · OpenAI Agents SDK · Pydantic AI · Vercel AI SDK · Google ADK · CrewAI · AutoGen/AG2 · smolagents
    Pick when: production orchestration needs (persistence, resumability, observability) outgrow your loop. Cost: you now debug their abstractions plus yours.

    ROUTE CReady-made harnesses

    Buy the whole car; bring tasks. Extend through sanctioned seams — MCP servers, skills, hooks, config — instead of forking.

    Claude Code / Agent SDK · Codex CLI · Gemini CLI · Aider · Cline · OpenHands · Cursor & Windsurf agents
    Pick when: the job is coding or general computer work and your edge isn't harness engineering. Years of loop/context/gate refinement, free.

    ROUTE DPlumbing & protocols

    The layer under all routes: standard tool wiring, model gateways, and local serving.

    MCP (tools) · LiteLLM / OpenRouter (one API, many models) · Ollama · LM Studio · vLLM · MLX (local serving)
    Pick when: always — whichever route you take, this layer decides how portable it is across models and machines.
    RouteYou writeYou getWatch out
    A · Raw loopEverything (~100+ lines)Total control, total understandingYou rebuild retries, tracing, persistence yourself
    B · FrameworkGraph/config + toolsDurability, observability, patternsAbstraction debugging; framework churn
    C · Ready harnessConfig, MCP servers, skillsYears of harness engineering, day oneTheir opinions are your constraints
    D · PlumbingConfig + endpointsModel portability, local optionsLowest-common-denominator features across providers

    Picking the model(s)

    • Tool-calling reliability beats leaderboard IQ. An agent lives or dies on emitting valid, well-chosen tool calls turn after turn. Test that specifically — it varies more across models than reasoning scores suggest.
    • Loops multiply cost. Per-token price × 30 turns × fat context is the real bill. This is why routing and pipelines mix tiers: cheap models for easy stages, frontier for the hard step.
    • Local models earn their place when privacy, cost-at-volume, or offline operation matter — and modern open-weight models handle tool calls well enough for pipeline stages and drafts. Serve them behind an OpenAI-compatible endpoint and your harness won't know the difference.
    • Long-context quality ≠ long-context size. Two models with the same window degrade differently when it's full. Eval at realistic fill levels, not on toy prompts.

    Cost control

    • Prompt caching is the #1 cost lever for loops. An agent re-sends the same system prompt and tool definitions every single turn — exactly the stable prefix providers cache at a fraction of full price. Keep that prefix static (no timestamps, no per-turn edits near the top) and a 30-turn session stops paying full freight thirty times for the same tokens.
    • Route by tier. Frontier models for planning, diagnosis, and review; a cheaper tier for the mechanical middle — formatting, extraction, easy pipeline stages. A gateway (Route D) makes the split a config line instead of a rewrite.
    • Cap in tokens and dollars. Token budgets miss price changes and model swaps; dollar budgets miss runaway context growth. Set both, per run and per day — budgets are gates that work while humans sleep (Module 05).
    INSTRUMENT · DECISION HELPER — THREE QUESTIONS, ONE STARTING POINT
    1 · What are you building?
    2 · Control appetite?
    3 · Where do models run?

    RECOMMENDED STARTING POINT

    A starting point, not a verdict — the honest answer to most "which stack?" debates is "the one whose failure modes you can already read."
    Module 10 // Field guide

    Failure modes

    Agents fail in patterns, and the patterns repeat across every stack. Learn the six below and you can diagnose most sick harnesses from a single trace read.

    Context rot

    Symptom
    Late-session quality slide: forgets its own findings, re-reads files, contradicts earlier decisions.
    Cause
    Window stuffed with stale tool output; attention degrades before capacity runs out.
    Fix
    Compact continuously, budget tool outputs, offload detours to sub-agents (Module 04).

    Doom loop

    Symptom
    Same failing action, slight variations, forever. Token bill climbs; nothing changes.
    Cause
    No progress detection; error output too vague to learn from.
    Fix
    Turn/cost caps, repeated-action detection, error messages with hints (Module 03), escalate-to-human as a stop state.

    Tool thrash

    Symptom
    Wrong tool, wrong parameters, or ping-ponging between two similar tools.
    Cause
    Overlapping or vague schemas; too many tools in scope at once.
    Fix
    Sharpen descriptions, merge overlapping tools, add "use X for…, use Y for…" disambiguation, trim the toolbelt per phase.

    Confabulated success

    Symptom
    "Done! All tests pass." Narrator: they did not pass. The most dangerous failure — it looks like success.
    Cause
    Exit on the model's self-report instead of evidence.
    Fix
    Verified exits only (Module 06): the harness re-runs the check itself and compares, never trusts the transcript.

    Prompt injection

    Symptom
    Agent "obeys" text found inside a webpage, email, or file — exfiltrates data, takes unrequested actions.
    Cause
    Untrusted content enters the same channel as trusted instructions, and the model can't reliably tell them apart.
    Fix
    Treat fetched content as data, least-privilege tools, gate all outbound actions (Module 05), never combine private data + untrusted input + an open send channel without a human in the loop.

    Approval fatigue

    Symptom
    Humans rubber-stamp every gate prompt without reading. The gate is now theater.
    Cause
    Over-gating safe actions until attention is exhausted.
    Fix
    Automate the reversible, reserve approvals for irreversible+external, batch low-stakes confirmations.
    The security frame to teachThe dangerous triad: access to private data, exposure to untrusted content, and an outbound channel. Any two are manageable; all three in one harness is an exfiltration machine waiting for its first malicious webpage. Design so at least one leg is always missing — or gated by a human.
    Module 11 // When to add what

    Build order

    Every subsystem in this manual is optional until a specific symptom appears — then it's mandatory. Building them before the symptom is how projects die of infrastructure. Earn each component.

    v0.1

    The bare loop

    Model + two tools + a 10-turn cap + print every message. Nothing else. Get one real task end-to-end today.

    WHEN: day one. Always start here — even if you'll adopt a framework later, this teaches you to read it.
    v0.2

    Verification

    One deterministic check wired back into the loop — tests, a schema validator, a reconciliation. Exit only on evidence.

    WHEN: the first time it says "done" and it isn't.
    v0.3

    Gates

    Allowlist + approval step + budget caps + an audit log.

    WHEN: the first tool with side effects beyond a sandbox. Non-negotiable timing.
    v0.4

    The eval

    Ten golden tasks, graded, multiple runs, kept forever. Your license to change things.

    WHEN: before your first "improvement" — not after your first regression.
    v0.5

    Context machinery

    Compaction, output budgets on tools, a memory file.

    WHEN: sessions pass ~20 turns, or the agent starts forgetting its own work.
    v0.6

    Patterns

    Pipeline stages, a router, or sub-agents — whichever the task shape demands (Module 08).

    WHEN: one loop in one window measurably can't hold the job.
    v1.0

    Operations

    Versioned prompts and configs, stored traces, eval-in-CI, cost dashboards. The harness becomes a maintained system.

    WHEN: anyone besides you depends on it.
    The disciplineThe failure mode of smart builders isn't skipping steps — it's building v0.5 and v1.0 before a single task has run end-to-end. Infrastructure feels like progress; a working v0.1 in an afternoon is progress. Ship the loop first.
    Module 12 // Active recall

    Knowledge check

    Ten questions, one per load-bearing idea. If you can answer these cold, you can teach this material — each explanation is a line you can reuse in front of a room.

    0 / 10 Answers reveal explanations — miss on purpose if you want the teaching lines.
    Module 13 // Quick reference

    Glossary

    Agent
    A model run in a loop with tools and feedback, pursuing a goal across multiple turns rather than answering once.
    Harness
    All the software around the model: loop, tools, context plumbing, gates, verification, evals. The subject of this manual.
    Agent loop
    The cycle of assemble context → infer → gate → execute tools → feed results back, until a verified exit or a stop condition.
    Tool / tool call
    A function you expose to the model plus the structured request it emits to invoke it. The model requests; your code executes.
    Tool schema
    The name, description, and parameter spec the model reads to choose and fill a tool call. Functions as part of the prompt.
    MCP
    Model Context Protocol — the open standard (2024) for exposing tools/data to any compliant harness. Turned tool wiring into an ecosystem.
    System prompt
    The harness's standing instructions: identity, environment, tool guidance, policies, procedure. Configuration written in prose.
    Context window
    The finite token budget of everything the model can see in one inference — its entire perceived universe.
    Compaction
    Summarizing older history into a brief to reclaim window space while preserving decisions. Lossy — test the loss.
    Context rot
    Quality degradation as the window fills: the model attends less reliably to buried material well before the hard limit.
    Sub-agent
    A worker spawned with a fresh context to absorb a context-heavy subtask, returning only a distilled report.
    Memory file
    A plain file (e.g. NOTES.md) the agent reads at start and appends decisions to — cheap persistence across sessions.
    Gate
    A per-action permission decision in code: auto, notify, approve, or forbid — keyed on reversibility and scope.
    Sandbox
    An isolated, disposable environment where autonomous action is safe by construction. The cheapest safety you can buy.
    Verifier
    Any check the harness runs on outputs: tests, validators, policy rules, an LLM judge, sampled humans. Exit on evidence, not self-report.
    Generator–verifier gap
    Tasks where checking is far cheaper than doing are the tasks agents excel at. Explains why coding matured first.
    LLM-as-judge
    A second model grading outputs against a written rubric. Powerful for fuzzy qualities; needs its own eval before you trust it.
    Golden set
    Your saved real tasks with known-good outcomes — the regression suite for the whole harness.
    Trace
    The full transcript of a run: every message, tool call, result, gate decision. The primary debugging artifact of the field.
    Prompt injection
    Untrusted content (webpage, email, file) steering the agent because it shares the channel with trusted instructions.
    Orchestrator
    A lead agent that decomposes work, briefs sub-agents, and merges their reports (pattern P4).
    Stop condition
    Harness-owned limits — turns, tokens, dollars, wall clock, no-progress — that end a run no matter what the model wants.
    FM-01 is the free third of the kit

    The Agent Harness Kit

    This manual teaches how the machine works. The other two thirds put your hands on it — same voice, same doctrine, zero filler:

    FM-01 · You are hereField ManualThe doctrine: loop, tools, context, gates, verification, failure modes. Free — share it.
    FM-02Harness FactoryGenerates a working harness you own — your tools, your gates, your loop, ready to run and read.
    FM-03Operator CourseDriving agents through real work: permission modes, hooks, session habits, and reading traces.
    GET THE FULL KIT · $29 →
    One purchase, all three files, yours forever. If the free manual earned its keep, the paid two go further.
    THE HARNESS · FM-01 · rev 2026-07
    Single HTML file · self-contained · all instruments run locally in this page
    Fonts load from Google Fonts when online; system fallbacks offline. Built to be taught from — project it, fork it, hand it out.