cleandataengineering.aiAgent Harness, drawn simply
You are here: Real flows › 8 · Payout above the limit, approved

Agent Harness Tutorial · Real flows

Flow 8: Payout above the limit, approved

Route: Agentic + wait. Turn 1: 1 model call · $0.00014 · Turn 2: 208 ms, no model.

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: "Please release the payment for claim CLM-010004, the engine fire claim."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 ›6payout_request: AgenticOpen: Consent: what his words allowConsent: what his words allowzoom in ›7request_payout:CLM-010004TRIP 1Open: Context assemblyContext assemblyzoom in ›8Open: Pre-model checkPre-model checkzoom in ›9no_known_injection: passOpen: Model callModel callzoom in ›10766 ms · 662 in / 52 out · APIM:allow-list, rate limit, ContentSafety passOpen: Read the answerRead the answerzoom in ›11wants a toolOpen: Pre-tool checkPre-tool checkzoom in ›12consent · passOpen: Tool callTool callzoom in ›13request_payout → DBOS approvalapr_504cba8241c5Open: Post-tool checkPost-tool checkzoom in ›14fenced ·no_instructions_in_result: passOpen: DBOS approvalDBOS approvalzoom in ›15assess: ₹25,001 is above ₹25,000→ WAITING; turn endsNeedsApprovalOpen: After-loop rulesAfter-loop ruleszoom in ›16no Tier-2 rule fires · promisegate: passOpen: Before-reply checkBefore-reply checkzoom in ›17no_promise_of_cover,no_pii_echo, money_in_rupees:passOpen: Save and settleSave and settlezoom in ›18pending_approval_id saved · HTTP202 · 1,258 msReply: "I have sent this payout to a claims handler to authorise ... Nothing has been paidyet."ASHA AT THE DESKOpen: Asha at the desk (/ops)Asha at the desk (/ops)zoom in ›19GET /ops/approvals · POST…/apr_504cba8241c5/decide{granted: true} · 536 msOpen: DBOS approvalDBOS approvalzoom in ›20a ballot arrives: CARRYING_OUT ·re-read the claim (unchanged)Open: Tool callTool callzoom in ›21issue_payout under the grantedidentity · irreversible · 44 ms· claims system checks theapprovals rowOpen: DBOS approvalDBOS approvalzoom in ›22DONETURN 2Rohan: "Has my payout for CLM-010004 been made?"Open: Front doorFront doorzoom in ›23body ≤ 8 KiB · token verified →PH-1001 · kill switch onOpen: Delivery ledgerDelivery ledgerzoom in ›24new row PH-1001:<delivery id>,in_flight, expires in 600 sOpen: Anything waiting?Anything waiting?zoom in ›25approval resumed: done · 0 ms ·no router, no modelOpen: Save and settleSave and settlezoom in ›26pending cleared · 208 msReply: "A claims handler authorised that payout, and it has been made to the account on yourpolicy."A FRESH CONVERSATIONRohan: "What's the status of claim CLM-010004?"Open: Front doorFront doorzoom in ›27body ≤ 8 KiB · token verified →PH-1001 · kill switch onOpen: Delivery ledgerDelivery ledgerzoom in ›28new row PH-1001:<delivery id>,in_flight, expires in 600 sOpen: Anything waiting?Anything waiting?zoom in ›29nothing pendingOpen: RouterRouterzoom in ›30claim_status + one reference:DirectOpen: Direct: tool read + templateDirect: tool read + templatezoom in ›31get_claim · template for "paid"· 599 msOpen: After-loop rulesAfter-loop ruleszoom in ›32no Tier-2 rule firesOpen: Before-reply checkBefore-reply checkzoom in ›33no_promise_of_cover,no_pii_echo, money_in_rupees:passOpen: Save and settleSave and settlezoom in ›34checkpoint saved · ledger row →answeredReply: "Claim CLM-010004 is paid: ₹25,001 went to the account on your policy."
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 teachesdecided_by records Asha's Entra id. The claims system itself checks that a person decided before it pays above the limit.

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