Agents & Coding

Harness Engineering 101 Argues Agents Are Just Patches to a JSON Loop

The book's core claim is narrow: agents are patches to a stateless JSON loop. Its AI-assisted prose and brain-and-body framing drew the sharpest objections.

88 points41 comments

Harness Engineering 101, a 16-chapter book by Isuru Wijesiri, argues that an LLM API is stateless: each turn resends the whole conversation as a JSON array, and a harness is the program that builds, maintains and protects that array. Everything the field calls an agent, the book says, is a patch to that loop, each added because something concrete broke.

The series grows a roughly 300-line toy agent in plain Python, drawing on the author's work on WSO2 MI Copilot, WSO2 BI Copilot and One Code. Wijesiri discloses that he drafted every chapter himself but used Claude Code and One Code to reorder chapters, polish the English, generate diagrams and write the chart-drawing code.

The bits that matter

  • Each chapter follows one shape: the failure, the minimal patch, and what the patch costs. Four parts cover the wire protocol, running long under context pressure, the framework ecosystem, and trust, domains and data.
  • The prose is licensed CC BY-NC-ND 4.0 and the code MIT; the runnable harness lives in src/harness/, one file per stage, with diagram generators in src/diagrams/.
  • The book builds with mdBook, and mdbook-mermaid renders inline diagrams; quantitative charts regenerate through python3 gen_all.py, which needs Python 3.10+ and matplotlib.
  • Appendices cover model routing and prompt tiers, worktrees and isolation for parallel agents, harness-enforced plan mode, and retries, rate limits and streaming.
  • The repository lists 29 commits, 308 stars and 17 forks, and the text is marked version 1.1, October 2026.

Discussion analysis

Brain-and-body framing invites anthropomorphism charge

The book's central metaphor, an LLM as a brain and the harness as its body, draws the objection that it implies LLMs are alive or organized like biological brains, against the evidence. The complaint extends to the volume of AI-written advocacy for AI.

AI-assisted prose draws slop accusations

The prose drew dismissal as LLM-generated slop, and one response stopped early over phrasing such as load-bearing. A reply conceded the prose criticism and asked which ideas were wrong; another disputed the statement that the AI-usage explanation appeared in a top-level comment, leaving the disclosure's location unresolved in this sample.

Why LLMs did not arrive in 2005

A tangent asks why LLMs were absent in 2005. One answer credits missing ideas for making them work and no clear direction to scale; a reply asks whether training a modern model in reasonable time would also have required one to two orders of magnitude more compute than 2005-era supercomputers offered.