Agent Harness Tutorial · End to end
One message, end to end
This is the main map. It follows one message from Rohan, from the moment it arrives to the moment the reply goes back. Every box is a door: click it to open a page that draws what is inside that box.
Goes inRohan's message and his sign-in token
What happensFront door, router, then (on the agent path) a loop of context, model and tools, with a check at eight points
Comes outA checked reply, a saved conversation, and a trace we can score
Read it in three bands.
- Before the loop. The front door proves who is asking. The router then picks a path. Simple, safe questions get a template answer with no model at all. Things the assistant must refuse, or must hand to a person, are dealt with here too.
- The loop. Everything else goes round the loop. Each trip: assemble the context, check it, call the model, read the answer. If the model asks for tools, check the request, call the tool, check the result, and go round again. If it answers in words, check the words and leave the loop.
- After the loop. A last set of rules and one more check on the reply text, then save the conversation and send the reply.
Three things sit beside the road and are used all the way along: PostgreSQL for state and memory, DBOS for work that has to wait for a person, and the trace that every box writes to.
Two real examples"What's the status of claim CLM-019002?" goes front door, router, Direct, before-reply check, save: 104 ms and no model call. "What is the status of my claim?" has no claim number, so it goes round the loop twice: the first trip asks the tool
list_claims, the second writes the answer. 7.1 seconds.Try it yourselfOpen the Agent Harness Simulator. Type a message as Rohan and watch the same journey as numbered steps on a map: every system it touches, every check that fires, the code, the variables, and the JSON to and from the model. Then break it (switch the agent off, plant an injection, take the model down) and see what reaches App Insights and Prometheus.
Want every detail? The long version is in the Series: the flow in parts, with real spans.
Look inside
The end-to-end journey: 78 stepsEvery action from the chat window opening to the next release, in 14 parts: one long table.Front doorProve who is asking; handle a repeated message once.RouterRules pick one of four paths before any model runs.The core loopAsk the model, run the tools it asks for, go round again.Checks at every pointEight check points, from the front door to the last word of the reply.State and memoryThe process remembers nothing; PostgreSQL remembers everything that matters.DBOS: work that waitsPause for a person for hours, survive a restart, never pay twice.Eval: proving it worksOne record of every turn, read at three speeds.