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