cleandataengineering.aiAgent Harness, drawn simply
You are here: Real flows › 6 · Someone was hurt

Agent Harness Tutorial · Real flows

Flow 6: Someone was hurt

Route: Escalate. Turn 1: 357 ms · Turn 2: 201 ms · Turn 3: 476 ms · 0 model calls in all three.

Open: Entra IDEntraIDOpen: PostgreSQLPostgresstateOpen: DBOSDBOSwaitsOpen: APIM → modelAPIM→ modelOpen: Claims (MCP)ClaimsMCPTHE BOXES IT PASSEDWHAT HAPPENEDBEFORE THE MESSAGEOpen: Sign-in with Microsoft EntraSign-in with Microsoft Entrazoom in ›1Rohan signs in with MicrosoftEntra ID (code flow + PKCE); thetoken stays in the pageOpen: Page opens: load the conversationPage opens: load the conversationzoom in ›2GET /opening: the newestcheckpoint is resumed if under24 h old, else a newconversationTURN 1Rohan: "My passenger was injured when the bus hit us, she went to hospital."Open: Front doorFront doorzoom in ›3body ≤ 8 KiB · token verified →PH-1001 · kill switch onOpen: Delivery ledgerDelivery ledgerzoom in ›4new row PH-1001:<delivery id>,in_flight, expires in 600 sOpen: Anything waiting?Anything waiting?zoom in ›5nothing pendingOpen: RouterRouterzoom in ›6rule injury-reported ("injured","hospital"; "nobody was hurt"would not match)Open: DBOS hand-offDBOS hand-offzoom in ›7DBOS escalation.wait started:E-4A818C40 · QUEUED · 116 msOpen: After-loop rulesAfter-loop ruleszoom in ›8no Tier-2 rule fires · promisegate: passOpen: Before-reply checkBefore-reply checkzoom in ›9no_promise_of_cover,no_pii_echo, money_in_rupees:passOpen: Save and settleSave and settlezoom in ›10pending_escalation_id saved ·HTTP 202 · 357 msReply: "I have passed this to a colleague in our claims team. Your reference is E-4A818C40,and they will pick this up here."TURN 2Rohan: "Can you register the claim now?"Open: Front doorFront doorzoom in ›11body ≤ 8 KiB · token verified →PH-1001 · kill switch onOpen: Delivery ledgerDelivery ledgerzoom in ›12new row PH-1001:<delivery id>,in_flight, expires in 600 sOpen: Anything waiting?Anything waiting?zoom in ›13E-4A818C40 still QUEUED: hold ·no router, no model · 201 msOpen: Save and settleSave and settlezoom in ›14HTTP 202Reply: "This is with a colleague in our claims team — your reference is E-4A818C40. Theywill answer you here."ASHA AT THE DESKOpen: Asha at the desk (/ops)Asha at the desk (/ops)zoom in ›15GET /ops/escalations: tier 1,injury-reported, 2 concerns,"nothing done yet"Open: Asha at the desk (/ops)Asha at the desk (/ops)zoom in ›16POST/ops/escalations/E-4A818C40/resolve· 200 · 313 msTURN 3Rohan: "Thanks. What's the status of claim CLM-010007?"Open: Front doorFront doorzoom in ›17body ≤ 8 KiB · token verified →PH-1001 · kill switch onOpen: Delivery ledgerDelivery ledgerzoom in ›18new row PH-1001:<delivery id>,in_flight, expires in 600 sOpen: Anything waiting?Anything waiting?zoom in ›19E-4A818C40 resolved: carry onOpen: RouterRouterzoom in ›20claim_status + one reference:DirectOpen: Direct: tool read + templateDirect: tool read + templatezoom in ›21get_claim · 246 ms · templateOpen: After-loop rulesAfter-loop ruleszoom in ›22no Tier-2 rule firesOpen: Before-reply checkBefore-reply checkzoom in ›23no_promise_of_cover,no_pii_echo, money_in_rupees:passOpen: Save and settleSave and settlezoom in ›24checkpoint saved · ledger row →answeredReply: "Claim CLM-010007 is under assessment. The assessor decides it; I cannot say whatthey will decide."
Left: the boxes this message really passed, in order; each opens its design page. Middle: the outside systems each box called, as dots on five lanes (Entra ID, PostgreSQL, DBOS, APIM in front of the model, the claims system over MCP); click a lane head to open it. Right: what happened. Grey boxes are checks, the dark box is the model, a crossed box is where something was blocked.
What it teachesA person really takes over, and the hand-off carries facts, not a model's summary.

Want every detail? The long version is in the Series: this flow with real spans and payloads.