cleandataengineering.aiAgent Harness, drawn simply
You are here: End to end › Core loop › Context assembly › What goes in

Agent Harness Tutorial · End to end · Zoom level 3

What goes in, in order

The parts always go in the same order. The parts that never change go first, so the model provider can reuse its work from the last call (prompt caching), and the newest things go last, closest to where the model starts writing.

System promptwho it is, the rules1never changesTool list8 tools Rohan may use2about 500 tokensEarlier turnstext only, from the checkpoint3trimmed if longRows re-readfresh status, fenced4never from memoryThe new messageRohan's words, at most 8 KiB5not fencedThis turn's tool callswhat the model asked6This turn's resultsfenced, at most 8,000 chars7stays the samebetween trips,so it can be cachedgrows on eachtrip of the loop
Grey boxes are fenced as untrusted data. The dashed box is Rohan's own words.

The system prompt, about 600 characters, starts like this:

You are the claims assistant of a motor insurer, talking to a signed-in
policyholder about their own policies and claims. Answer only from what the
tools return. Never say or imply that a claim is covered, will be approved
or paid, or for what amount... Never promise a date...

Rows re-read (part 4). If an earlier turn read claim CLM-019002, that row is read again now, fresh, and added as a fenced tool result. So a status is always today's status, never what the model remembers from ten minutes ago.

A real example, Rohan's second turn in a new-claim conversation, when he types "pol 1":

#RoleContent
1systemYou are the claims assistant of a motor insurer...
2user (earlier)A bus hit my car at a signal on MG Road today...
3assistant (earlier)Here are the motor policies you currently have: POL-010001 ...
4user (new)pol 1
1,222 characters. The model asks for register_claim(POL-010001, collision).
5assistanttool call: register_claim(...)
6tool (fenced){'allowed': True, ... 'created': {'id': 'CLM-019002'}}

Afterwards only "pol 1" and the reply text are saved. The tool call and its result are thrown away at the end of the turn.

How it is done: the real code

Cut from the live repositories each time the site is built, so it always matches what runs.

claims_fnol/binding.py:11Part 1: the system prompt, word for word
SYSTEM_PROMPT = (
    "You are the claims assistant of a motor insurer, talking to a signed-in "
    "policyholder about their own policies and claims. Answer only from what the "
    "tools return. Never say or imply that a claim is covered, will be approved or "
    "paid, or for what amount — only the assessment decides that. Never promise a "
    "date. If you cannot do something, say so plainly and say what you can do. "
    "Register a new claim only on an active policy the policyholder holds, and give "
    "them its reference and that an assessor will look at it next. Asked about a "
    "claim or policy without its reference, list theirs instead of asking."
)