# Agentic Coding: Build the Harness
The Loop, Guardrails, and Verification That Make Your AI Coding Agent Reliable on Real Code, Not Just Demos

- Price: $12.99 (Kindle ebook)
- Level: Intermediate
- Pages: 190
- Best for: Agents that demo well and break on real code
- You finish with: The loop, the guardrails, and the verification layer that make an agent reliable outside a demo
- Series: Agentic Coding: Ship Bigger Projects with AI, book 1 of 3
- Buy on Amazon: https://amzn.to/3QEWHS9
- Web page: https://youcanbuildthings.com/books/agentic-coding-harness

## What you get

Your AI agent dazzles in a demo, then falls apart on real code. The difference isn't the model. It's the harness. Build one running coding-agent harness yourself, layer by layer, in Python you understand down to the last line.

Your AI agent looks brilliant in the demo, then joins your real codebase and falls apart. The difference isn't the model. It's the harness around it. This book hands you the one thing every harness book on Amazon describes but never builds: a real, running coding-agent harness you code yourself, layer by layer, in about 190 pages of dense Python, ending with one complete system you understand down to the last line.

## Chapters

1. The 98% Nobody's Building: Why ~98% of a coding agent is harness, not model, and why that gap is your opening.
2. What a Harness Actually Is: The seven layers wrapped around the model, defined cleanly enough to draw from memory.
3. Why the Harness Beats the Model: Same model, +14 points: hold the engine still and change the transmission.
4. Build Your First Harness: The Loop: A real, running ~150-line agent loop in your terminal. The spine everything bolts onto.
5. Feeding the Harness: Context and State: Stop the agent losing the plot with a pinned progress note and a trimmed window.
6. Guardrails and the Tool-Call Boundary: Gate every tool call in code so your agent runs with write access without being a loaded gun.
7. Tool Design: The Agent Is Only as Good as Its Tools: Narrow, typed, retry-safe tools with errors the model can actually recover from.
8. Verification and Recovery: Catching the $1.78M Blunder: An independent check the agent can't fudge, and a rollback when it fails.
9. Make It Measurably Better: Eval-Driven Tuning: Prove a change helped with a real number instead of guessing.
10. Orchestration: The Meta-Harness: Run two harnesses on one job, a writer and an adversarial reviewer, through the filesystem.
11. Where Harnesses Break (and When to Stop Building): The honest chapter: drift, governance, and the layer you should refuse to add.
12. Choose, Build, or Switch: Your Harness From Here: Score six real harnesses against the seven layers and make the build-vs-adopt call.

## Free guides from this book

- [AI Agent Guardrails: Gate Every Tool Call](https://youcanbuildthings.com/articles/ai-agent-guardrails-tool-call.md): AI agent guardrails belong on one line of code: the tool call. Build a deterministic gate that classifies, approves, and fails safe before any action runs.
- [Build an AI Coding Agent From Scratch in Python](https://youcanbuildthings.com/articles/build-ai-coding-agent-from-scratch-python.md): Build an AI coding agent from scratch in Python: the ~150-line agent loop that reads files, writes code, runs tests, and stops on its own. No framework.
- [Context Engineering for AI Agents](https://youcanbuildthings.com/articles/context-engineering-for-ai-agents.md): Context engineering for AI agents: build a context layer that trims the window, pins a progress note, and survives long tasks where blind compaction fails.
- [What Is an Agent Harness? The 7 Layers](https://youcanbuildthings.com/articles/what-is-an-agent-harness.md): What is an agent harness? The 7 layers wrapped around the model: loop, context, guardrails, tools, verification, recovery, orchestration. With a teardown table.
- [Why AI Agents Report False Success](https://youcanbuildthings.com/articles/why-ai-agents-report-false-success.md): Why AI agents report false success: the bias that makes them grade their own work, the $1.78M bug it shipped, and the independent check that catches it.
