cleandataengineering.aiAgent Harness, drawn simply
You are here: Real flows › 10 · Sending a document

Agent Harness Tutorial · Real flows

Flow 10: Sending a document

Route: Agentic. 2 model calls · 2.95 s on the server, but 58 s for Rohan · $0.00043.

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 newconversationTHE MESSAGERohan: "I have the police FIR copy for claim CLM-010006, please add it to the claim."Open: Front doorFront doorzoom in ›3first message after idle: a coldstart from zero servers, about55 s (F-126)Open: 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 ›6send_document: AgenticOpen: Consent: what his words allowConsent: what his words allowzoom in ›7submit_document:CLM-010006TRIP 1Open: Context assemblyContext assemblyzoom in ›8Open: Pre-model checkPre-model checkzoom in ›9no_known_injection: passOpen: Model callModel callzoom in ›101,046 ms · 666 in / 87 out ·APIM: allow-list, rate limit,Content Safety passOpen: Read the answerRead the answerzoom in ›11wants a toolOpen: Pre-tool checkPre-tool checkzoom in ›12consent · passOpen: Tool callTool callzoom in ›13submit_document · reversible ·477 ms · key run_025c…:0:1Open: Post-tool checkPost-tool checkzoom in ›14fenced ·no_instructions_in_result: passTRIP 2Open: Context assemblyContext assemblyzoom in ›15Open: Pre-model checkPre-model checkzoom in ›16no_known_injection: passOpen: Model callModel callzoom in ›171,112 ms · 830 in / 83 out ·APIM: allow-list, rate limit,Content Safety passOpen: Read the answerRead the answerzoom in ›18words: a candidate answerOpen: Post-model checkPost-model checkzoom in ›197 reply rules passOpen: After-loop rulesAfter-loop ruleszoom in ›20no Tier-2 rule fires · promisegate: passOpen: Before-reply checkBefore-reply checkzoom in ›21no_promise_of_cover,no_pii_echo, money_in_rupees:passOpen: Save and settleSave and settlezoom in ›22checkpoint saved · ledger row →answeredReply: "Your police FIR copy has been added to claim CLM-010006. The claim is now waitingfor the garage's repair estimate ..."
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 teachesThe other 55 seconds was a cold start from zero servers (F-126). One always-on server would remove it for about $1.20 a day.

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