Skip to content
Building Coding Agents and Harnesses chapter route0102030405060708091011121314151617

Building Agents

Building Coding Agents and Harnesses

The model is the small part. The harness around it (prompt assembly, context management, tool execution, sandboxing, subagents) is what turns a token predictor into something that reads a codebase, runs the tests, and opens a pull request.

17 chapters170 slides2 hr 16 minUpdated

Your route through the subject

0/170 slides completed · 0/17 chapters · 0 slides read

Start with: What Is an Agent Harness?

Begin reading

The chapter map

Follow the route or choose a chapter.
  1. 010/12 completeWhat Is an Agent Harness?~12 minReadCode
  2. 020/11 completeThe Agent Loop~13 minReadCode
  3. 030/12 completeBuilding the Prompt~15 minReadCode
  4. 040/13 completeTokens, Context Windows, and the Quadratic Problem~13 minReadPlateCode
  5. 050/15 completePrompt Caching and Context Management~16 minReadPlateCode
  6. 060/6 completeTools and Tool Execution~4 minReadCode
  7. 070/6 completeSandboxing, Approvals, and Checkpoints~5 minReadField checkPlateCode
  8. 080/9 completeParallelism, the Responses API, and the App Server~6 minReadCode
  9. 090/6 completeMemory Outside the Weights~5 minReadCode
  10. 100/9 completeSkills, MCP, and Deterministic Computation~6 minReadCode
  11. 110/11 completeSubagents and Multi-Agent Orchestration~6 minReadCode
  12. 120/6 completeObservability, Hooks, and the Agent SDK~5 minReadCode
  13. 130/10 completeCode Review and Security Agents~6 minReadCode
  14. 140/11 completeAutonomous Task Agents: Manus and CodeAct~6 minReadCode
  15. 150/11 completeDeep Research Agents and How They Are Trained~7 minReadCode
  16. 160/11 completeProduction Realities: Economics, Security, and Governance~7 minReadCode
  17. 170/11 completeBuilding the Full Mini-Harness~4 minReadCode

Chapters

  1. Chapter 1: What Is an Agent Harness?

    A coding agent harness is the ordinary software wrapped around a model: it feeds context, runs tool calls, and keeps output on the rails.

    12 min12 slides: What Is an Agent Harness?0/12 complete

  2. Chapter 2: The Agent Loop

    Every coding agent runs one small loop: gather history, call the model with its tools, then act on a tool call or stop on plain text.

    13 min11 slides: The Agent Loop0/11 complete

  3. Chapter 3: Building the Prompt

    A coding agent prompt is not one string; it is layered instructions, a structured history, and tool schemas sent as separate fields.

    15 min12 slides: Building the Prompt0/12 complete

  4. Chapter 4: Tokens, Context Windows, and the Quadratic Problem

    Every turn replays the full conversation, so tokens sent grow quadratically as a session lengthens, capped by the context window.

    13 min13 slides: Tokens, Context Windows, and the Quadratic Problem0/13 complete

  5. Chapter 5: Prompt Caching and Context Management

    Prompt caching reuses an unchanged prefix at a fraction of the cost. Compaction and truncation keep long sessions under the context ceiling.

    16 min15 slides: Prompt Caching and Context Management0/15 complete

  6. Chapter 6: Tools and Tool Execution

    A tool call runs through six steps: parse, validate, check permissions, execute, capture output, then truncate and format the result.

    4 min6 slides: Tools and Tool Execution0/6 complete

  7. Chapter 7: Sandboxing, Approvals, and Checkpoints

    Sandboxing restricts what a command can touch at the OS level, while layered approvals decide what runs without asking a human.

    5 min6 slides: Sandboxing, Approvals, and Checkpoints0/6 complete

  8. Chapter 8: Parallelism, the Responses API, and the App Server

    Independent tool calls run in parallel when reads stay concurrent and writes stay serial. Covers the Responses API and App Server.

    6 min9 slides: Parallelism, the Responses API, and the App Server0/9 complete

  9. Chapter 9: Memory Outside the Weights

    Coding agents keep no memory between sessions, so project knowledge lives in files like AGENTS.md and path-scoped rules.

    5 min6 slides: Memory Outside the Weights0/6 complete

  10. Chapter 10: Skills, MCP, and Deterministic Computation

    Skills load only a short description at start and pull in full instructions when used. MCP is the standard protocol for plugging in external tools.

    6 min9 slides: Skills, MCP, and Deterministic Computation0/9 complete

  11. Chapter 11: Subagents and Multi-Agent Orchestration

    A subagent gets its own context window so noisy research does not fill the main conversation. Covers orchestrator and verifier patterns.

    6 min11 slides: Subagents and Multi-Agent Orchestration0/11 complete

  12. Chapter 12: Observability, Hooks, and the Agent SDK

    Hooks fire on every lifecycle event regardless of what the model decides, and the Agent SDK caps turns and budget so cost becomes an engineering decision.

    5 min6 slides: Observability, Hooks, and the Agent SDK0/6 complete

  13. Chapter 13: Code Review and Security Agents

    Cursor's Bugbot and security agents review pull requests behind a short prompt backed by heavy infrastructure and independent checks.

    6 min10 slides: Code Review and Security Agents0/10 complete

  14. Chapter 14: Autonomous Task Agents: Manus and CodeAct

    CodeAct has the model write a short Python program as its action instead of a fixed function call. Manus keeps a todo.md file as memory.

    6 min11 slides: Autonomous Task Agents: Manus and CodeAct0/11 complete

  15. Chapter 15: Deep Research Agents and How They Are Trained

    A deep research agent plans, spawns subagents to search, and checks claims against sources. It is trained with reinforcement learning, not just prompted.

    7 min11 slides: Deep Research Agents and How They Are Trained0/11 complete

  16. Chapter 16: Production Realities: Economics, Security, and Governance

    Running coding agents across an engineering org surfaces real costs, security incidents, and the limits of trusting fluent output.

    7 min11 slides: Production Realities: Economics, Security, and Governance0/11 complete

  17. Chapter 17: Building the Full Mini-Harness

    A working mini coding-agent harness that assembles the loop, layered prompts, approval-gated tools, and memory into one terminal agent.

    4 min11 slides: Building the Full Mini-Harness0/11 complete