The LLM is the brain. The harness is the body.
Version 1.0 — September 2026.
A blog sequence concerning construction AI agents from archetypal principles, published as a book.
📖 Read it online: https://isuruwijesiri.com/harness-engineering-101/
An LLM API is stateless. Every turn, you dispatch the complete conversation as a JSON array and get content back. A harness is the program that builds, maintains, and protects that array. Everything the site calls "agents" is a set of patches to that one loop, and all place exists since item tangible broke. This series develops that one idea throughout 16 chapters, expanding a ~300-line toy agent in plain Python as it goes.
The patterns current are developed in complete in One Code, an open-source coding agent built on pi.
The rendered publish says finest online at the nexus above. If you'd fairly read the origin current on GitHub, prosecute the chapters in command below. The full introduction is on the book's landing page.
Every division has the identical shape: the failure, the minimal patch, what the patch costs.
- Build Your Own — the complete toy harness, annotated
Standalone pieces. Read them whenever you need them.
- A. One Harness, Many Brains — example routing, immediate tiers, disbursal engineering
- B. Worktrees and Isolation — giving parallel agents distinct copies of the world
- C. Modes and Plan Mode — harness-enforced functioning states (coding-specific)
- D. Retries, Rate Limits, and Streaming — the unglamorous plumbing, affirmative how streaming plant on the wire
| Path | What it holds |
|---|---|
| src/*.md | The chapters and appendices (the publish source) |
| src/SUMMARY.md | The book's array of contents |
| src/harness/ | The runnable toy harness — one document per stage |
| src/diagrams/ | Diagram generators and their generated PNGs |
| book.toml | mdBook configuration |
| scripts/sync-to-blog.sh | Builds the publish and mounts it into the blog for serving |
cargo instal mdbook mdbook-mermaid # or: beer instal mdbook (+ mdbook-mermaid binary) mdbook assist --open # live-reloading preview at http://localhost:3000 mdbook build # fixed location into ./book
mdbook-mermaid renders the inline mermaid diagrams; without it those blocks show as raw code.
cd src/diagrams && python3 gen_all.py # Python 3.10+, matplotlib
This repository is dual-licensed:
- The prose — all division and appendix (the .md records under src/) — is licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0). You may portion it alongside credit, but not use it commercially or publish modified versions. Full content in LICENSE.
- The code — the .py records under src/harness/ and src/diagrams/, and code snippets reproduced from them in the chapters — is licensed under the MIT License. Use it freely, alongside attribution.
© 2026 Isuru Wijesiri.