AI Run Lab

All chapters

What runs around an agent?

A customer asks whether order R17 can be returned. The model can propose a next step. The surrounding program controls which records it can read, what enters the next request and when the work ends.

Open this chapter with experiments and audio

Where does a model end and a harness begin?

Imagine storing two things separately. The first is a checkpoint, a collection of trained numbers. The second is an application that builds requests, offers functions, stores their results and decides whether to call the model again. Developers often call this surrounding execution software an agent harness. Different projects draw its boundary in different places. Here it includes the loop, the context builder, tool permissions, execution limits and the event log.

One call to the model might produce text resembling an order lookup. The application has to interpret the proposal, check the allowed tool and arguments, run the lookup and put its result into the following request. If the program only displays the text, the order database has supplied no evidence. You can check this by looking for the actual return value in the event log.

A fixed workflow can call an order lookup every time. An agent can decide from the question and previous observations whether to call it, request missing information or answer. Both can run the same frozen checkpoint. Inspect who chooses the next operation when the order number is missing.

Anthropic · Building effective agents

Which information survives the next call?

The current model call can use only information available through its inputs and parameters. The application might retain an entire conversation in storage while supplying only three recent messages to the model. An order number can therefore exist in the database or chat history and still be absent from this request.

Suppose a teaching service reserves 4,000 token positions for input and generated output together. Its instructions take 600, the tool definitions 500 and the dialogue 1,800. Reserving 500 for the reply leaves 600 for order records. An 850-token record exceeds that budget by 250. Keeping the order ID, delivery date, policy version and item exceptions is a content-selection decision. A shorter result can be wrong if it drops the exception that applies.

How could you tell whether a missing fact was forgotten or never supplied?

Compare the saved order record, the tool response and the exact input assembled for the next call. If the exception appears in the first two and disappears in the third, investigate the context builder. If it is also in the third, inspect how the model used the evidence.

Follow a retrieved passage into a request · Inspect the memory used in the miniature model

Run an agent loop one decision at a time

Start with order R17 and two decisions. The first decision can ask for a lookup. The second can use what came back. Predict what happens with a budget of one. A real language model can propose different actions on different runs. This simulator uses a small written decision rule so that you can inspect the harness independently. All order records are fictional.

Change one condition at a time. R52 is outside the return window. R09 has no record. Denying the lookup leaves the delivery date unknown. Follow the last event on each run. An observed refusal, a missing record and running out of steps have different causes even if none produces an eligibility decision. This tool reads a local record. It never creates a return.

What counts as a successful outcome?

“You can return it” and “I have created the return” make different claims. The first needs a matched order record and an applicable policy. The second also needs a successful state change in the returns system. A grader that accepts either sentence as a success would reward unsupported confirmations.

Design a test with three initial states. In the first, an eligible order has no return. In the second, that order already has one. In the third, the order is unknown. For a request to create a return, check the final record count, the order it refers to and the response shown to the customer. If a write times out, look for a stored receipt before retrying. A retried request with the same identity should resolve to the same operation.

Now test reliability. If a stochastic system succeeded independently with probability 0.8 on every attempt, the chance of succeeding three times in succession would be 0.8³ = 0.512. Real attempts can share failure causes. Run repeated trials on held-out cases and keep the individual outcomes. The τ-bench authors compare final database states and examine consistency over multiple trials.

Yao et al. · τ-bench · Anthropic · Demystifying evals for AI agents