首页 > AI前沿 > Harness Engineering 101: The LLM is the brain, the harness is the body

Harness Engineering 101: The LLM is the brain, the harness is the body

Hacker News 2026-10-19 20:07 5 阅读 查看原文
Harness Engineering 101 The LLM is the brain. The harness is the body. Version 1.0 — September 2026. A blog series about building AI agents from first principles, published as a book. 📖 Read it online: https://isuruwijesiri.com/harness-engineering-101/ An LLM API is stateless. Every turn, you send the entire conversation as a JSON array and get text back. A harness is the program that builds, maintains, and protects that array. Everything the field calls "agents" is a set of patches to that one loop, and each patch exists because something concrete broke. This series develops that one idea across 16 chapters, growing a ~300-line toy agent in plain Python as it goes. The patterns here are developed in full in One Code, an open-source coding agent built on pi. The rendered book reads best online at the link above. If you'd rather read the source here on GitHub, follow the chapters in order below. The full introduction is on the book's landing page. Reading order Every chapter has the same shape: the failure, the minimal patch, what the patch costs. Part I — The Wire (nothing is magic) Part II — Running Long (the array under pressure) Part III — The Ecosystem (naming what you already understand) Part IV — Trust, Domains, and Data Epilogue Build Your Own — the complete toy harness, annotated Appendix — Advanced Topics Standalone pieces. Read them when you need them. A. One Harness, Many Brains — model routing, prompt tiers, cost engineering B. Worktrees and Isolation — giving parallel agents separate copies of the world C. Modes and Plan Mode — harness-enforced operating states (coding-specific) D. Retries, Rate Limits, and Streaming — the unglamorous plumbing, plus how streaming works on the wire Repository layout Building the book locally cargo install mdbook mdbook-mermaid # or: brew install mdbook (+ mdbook-mermaid binary) mdbook serve --open # live-reloading preview at http://localhost:3000 mdbook build # static site into ./book mdbook-mermaid renders the inline mermaid diagrams; without it those blocks show as raw code. Regenerating the quantitative diagrams cd src/diagrams && python3 gen_all.py # Python 3.10+, matplotlib License This repository is dual-licensed: The prose — every chapter and appendix (the .md files under src/) — is licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0). You may share it with credit, but not use it commercially or publish modified versions. Full text in LICENSE. The code — the .py files under src/harness/ and src/diagrams/, and code snippets reproduced from them in the chapters — is licensed under the MIT License. Use it freely, with attribution. © 2026 Isuru Wijesiri.