You’ve just understood Agents. Now meet the Harness.
From the publisher’s feed, collected in the ZeroLabs newsroom.
The world of AI churns out a new concept almost every day. You may have just wrapped your head around “Agent,” and now suddenly “Harness” has become the cool kid in town.What is a “Harness” anyway? How is it different from an “Agent”? And why is everyone talking about it?Let’s take a look at it.1. Starting with Our Old Friend: The AgentMany agree that an Agent is an AI system that can independently plan, reason, and use external tools to accomplish multi-step goals on behalf of a user.The most common implementation is a loop between an LLM, a set of tools (in a broad sense), and user input. It works like this:Input: A user sends a request, such as “Help me buy pearl earrings.” The system registers the message, enriches it with internal data, and passes the whole bundle to the LLM as a context prompt.Reasoning: The LLM reasons over the text and decides what to do: call a search tool to look for pearl earrings for sale, or ask the user, “What style of pearl earrings do you prefer?” Either way, the LLM outputs a text response, typically shaped into a structured format such as a tool-call instruction.Tool execution: The system parses the response. If it is a question for the user, the system displays it. If it is a tool-use instruction, the system executes it. In this case, that means running a web search for “earrings”.Feedback: The system captures the search results (or user reply), relays them back into the context, and the loop restarts until the goal is accomplished.2. Two Lenses on the Loop: Logical vs. EngineeringTo understand what a harness is, it helps to look at this agent loop through two distinct lenses:The Logical LensSeen through the logical lens, the loop is simply: input, reasoning, plan, action, result, over and over until the task is done. This is the Agent we have just met: the decision-making logic that plans and acts on behalf of the user. Nothing new here, so let’s quickly put on the other pair of glasses.The Engineering LensIf we look at the loop through the classic digital infrastructure triad of Compute, Storage, and Network, the reality is quite different:The system captures human input and sends it across the network via HTTP API calls to an LLM endpoint.It parses the response, manages storage of data, e.g. sessions and states, and spins up local processes (Python, Node.js, Bash) or calls external APIs to run the requested tools.Once the action finishes, the output data is captured, merged with historical data, and transmitted back over the network to the LLM.The LLM only ever receives and produces tokens, most often in text. It is the surrounding system that does all the heavy lifting: managing state, parsing instructions, executing tools, enforcing boundaries, and keeping the loop alive.In short: An Agent is the reasoning, decision-making entity. A Harness is the programmatic and infrastructural scaffolding around the LLM that enables an agent to operate effectively, reliably, and securely.3. Why Harness Now?If a harness is simply the engineering layer, why has it suddenly become the new darling of AI engineering?A few months ago, standard practice was to delegate only well-scoped tasks to specialized agents. Developers handcrafted bespoke agents for specific tasks. The rationale was simple: LLMs struggled with complex, open-ended workflows, so decomposing work into specialized, single-purpose agents was the only way to get reliable success rates.However, LLM reasoning and tool-calling capabilities have progressed dramatically. At the same time, users increasingly expect agentic systems to handle diverse, open-ended workflows, from automating enterprise operations to full-stack code generation.As the demand grows, building a brand-new, hardcoded agent for every single task does not scale. Instead, modern systems rely on a robust Harness to solve three foundational engineering challenges: Quality, Security, and Generalizability.4. The Three Core Engineering ChallengesChallenge 1: Quality (The Context Degradation Problem)Most of us have experienced a chatbot becoming “forgetful” as a conversation grows long. When an LLM is fed with too much text, its reasoning quality decays, a phenomenon known as context degradation.An agent’s context must contain everything the LLM needs to make decisions:State & History: Past events and conversation turns so the stateless LLM can reconstruct what happened.Tool Definitions: Detailed schemas and descriptions so the LLM knows which tools exist and how to call them.Business Logic & Guidance: Step-by-step instructions, constraints, and operating principles.Packed together, a single context can easily exceed 100,000 tokens, roughly the length of an entire issue of The New Yorker. Worse, context grows with every turn of the loop. Even though modern LLMs advertise massive context windows as long as War and Peace, research shows that real-world reasoning degrades long before the context length reaches those technical ceilings [see references].So, too little context, and the LLM lacks the facts to make the right decision; too much, and it gets lost in irrelevant noise. It is the harness’s job to keep the context just right, and it does so with three primary techniques:The most straightforward technique for context management is Context Compaction. It uses separate LLM calls to summarize a long context into a shorter one. This technique can effectively shorten the length of the history data in the context. Modern harnesses usually trigger context compaction automatically once the context length hits a certain threshold, e.g. 80% of the context window’s capacity.Instead of reducing the length of a given context, engineers also created smart ways to prevent context window from growing too big. This is Progressive Loading. Sometimes called progressive disclosure, it means that the initial context window only contains a concise index of all the specific business logic and tools, and the details are only loaded when the LLM decides that it is necessary to do so given the task at hand. This technique keeps the initial context window lean rather than jamming everything upfront. It can not only effectively reduce the context length, but can also keep the agent focused on the current tasks without getting distracted by irrelevant logics.Talking about distraction, the most effective technique to combat distraction is Context Isolation. It means that the main agent spins up a subagent with a fresh context window and delegates a sub-task to it. The sub-agent will mind its own business and return to the main agent with the results once it has finished. In this way, the sub-agent can focus on the sub-task which improves its success rate. The main agent will directly receive the final answer from the sub-agent, without its context window being cluttered with all the intermediate steps of solving the sub-task.Challenge 2: Security & SandboxingAnyone who has played with a terminal knows how powerful and dangerous command line tools can be: one casual mistake is enough to wipe out an entire hard drive. Yet nowadays we routinely equip agents with exactly those tools, because they are essential for complex tasks such as code generation. So how do we make sure our data survives a clumsy mistake (or a hijacked decision) of the agent? The answer is sandboxing, and it is the second responsibility of the harness. A sandbox draws a safe zone around the agent, typically with three kinds of boundaries:The first boundary is Filesystem Isolation. The agent gets a designated workspace, such as a project folder or a temporary directory, where it can read and write freely. Everything else, from your ~/.ssh keys to your credentials and system files, simply stays out of reach. A clumsy rm -rf can then only ruin the agent’s own little world, not your lifetime of data.The second is Network Control. By default, the sandboxed process has no free access to the internet: only approved API endpoints and connections explicitly allowed by the user can get through. So even if the agent is tricked by a malicious instruction hidden in some web page, it cannot quietly ship your secrets off to an unknown server.The third is Compute Constraint. The sandbox caps what a process can consume (execution timeouts, memory limits) so that a runaway loop cannot freeze or exhaust your machine, and it strips away the privileges a process does not need, so that even a compromised run cannot act beyond what it was granted.Challenge 3: GeneralizabilityFinally, my favorite one. I believe the biggest value of the harness is that it decouples the business logic from the engineering effort.Building an agent with LangGraph or Google’s Agent Development Kit (ADK) is ultimately a developer’s task. Yet if you have ever done it, you know that a good 80% of the work is not coding at all. It is understanding the business logic, and translating it into a suitable agent structure with the right prompts. And every new variation of the task calls for another round of this hand-crafting.The harness changes that division of labor. The engineering effort (the loop, the context management, the sandboxing, the delegation machinery) is crystallized once and for all inside the harness. The business logic, meanwhile, stays with the people who actually own it: the domain specialists, who simply write down their knowledge and instructions in plain markdown files. At run time, the main agent reads those files and designs the agentic flow on the fly: breaking the task into sub-tasks, delegating them to sub-agents, and calling the right tools, all tailored to whatever variation of the task it is handed. No developer needs to code those flows by hand anymore.You have probably already met those markdown files under their product names: “skills” and “plugins”. They are precisely the way for business people to customize a generic harness for their specific tasks, no Python required.5. When to Use What: Specialized Agent vs. Generic HarnessIs the choice really “Agent vs. Harness”?Not strictly, since they are not competing alternatives. But if we frame the question as: “When should we build a custom, hardcoded specialized agent graph vs. using a general harness?”, the trade-off becomes clear.It comes down to frequency, variability, and governance:High Variability → Harness:Consider a personal AI assistant. In a single day, tasks might range from parsing expense receipts to drafting slide outlines or researching distributed systems. Building a dedicated bespoke agent for every life scenario is impossible. A generic harness provides an all-in-one environment where the agent can run bash, query APIs, and load custom skills on demand. Because the user directly benefits and oversees the agent, they accept the flexibility.Low Variability & Strict Governance → Specialized Agent:Consider a corporate compliance audit or HR onboarding pipeline. Every employee must undergo the exact same multi-step verification process, requiring strict legal checks and explicit sign-offs. Here, variability is low and compliance risk is high. Hardcoding a specialized agent graph (e.g., using LangGraph or ADK) ensures a fixed, auditable control flow and centralized governance that cannot be bypassed.Final wordsSo, what is a harness? It is the engineering scaffolding around the LLM: it keeps the context just right so the agent stays sharp, sandboxes the powerful tools so the agent stays harmless, and loads the business logic on the fly so the agent can turn its hand to almost anything.The next time someone asks you “agent or harness?”, you can smile: it is a fake question with a real answer. You don’t choose between the two; you choose where on the spectrum your task lives, and how much of the engineering you would rather inherit than rebuild.One thing does not change with that choice, though. Whether you hand-craft an agent graph in a framework or write a skill for a generic harness, the hardest part of the work stays the same: understanding the business logic deeply enough to translate it faithfully into something an agent can follow. The harness does not make that translation effort disappear; it changes who can do it, and in what language: markdown instead of Python. What that translation looks like in practice, and how to write a good skill, is a story for the next article. Bye for now.ReferencesLiu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). Lost in the middle: How language models use long contexts. Transactions of the Association for Computational Linguistics, 12. https://arxiv.org/abs/2307.03172 (Finding: models retrieve information far worse when relevant facts sit in the middle of a prompt rather than at the edges.)Levy, M., Jacoby, A., & Goldberg, Y. (2024). Same task, more tokens: The impact of input length on the reasoning performance of large language models. Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL 2024). https://arxiv.org/abs/2402.14848 (Finding: reasoning capability decays at input lengths far shorter than advertised maximums.)Hsieh, C.-P., Sun, S., Kriman, S., Acharya, S., Rekesh, D., Jia, F., Zhang, Y., & Ginsburg, B. (2024). RULER: What’s the real context size of your long-context language models? First Conference on Language Modeling (COLM 2024). https://arxiv.org/abs/2404.06654 (Finding: only half of the models claiming 32K context windows performed acceptably at 32K.)Modarressi, A., Deilamsalehy, H., Dernoncourt, F., Bui, T., Rossi, R. A., Yoon, S., & Schütze, H. (2025). NoLiMa: Long-context evaluation beyond literal matching. Proceedings of the 42nd International Conference on Machine Learning (ICML 2025). https://arxiv.org/abs/2502.05167 (Finding: 11 of 13 models claiming 128K+ contexts fell below half their short-context baseline by 32K tokens; even GPT-4o dropped from 99.3% to 69.7%.)You’ve just understood Agents. Now meet the Harness. was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.