HeadlinesBriefing HeadlinesBriefing.com

Harness Engineering 101: Building AI Agents

Hacker News •
×

Harness Engineering 101 is a blog series and open book about building AI agents from first principles. Its central idea is that the LLM is the brain and the harness is the body. An LLM API is stateless: every turn, the full conversation is sent as a JSON array and text is returned. A harness is the program that builds, maintains, and protects that array. Everything the field calls "agents" is a set of patches to this one loop, and each patch exists because something concrete broke.

The series, dated September 2026 as Version 1.0, develops this idea across 16 chapters. It grows a roughly 300-line toy agent in plain Python as it goes. Each chapter follows the same shape: the failure, the minimal patch, and what the patch costs. The chapters cover topics from tool use and the agent loop to caching, context budgets, subagents, steering, background work, MCP, and guardrails. The book closes with a case study on coding agents and an argument that RAG was a harness pattern all along.

The patterns are developed in full in One Code, an open-source coding agent built on pi. The book is available to read online, and its source is hosted on GitHub. Appendices cover advanced topics such as model routing, worktrees and isolation, plan mode, and retries and streaming.

The repository includes the book source, a runnable toy harness with one file per stage, and diagram generators. Building the book requires mdbook and mdbook-mermaid. The prose is licensed under CC BY-NC-ND 4.0, while the code is released under the MIT License.

Source: Hacker News · Summarized by HeadlinesBriefing