The Agent Harness
The system built around the AI that makes it actually useful
An AI model on its own only turns words into more words. A harness is everything wrapped around it that lets it use tools, follow a plan, remember things, and know when to stop. Once you understand a harness, you understand why some AI tools feel like a real assistant and others feel like a chat box that forgets everything.
What a harness actually is
An AI model by itself does one thing only. You give it words, it gives you back words. It cannot open your inbox, check today's date, remember what you talked about yesterday, or stop itself when it is going in the wrong direction. A harness is everything built around that model so it can actually get work done: its instructions, the tools it is allowed to use, the loop that keeps it going, and the rules that keep it in check.
Why the model alone falls short
If you have ever chatted with a plain AI model and closed the tab, you already felt this. The moment you close it, everything is gone. Ask it to "keep checking my emails and reply when needed" and it cannot, because it has no way to act on its own, no memory of what it already did, and no sense of when the job is finished.
- No memory once the chat window closes
- No way to act in the real world, only to talk
- No plan that survives longer than one reply
- No rule for knowing when a task is actually done
- No record of what it already tried before
The pieces of a harness
- The system prompt. Standing instructions that tell the AI who it is and how to behave for the whole job, not just one message.
- Tools. The actual actions the AI is allowed to take, like searching a page, reading a spreadsheet, or sending a draft message.
- The loop. A repeating cycle: decide the next small step, do it, check the result, then decide the next step again, instead of trying to do everything in one giant answer.
- Guardrails. Limits and checks that stop the AI from doing something unsafe, going off task, or simply running forever.
A system prompt on its own is still just words. What actually changes the outcome is giving the AI tools to act with, a loop that lets it work step by step instead of guessing everything at once, and guardrails so that loop has a reason to stop.
Tools matter because most real work is not writing, it is doing: opening a file, checking a price, updating a row in a sheet. Without a tool for that specific action, the AI can only describe what it would do, never actually do it.
The loop matters because a big task rarely fits in one answer. A harness usually breaks a job into a list of small steps, works through one step at a time, checks whether that step actually worked, and only then moves to the next one. That is very different from asking for everything in a single message and hoping it all comes back right.
Guardrails matter because a loop with no limit does not know when to stop. Good guardrails include a clear finish line for the task, a cap on how many steps or how much time it can take, and rules about what it must never do, such as sending a message or spending money without asking first.
What one run actually looks like
The word "loop" makes this sound abstract. Ask a harness to chase three unpaid clients and here is what actually happens, in order.
- You ask. Chase the three clients who have not paid.
- It plans. It works out that it needs the invoice list before it can do anything.
- It calls a tool. Read the invoices sheet.
- The result comes back and is added to everything it can see. It stays there for the rest of the run.
- It reads the whole pile again. Your request, its own plan, and all of that tool output.
- It stops. The guardrail says drafts only, so it hands you three drafts instead of sending them.
Two things worth noticing: the model was used six times, not once, and each pass is billed. And the window got fuller at every step, mostly because of something you never typed.
Working memory: what the AI can see right now
During one run, the AI has a working memory: everything it can currently see, including your instructions, the tool results it just got back, and whatever it has done so far in this task. This is powerful, but it is temporary. The instant the run ends, working memory is emptied. Nothing survives on its own unless it was written down somewhere outside that run.
Why some things have to be saved outside the run
Because working memory disappears, anything worth keeping, a client's preferences, a finished task, a lesson learned, has to be written to storage that lives outside the run, like a file, a database, or a saved note. If it is not written down somewhere, it is lost the moment the chat or the job ends, even if the AI clearly understood it a minute ago.
| Memory type | What it holds | Freelancer example |
|---|---|---|
| Procedural | How to do something: a saved process or checklist | A saved skill file that always formats a follow-up email the same way |
| Semantic | Facts that stay true | A client profile: their timezone, their rate, their preferred tone |
| Episodic | Things that happened, with a date | A log showing you already followed up with this client last Tuesday |
None of these three live in working memory by default. They sit in storage, and the harness pulls the relevant piece into working memory only when it is needed for the task at hand.
A freelancer example
Say you build a simple assistant to help manage outreach to leads. The system prompt tells it to write warm, short follow-ups in your voice. Its tools let it read your leads sheet and draft a message. The loop has it work through your list one lead at a time, checking each draft before moving to the next. Guardrails stop it from actually sending anything without your approval. Procedural memory holds your saved follow-up format. Semantic memory holds each client's basic facts. Episodic memory tells it who was already contacted this week, so nobody gets a duplicate message.
Mistakes worth watching for
- Assuming a chat "remembers" things it was never told to save anywhere
- Giving an AI a big task with no clear stop rule, so it never really finishes
- Treating every fact the same, instead of separating what is a process, what is a fact, and what actually happened
- Handing over a tool with no limit on what it can do with it, like sending messages with no approval step
More words
- Prompt Engineering
Writing the instruction so the answer comes back right
- Context Engineering
Choosing what the AI gets to see while it answers
- Loop Engineering
Teaching an AI to check on its own, no prompt needed