A large language model (LLM) generates language using patterns learned during training and the information supplied when it runs. It can explain concepts, draft text and propose code. Completing a task also depends on the intended outcome and how success will be checked. A coding assistant, for example, needs current project information and a way to apply and inspect changes. The model generates responses; the surrounding application provides access to files and tools. A useful explanation may require only one response. Work involving several actions needs a system that carries information and results between those actions.
Training, tokens and inference
Training adjusts a model's parameters, the numerical values that encode its learned patterns. Inference is the use of that trained model to process inputs and generate outputs. Text is represented through tokens, which need not be whole words. In typical autoregressive generation, the model predicts each next token using the available context and preceding output. These statistical relationships do not themselves establish that a statement corresponds to an external fact. NIST calls confidently expressed but erroneous or internally inconsistent content confabulation, also commonly called hallucination. NIST AI 600-1, section 2.2
An answer can therefore be coherent and useful while still needing verification. A proposed implementation may identify a workable design, but assessing it requires information about the project where it will be used. Reading the generated code answers different questions from applying it and checking its behaviour.
Define the outcome the assistant should achieve
Consider a hypothetical assignment: update a name-formatting function in a software repository so that it handles empty input, add relevant tests and prepare a release note. A repository contains the project's files and their version history. The assignment gives a direction, but the expected behaviour for empty input remains unspecified.
What should the function return? Which existing behaviour should remain compatible? Where do tests belong? Is the release note intended for users or maintainers? Answers to these questions let the assistant assess a proposed change against the requester's intention. Without them, several different implementations could appear reasonable.
Acceptance criteria are the conditions used to judge whether a task is complete. For this assignment, they could identify the expected empty-input result and the behaviour that must remain compatible. They give the assistant and reviewer a shared basis for assessment without prescribing every implementation step. Any unresolved requirement remains a question to answer before claiming that the change satisfies it.
Provide relevant information about the current project
General programming knowledge cannot establish this function's current implementation, the code that calls it or the project's test conventions. The assistant needs evidence from the task environment.
The model's context is the information supplied for its present inference. It can include instructions, conversation history, tool information and retrieved material. Context engineering concerns selecting and managing that information as work progresses. A repository being available on disk is different from its relevant contents being present in the model's context. Anthropic: Effective context engineering for AI agents
In the example, reading the function reveals its current behaviour. Examining a caller, meaning code that invokes the function, can expose a compatibility concern. Nearby tests show established conventions. Each provides evidence for a particular decision. Reading more files is useful when they resolve relevant uncertainty; the file count alone says little about whether the assistant understands the requested change.
Use tools to act and inspect the result
A tool gives an LLM application access to an external operation, such as reading a file or running a test command. Anthropic documents a model producing a structured request, application code or provider infrastructure executing it, and the result returning to the model. Generating the request and executing the operation are separate events. Anthropic: How tool use works
For the hypothetical repository task, different records would support different parts of a completion claim:
| Evidence | What it helps establish |
|---|---|
| A proposed patch, describing edits to files | The change being suggested |
| A repository diff, showing differences between file versions | The changes present in the inspected working copy |
| A record of a test command and its output | What was executed and what that execution reported |
| A release note compared with the diff | Whether the description corresponds to the change |
If tests are executed, their results need to be assessed against the code tested and the behaviour they exercise. A passing result does not establish every possible property of the function. A release note can accurately describe the intended change even when the implementation has a defect. A useful completion report connects each requested outcome to the available evidence and identifies anything unresolved.
What an agent harness adds
An LLM agent is an application that lets a model use tools over successive steps to pursue a task. Its harness is the surrounding software that manages those interactions, carries information between steps and provides the environment for external operations.
A model does not need a full agent harness to perform inference or provide a useful explanation. The additional machinery becomes relevant when work involves editing files, executing tests, retaining progress or handling a failed operation. These are responsibilities of the complete application, even when the model chooses which action to request next.
For the name-formatting change, the application could return a failed test result to the model for further investigation. The next decision would then use that observed result alongside the task requirements and relevant code. If the expected empty-input behaviour remained unspecified, the test result alone would not resolve that requirement.