<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/gMdrgGzUW" -->

---
title: Harness Engineering 101: The LLM is the brain, the...
description: This book series explains AI agents as a stateless LLM API wrapped by a 'harness', the program that builds, maintains, and protects the conversation's JSON...
canonical: https://daily.dev/posts/harness-engineering-101-the-llm-is-the-brain-the-harness-is-the-body-gmdrggzuw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Harness Engineering 101: The LLM is the brain, the harness is the body | daily.dev
og:description: This book series explains AI agents as a stateless LLM API wrapped by a 'harness', the program that builds, maintains, and protects the conversation's JSON...
og:url: https://daily.dev/posts/harness-engineering-101-the-llm-is-the-brain-the-harness-is-the-body-gmdrggzuw
og:image: https://api.daily.dev/og/posts/gMdrgGzUW.png
og:image:alt: Harness Engineering 101: The LLM is the brain, the harness is the body
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

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

**[Hacker News](https://daily.dev/sources/hn)** · 5 min read · 51 upvotes · 3 comments

## Summary

This book series explains AI agents as a stateless LLM API wrapped by a 'harness', the program that builds, maintains, and protects the conversation's JSON array. It argues every agent feature is a patch to that one loop, each existing because something concrete broke. The series spans 16 chapters plus four appendices, building a roughly 300-line toy agent in plain Python from first principles, covering caching, context budgets, subagents, MCP, guardrails and RAG. The patterns are also demonstrated in an open-source coding agent called One Code, built on the pi framework.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.com/IsuruMaduranga/harness-engineering-101>

## Questions this post answers

### what is an agent harness in LLM application development

An agent harness is the program that builds, maintains, and protects the conversation array sent to a stateless LLM API on every turn. Since an LLM API itself holds no memory between calls, the harness is responsible for assembling the full JSON array of messages each time, and most things called 'agents' are really a set of patches layered onto that single loop, each patch added because something concrete broke.

_Engineers designing their own agent loop can track harness-design writeups like this on daily.dev._

### why is RAG considered just another agent harness pattern

Retrieval-augmented generation is framed as one more harness pattern for managing what goes into the context array, rather than a separate technique, because its core job is deciding what information gets inserted into the stateless prompt before each LLM call. It's treated as one of several named strategies that all solve the same underlying problem of fitting relevant information into a limited, resettable conversation array.

_daily.dev surfaces architecture explainers like this for developers comparing RAG against other context strategies._

## Community take

How the wider developer community reacted, aggregated from 1 discussion and 102 comments across hackernews (as of 2026-10-20).

**TL;DR:** Reactions are dominated by pushback against the post's AI-generated prose ('slop' criticism), alongside a genuinely productive side-thread about why building your own harness from scratch is valuable, plus tangential debates about the brain/body metaphor and LLM anthropomorphization.

**Sentiment:** 20% positive · 30% mixed · 50% skeptical

**The case for**

- Several people say building your own toy harness from scratch, even a trivial one, teaches core agent concepts quickly and effectively.
- Some found the practical content and resource collection useful despite style complaints.
- One commenter shares that a custom harness with heavier inference let them run fully autonomous tasks successfully.

**The pushback**

- Many commenters criticize the writing as AI-generated 'slop' and say outsourcing writing to an LLM signals the author doesn't care about the content.
- Several argue the brain/body (and other) metaphors are overused, confusing, or scientifically dubious framings of how LLMs work.
- Some dispute the author's claimed 3 years of harness-building experience given the technology's short history.
- One commenter calls the broader anthropomorphizing of LLMs disingenuous or unfounded.

**By community**

- hackernews (heated): Discussion splits sharply between harsh criticism of AI-generated writing/credibility and a separate, more constructive thread praising DIY harness-building and sharing alternative metaphors.

**Hottest debate:** Whether using an LLM to polish/write the book's prose invalidates its value, versus whether the underlying ideas and practice of harness-building still matter.

**Open questions**

- Is there a reliable best-practices resource for hardening/securing an LLM harness beyond scattered 2023-era blog posts?
- How should a harness-based system be judged when so much of its 'intelligence' can live outside the LLM itself?

**Highlights**

> Instead of reading AI-slop explanations full of creaky metaphors, I'd advise you to just build your own basic coding harness from scratch. You will learn so much: 1) This old but still excellent blog post by Thorsten Ball is a good place to start (old in LLM years... written 18 months ago!): https://ampcode.com/notes/how-to-build-an-agent . It is written by a human, and gets across the core message really well. If you don't enjoy reading Go then just use an LLM to translate the samples into Python code or whatever. 2) Instead of relying on an api key like in the blog post in 1), you might want to use a local model that can do tool calls like Qwen 27B. 3) Use a frontier LLM for self-study and to help you write the harness boilerplace if you want, but ask it to force you to write the interesting bits by hand (e.g. the main loop structure, the tool call functions). Yes, coding by hand is still useful as an educational mechanism to force you to internalize some tricky concept. Be disciplined and don't slip into letting the LLM write the core logic for you. 4) Amaze your friends and colleagues with your newfound understanding of how agents actually work under the hood 5) Go even deeper and get into Inference engineering, LLM architecture internals, etc. 6) Profit. Perhaps? (Or at least enjoy the learning journey.)
> — [libraryofbabel on hackernews · 1 comments](https://news.ycombinator.com/item?id=50152122)

> People would appreciate and enjoy this work 100x more if it was written in your broken English. Either your English is good enough to read (even with some minor grammatical errors) or it's not and Claude generated most of the body text. In any case, not interested in your slop.
> — [nswizzle31 on hackernews](https://news.ycombinator.com/item?id=50152671)

> The LLM is the brain; the harness is the body. I mean, it can be that way. But it does't have to be. The Harness can be as much the brain as the LLM. You have nearly unlimited flexibility in what you do in the harness, and you can add as much of the overall "intelligence" of the system as you want in the harness. To illustrate, you can: 1. Use multiple "brains" / LLM's, and do routing between them using a specialized model (a Jev like model, or something of your own design) 2. Use planning tools like pyperplan, jupyddl, pddl4j, etc. 3. Implement your own "memory" system using... pretty much anything you want. And I would argue that a lot of the apparent "intelligence" of a system involves how well memory works 4. Call classical machine learning models to solve specialized problems 5. Use reinforcement learning to improve performance in specific areas 6. Implement a blackboard for multiple knowledge sources to collaborate. 7. Use inference engines using forward/backward chaining, RETE, etc. 8. Use your own hand-rolled abductive inference strategy 9. Implement your own Bayesian reasoning techniques 10. Use custom causal inference code ... and so on. Don't get me wrong. I'm bullish on what LLM's can do, but I posit that the overall expressed intelligence of a system can involve a lot more than just the LLM. In fact, I'd actually make the slightly stronger claim that, depending on what you're trying to do, an LLM might not even be required at all.
> — [mindcrime on hackernews · 1 comments](https://news.ycombinator.com/item?id=50152494)

> When i wrote my own harness, i didn't rely on what other agents do, but rather sat down and considered how i can solve the issues that i have when using other agents. And tbh, for alot of problems there are rather "simple" fixes - each comes with a cost tho. For me it was accepting to run more inference than "standard" agents but in return solving alot of issues those agents have. And to me having a full autonomous agent that i can task and just come back hours later to a solution is much more worth than just an agent that i need to "prompt jokey" the whole day. I think its important that people don't just look at whats implemented rn, but rather just try out new things , not just "adjust" the existing ones. Thats how we got better progress, not by trying to build the 1000s variant of context compression but rather reconsider how can context be build to not have this issue (simple example).
> — [voodooEntity on hackernews · 1 comments](https://news.ycombinator.com/item?id=50152177)

> Ohh yeah another AI written book about AI use.
> — [ixeption on hackernews](https://news.ycombinator.com/item?id=50152809)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=50151390) · 114 points · 102 comments

## Community discussion

Top comments from developers on daily.dev.

**@aidive** · 2 upvotes

> whole array goes out every turn. ClaudeDevs said Oct 16 Claude Code now gzips it before sending.

**@kartiknvj** · 2 upvotes

> Capturing the request at the last point before the HTTP call is the rule I wish I'd read a year ago. My debug logs showed what my code assembled, so a default the SDK added afterward never showed up and I blamed the model. Has the byte-identical prefix test in CI caught anything that watching cache_read_input_tokens missed?

**@dio77799** · 0 upvotes

> Framing an agent as a stateless LLM wrapped in a state-managing harness is the most practical way to view this architecture. Treating every agent feature as a patch to protect the conversation's JSON payload resonates a lot, especially when dealing with context budgets and MCP tool calls. Clean mental model!

## Similar posts on daily.dev

- [Harness Engineering](https://daily.dev/posts/harness-engineering-l1sahcwor) · Martin Fowler · 4 upvotes · 0 comments
- [Welcome to Learn Harness Engineering](https://daily.dev/posts/welcome-to-learn-harness-engineering-p7orheybq) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#llm](https://daily.dev/tags/llm), [#ai-agents](https://daily.dev/tags/ai-agents), [#mcp](https://daily.dev/tags/mcp)

[View this post on daily.dev](https://daily.dev/posts/harness-engineering-101-the-llm-is-the-brain-the-harness-is-the-body-gmdrggzuw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Harness Engineering 101: The LLM is the brain, the harness is the body","url":"https://daily.dev/posts/harness-engineering-101-the-llm-is-the-brain-the-harness-is-the-body-gmdrggzuw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/harness-engineering-101-the-llm-is-the-brain-the-harness-is-the-body-gmdrggzuw"},"datePublished":"2026-10-19T14:48:07.877Z","dateModified":"2026-10-20T18:04:43.175Z","description":"This book series explains AI agents as a stateless LLM API wrapped by a 'harness', the program that builds, maintains, and protects the conversation's JSON...","image":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","thumbnailUrl":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":3,"discussionUrl":"https://daily.dev/posts/harness-engineering-101-the-llm-is-the-brain-the-harness-is-the-body-gmdrggzuw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":51},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"python,llm,ai-agents,mcp","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Harness Engineering 101: The LLM is the brain, the harness is the body"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/harness-engineering-101-the-llm-is-the-brain-the-harness-is-the-body-gmdrggzuw","comment":[{"@type":"Comment","text":"whole array goes out every turn. ClaudeDevs said Oct 16 Claude Code now gzips it before sending.","datePublished":"2026-10-21T11:37:34.802Z","url":"https://daily.dev/posts/gMdrgGzUW#c-VC0qdGFxN","author":{"@type":"Person","name":"AI Dive","url":"https://daily.dev/aidive","image":"https://media.daily.dev/image/upload/s--CXOxN2Lp--/f_auto/v1787506402/avatars/avatar_ICUHYClOqsxUOW9ildHmf?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Capturing the request at the last point before the HTTP call is the rule I wish I’d read a year ago. My debug logs showed what my code assembled, so a default the SDK added afterward never showed up and I blamed the model. Has the byte-identical prefix test in CI caught anything that watching cache_read_input_tokens missed?","datePublished":"2026-10-21T11:50:46.235Z","url":"https://daily.dev/posts/gMdrgGzUW#c-ZbAIws1OR","author":{"@type":"Person","name":"kartik-nvjk","url":"https://daily.dev/kartiknvj","image":"https://media.daily.dev/image/upload/s--3gGgsVCw--/f_auto/v1781456774/avatars/avatar_TvTVeiMdkRCqWUDullFmy?_a=BAMAMiWQ0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Framing an agent as a stateless LLM wrapped in a state-managing harness is the most practical way to view this architecture. Treating every agent feature as a patch to protect the conversation’s JSON payload resonates a lot, especially when dealing with context budgets and MCP tool calls. Clean mental model!","datePublished":"2026-10-28T17:52:31.838Z","url":"https://daily.dev/posts/gMdrgGzUW#c-pByLnJsxb","author":{"@type":"Person","name":"James V","url":"https://daily.dev/dio77799","image":"https://media.daily.dev/image/upload/s--D_CwPJ3R--/f_auto,pg_1/v1794081525/avatars/avatar_SEp70EmWGM0hHeihGBCha?_a=BAMAMiiw0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/harness-engineering-101-the-llm-is-the-brain-the-harness-is-the-body-gmdrggzuw#faq","mainEntity":[{"@type":"Question","name":"what is an agent harness in LLM application development","acceptedAnswer":{"@type":"Answer","text":"An agent harness is the program that builds, maintains, and protects the conversation array sent to a stateless LLM API on every turn. Since an LLM API itself holds no memory between calls, the harness is responsible for assembling the full JSON array of messages each time, and most things called 'agents' are really a set of patches layered onto that single loop, each patch added because something concrete broke. Engineers designing their own agent loop can track harness-design writeups like this on daily.dev."}},{"@type":"Question","name":"why is RAG considered just another agent harness pattern","acceptedAnswer":{"@type":"Answer","text":"Retrieval-augmented generation is framed as one more harness pattern for managing what goes into the context array, rather than a separate technique, because its core job is deciding what information gets inserted into the stateless prompt before each LLM call. It's treated as one of several named strategies that all solve the same underlying problem of fitting relevant information into a limited, resettable conversation array. daily.dev surfaces architecture explainers like this for developers comparing RAG against other context strategies."}}]}
```

