Agent = LLM + Harness: Core Architecture and How Agents Execute

    An agent is not the large language model alone. This article explains the LLM-plus-harness architecture, the observe–reason–act loop, termination rules, the difference between tools and skills, and three principles for building reliable agents.

    1. What an Agent Really Is: A Model Plus an Execution Framework

    A common mistake when discussing agents is to treat the agent as the large language model itself. In practice, the model only “thinks.” Turning that thinking into real actions requires an execution framework wrapped around the model. The industry often calls this framework a harness.

    Their responsibilities can be split clearly:

    • LLM (large language model): Handles semantic understanding, reasoning, and planning the next action. It is a stateless reasoning engine. By itself it cannot read or write files, run commands, or sense changes in the external environment.
    • Harness (execution framework): Manages context, registers and dispatches tools, drives the loop, writes results back, enforces permissions, and decides when to stop. It is the “operating system” between the model and the real environment.

    A simplified pseudocode sketch of this architecture:

    1. while not done:
    2. observation = harness.read_environment()
    3. decision = llm.reason(context, observation)
    4. action = harness.execute(decision)
    5. harness.update_context(action, feedback)
    6. done = harness.check_termination()

    The model answers “what to do next.” The framework answers “how to do it, and when to stop.” Neither is optional. Without an LLM, the framework is only a fixed automation script. Without a harness, the LLM is only a fluent conversational system that cannot act.

    2. The Core Execution Loop: Observe–Reason–Act

    An agent runs as a continuous perceive–decide–act loop. Each stage has a distinct job.

    2.1 Observe: Read Environment Feedback

    Observe translates the state of the outside world into information the model can use. Typical observations include:

    • Test results: Unit-test pass rates and stack traces from failed assertions
    • File contents: Source snippets, configuration files, and logs
    • API responses: Status codes, response bodies, and error messages
    • Command output: Build logs, deployment status, and system metrics

    The quality of this stage sets the agent’s ceiling. Noisy feedback pulls the model toward irrelevant detail. Feedback that is too thin leads to wrong decisions because the model lacks information. In practice, the framework usually truncates, summarizes, and prioritizes observations so the most diagnostic information enters the context.

    2.2 Reason: Decide the Next Step from Observations

    Reason is where the LLM does its real work. Using history and the current observation, the model performs three kinds of reasoning:

    • Diagnosis: Locate the root cause in error logs—for example, whether a failed test comes from a null pointer, a type mismatch, or a missing dependency
    • Planning: Weigh possible actions, such as editing code directly, adding a test, or reading documentation first to confirm expected behavior
    • Action generation: Emit a structured instruction, usually “which tool to call and with what arguments,” such as edit_file(path, old_block, new_block)

    Reasoning does not start from scratch every turn. The framework keeps summaries of earlier observations and actions in context so the model can make incremental decisions from the trajectory and avoid repeating work.

    2.3 Act: Carry Out the Decision Through Tools

    Act is owned by the framework. It routes the model’s instruction to the matching tool—file I/O, command execution, code search, API calls, and so on—then feeds the result back as a new observation for the next iteration.

    A typical debugging path looks like this:

    1. The agent runs unit tests. Observe captures the failure and the stack trace.
    2. Reason analyzes the stack, identifies a suspect function, and plans to read that function before deciding how to change it.
    3. Act calls a file-read tool. The source returns as a new observation.
    4. Reason judges the root cause and produces a code change.
    5. Act writes the change and reruns the tests.
    6. Observe sees the tests pass. The loop converges and the task is done.

    This cycle—find a failure, read the log, locate the cause, change the code, and recheck—is what makes an agent more useful than a single-turn chat application. It can move closer to a goal over multiple turns without a person stepping in each time.

    3. When the Loop Stops

    A robust agent framework needs clear stop conditions. Otherwise the loop can spin forever. Common checks fall into three groups:

    • Task complete: The goal is met—for example, all tests pass, a file is generated, or the output meets acceptance criteria.
    • Cannot solve: After several attempts the model still does not converge, or it judges that the problem is beyond its capability. It should exit cleanly and report progress so far plus the reason for failure, so a person can continue.
    • Execution limits: A maximum iteration count, token budget, or time budget is reached. This is a backstop against runaway resource use.

    Knowing when to give up matters as much as knowing how to persist. A good design sets a reasonable budget for each turn and, on exit, produces a structured report: steps completed, blocking points, and suggested next actions.

    4. Tools and Skills: Capabilities at Different Granularity

    Tooling should be organized at two levels: tools and skills. They do different jobs.

    • Tools are atomic operations. They are the smallest, most stable units—for example, “read a file,” “run a command,” or “search code.” Once defined, the calling interface stays stable, and the framework registers and dispatches them uniformly.
    • Skills are composed strategies. They orchestrate several tool calls into a method for a class of tasks, often with prompt templates and known good practices. “Fix a failing test,” for instance, may combine log parsing, code location, editing, and regression checks.

    The relationship is similar to operating-system calls versus higher-level packages. Tools keep atomic capabilities stable and composable. Skills keep complex tasks consistent and efficient. This split yields three engineering benefits:

    1. Reuse: Atomic tools can be combined across skills instead of being reimplemented.
    2. Maintainability: Tool interfaces stay stable while skill strategies can evolve on their own.
    3. Observability: The framework logs at the tool-call layer, which makes replay and debugging easier.

    5. Three Principles for Production Agents

    Given the mechanisms above, production agent applications should follow three principles:

    1. Control context quality. Filter and compress every observation. Send the model only what the current decision needs. This is the first lever for cost and accuracy.
    2. Prefer fewer, sharper tools. Too many tools dilute the model’s choice accuracy. Favor tools with clear semantics, well-defined boundaries, and diagnosable error messages.
    3. Add layered safeguards. Iteration caps, budget controls, and confirmation for sensitive actions keep autonomous execution within safe bounds.

    Conclusion

    “Agent = LLM + Harness” captures the architecture: the model’s reasoning is the engine, and the execution framework is the chassis and drivetrain. The observe–reason–act loop is how power is transmitted. Tools and skills are the wheels that touch the real world. Termination conditions are the brakes. Understanding this mechanism—whether you are evaluating an agent product or building one—puts technical judgment on a firmer footing.