How To Build AI Systems That Improve With Every Run

An AI agent is an LLM in a loop that calls tools until it solves your problem. The harness around it uses feed-forward controls like prompts and feedback like logs to steer behavior. To build systems that improve automatically, index your codebase for context, log every run, and create evaluation pipelines so the agent can judge and fix itself.
Chapters
Agent is really just an LLM in a while loop at a really high level. And so when we talk about an agent, an agent's harness in conjunction with a model, this is what we can sort of see is user types a message and you have this inner loop, a tool loop, machine paste. Step 1, call LLM with some level of assembled context. That's an optimization problem in itself. The LLM is like, should I call a tool? Yes, I should call it. No, I shouldn't. Break. Text-only response. If it needs to call a tool, such as call this MCP server, get some data or call this MCP server, write some data, glob bash commands, call a subagent, that kind of thing. Keep going until you're done. And that, that's really this loop is keep going until you fulfilled the user's query from this input. So how well you fulfill the user's query is really that harness. And that's this part right here. When we talk about a coding agent like Claude Code or Codex, you can think of it as the model. Plus a harness. In cloud code, it would be the harness built by builders of that coding agent, the system prompt, the code search tools, orchestration, any of the markdown file context that comes with it in the assembly. And then the user harness, this is another term to define user harness is the feed forward or feedback controls per Martin Fowler and the language that his team brings to the table. That's how are you steering the thing? And then what inputs are you giving it? What's your prompt? And then what data are you giving it? What logs are you feeding it? And we see that really clearly with this visual here. So you as the human might be steering and you might drive principles, rules, reference documents, how-tos, and that's feed forward for the coding agent. Feedback is after point of generation, how do we like make that user harness part of that original image better with static analysis or review agents like adversarial agent review or logs or the browser with Chrome DevTools and stuff like that. And that way that you give that feedback. So then this purple part gets better and you're steering in this part and you get better at that too. Jonathan, this is a good time to invite your opinion from a CTO perspective. What are the things that you think AI builders need to be thinking about right now in this moment when it comes to harness engineering?
I think it's an active topic that people are trying to figure out, A, what it means, and then like what it means to them. So I think the basis of the harness is nothing too complicated. It's just like, how do I get the right context in place and how do I get all my upstream files in my company or from my workflows to be accessible by my coding agent while I'm working with it. Basically those are indexed for queries and those are indexed for the things that I want. I think that's like the first layer of what a good harness is. Where we've invested more time in what I think is ultimately, like if you asked where, where is this all going and like what is a harness going to be a year from now? I think we're moving towards being able to provision closed loop agents. These are agents that have a harness that can collect data about every run that they have and whether or not the behavior of it is like achieving, is verified as being like, you know, the achieved result of what's going to happen. And you're seeing this in like harnesses that are longer running, that are autonomous looping patterns, like your Slash Goal capabilities and agents and this kind of thing. Where we've been, you know, thinking about is like, how can we build harnesses that will gradually evolve towards being closed-loop systems. I don't know if that's the right decision for you and your company today, but that is, you know, how we're architecting and engineering our systems is to be able to, like, evolve towards closed-loop systems. And what that means is that we need to be able to create a log of every, every run that the agent has. We need to be able to evaluate whether it was good or bad and have evaluations in place. And we want to work towards training an LLM judge so that we have a log with enough evaluations. That we can actually determine whether or not the agent can run and be, be judged by an LLM judge that can then say whether or not it is, is indeed doing a good job.










