13.1 Context & Business Problem
I led the architecture for an agentic automation system built for a mid-size insurance claims operation (auto and property claims) whose intake and initial triage process was almost entirely manual. New claims arrived through a web portal, email, and a call-center transcript feed, and human adjusters spent a large share of their time on repetitive, low-judgment work: reading intake documents, checking policy status and coverage, flagging obvious missing information, checking for duplicate or potentially fraudulent submissions against known patterns, and routing the claim to the right specialist queue. Only after that triage did the actual adjustment/negotiation work — the part that genuinely needed a skilled human — begin.
The stated business driver was a combination of rising claim volume (roughly 22% year-over-year growth in submitted claims) without a proportional increase in adjuster headcount, and a customer-satisfaction problem: median time from claim submission to “an adjuster has actually looked at this” was multiple business days, and a meaningful share of claims sat idle because they were missing a document nobody had asked the claimant to provide yet.
There had been a prior attempt using a traditional rules engine (deterministic if-this-then-that routing based on claim type and dollar amount) to handle triage. It worked for the small subset of claims that fit clean categories but broke down constantly on the long tail — claims with ambiguous descriptions, multiple coverage types, or unusual document combinations — and required constant manual rule maintenance as edge cases piled up. That system was still running in production alongside our new one for the first several months, handling only the cleanest claim types, while we proved out the agentic system on the messier majority.
13.2 Requirements & Constraints
Functional requirements
- Ingest claims from three intake channels (portal form submissions, inbound email with attachments, call-center transcripts) into a unified claim record.
- Perform automated triage: classify claim type and complexity, verify policy is active and covers the claimed peril, check for missing required documents, run a fraud-signal check against historical patterns, and assign to the correct specialist queue with a priority score.
- For claims below a defined risk/complexity threshold, the system could take low-risk automated actions directly (e.g., sending a “please provide X missing document” request to the claimant, or auto-approving a small, clean, well-documented claim under a set dollar threshold with existing precedent).
- For anything above that threshold — any claim involving a payout above a set dollar amount, any fraud-signal flag, any coverage ambiguity, or any claim type outside a pre-approved automatable set — the system must stop and route to a human adjuster for explicit approval before any customer-facing action or payout is taken. This human-in-the-loop gate was non-negotiable from day one, driven by both regulatory and business-risk requirements.
- Full audit trail of every agent action, every tool call, and every decision rationale, retained for regulatory examination.
Non-functional requirements
- Volume: approximately 3,000 new claims per day at peak, with the system needing to complete triage within a target of under 15 minutes per claim from intake (not a hard real-time SLA like the RAG project, since this ran as an asynchronous background pipeline rather than an interactive chat).
- Compliance: state insurance regulations required that certain claim decisions be traceable to a specific rationale and, for any adverse decision (denial or reduced payout), reviewable by a licensed adjuster — the system could never autonomously deny a claim.
- Reliability: the pipeline needed to be resilient to individual tool failures (e.g., the policy lookup system being briefly unavailable) without silently dropping claims or duplicating actions.
- Team: 7 people (3 backend/agent engineers, 1 ML engineer, 1 data engineer, 1 frontend engineer for the adjuster review UI, plus me), roughly 6 months to production pilot on one claim type (auto), then a further 4 months to expand to property claims and broaden the automation scope.
- Cost/scale ceiling: similar to the RAG project, a monthly infra/LLM cost target was set upfront, which shaped how aggressively we used agentic loops versus simpler deterministic steps where a deterministic step would do.
13.3 Architecture
┌───────────────────────────────────────────────────┐
│ INTAKE CHANNELS │
│ Web portal form | Inbound email + attachments | │
│ Call-center transcript feed │
└───────────────────────┬───────────────────────────┘
▼
┌───────────────────────────────────────────────────┐
│ INTAKE NORMALIZATION SERVICE │
│ (OCR on attachments, transcript parsing, │
│ unified Claim record created, event emitted) │
└───────────────────────┬───────────────────────────┘
▼
┌───────────────────────────────────────────────────┐
│ ORCHESTRATOR (state machine) │
│ - owns the claim's workflow state │
│ - dispatches to specialized agents in sequence/ │
│ parallel per claim type │
│ - enforces the human-approval gate before any │
│ high-risk tool call executes │
│ - all agent outputs + tool calls persisted to │
│ audit log (event-sourced) │
└───────┬───────────┬───────────┬───────────┬────────┘
▼ ▼ ▼ ▼
┌──────────────┐┌────────────┐┌───────────┐┌────────────────┐
│ Classification││ Coverage ││ Document ││ Fraud-Signal │
│ Agent ││ Verification││ Completeness││ Agent │
│ (claim type, ││ Agent ││ Agent ││ (pattern match + │
│ complexity ││ (policy DB ││ (checklist ││ LLM anomaly │
│ scoring) ││ tool call) ││ vs. required││ reasoning over │
│ ││ ││ doc types) ││ claim narrative) │
└──────┬────────┘└─────┬──────┘└─────┬─────┘└────────┬────────┘
│ │ │ │
└────────────────┴──────┬───────┴───────────────┘
▼
┌───────────────────────────┐
│ Risk Aggregation & Router │
│ (combines agent outputs │
│ into a single risk/ │
│ complexity score + action │
│ recommendation) │
└──────────┬─────────────────┘
▼
┌─────────────────┴─────────────────┐
▼ ▼
┌─────────────────────────┐ ┌───────────────────────────┐
│ LOW RISK: auto-execute │ │ HIGH RISK / AMBIGUOUS: │
│ action agent (send doc │ │ route to Human Adjuster │
│ request, auto-approve │ │ Review Queue │
│ within pre-set threshold) │ │ (adjuster sees full agent │
│ → still logged + sampled │ │ reasoning trail, approves/ │
│ for human audit │ │ edits/rejects before any │
│ │ │ customer-facing action) │
└──────────┬──────────────────┘ └──────────────┬────────────┘
│ │
▼ ▼
┌────────────────────────────────────────────────────────────┐
│ TOOL LAYER (policy DB, document store, │
│ claimant notification service, payment │
│ system, specialist queue assignment) │
└────────────────────────────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────┐
│ Audit Log (event-sourced) + Monitoring/Eval Store │
└────────────────────────────────────────────────────────────┘
Walkthrough and why each piece was chosen:
-
Orchestrator as an explicit state machine, not a fully autonomous “agent decides everything” loop: This was probably the single most consequential architectural choice. I deliberately rejected a design where one large agent freely plans and calls tools in an open-ended loop to process a claim end-to-end. Instead, the orchestrator owns a defined workflow graph (classify → verify coverage → check documents → fraud check → aggregate → route), and each specialized agent is invoked for a bounded sub-task with a constrained toolset. This traded some flexibility (the system can’t improvise a novel workflow for a claim type nobody anticipated) for predictability and auditability, which regulatory and business-risk requirements made non-negotiable. It also made the incident described below containable rather than catastrophic — the blast radius of any single agent’s misbehavior was bounded by the orchestrator’s state machine.
-
Specialized agents per sub-task rather than one generalist agent: Each agent (classification, coverage verification, document completeness, fraud signal) has a narrow scope, a small toolset, and its own eval set. This was chosen over a single generalist “claims agent” because it let us eval, tune, and — critically — constrain each capability independently. The fraud-signal agent, for instance, has read-only tool access and can never itself trigger a customer-facing action; it only contributes a signal to the risk aggregator. That separation of “which agents can reason about risk” from “which agents/actions can actually affect the customer or the money” was deliberate defense in depth.
-
Risk aggregation as a separate, largely deterministic component rather than letting an LLM make the final auto-execute-vs-escalate call: The final decision of whether a claim is low-risk enough for automated action is made by a deterministic scoring function that combines the agents’ structured outputs (not free text) against explicit, auditable thresholds set and periodically reviewed by the compliance and claims leadership teams. I chose this over having an LLM directly decide “approve or escalate” because regulators and internal risk/compliance stakeholders needed a decision boundary they could inspect, set, and audit independently of model behavior — a threshold table is auditable in a way that “trust the LLM’s judgment” is not.
-
Human-in-the-loop review queue with full reasoning trail exposed, not just a final recommendation: For any claim routed to a human adjuster, the UI shows the full chain of what each agent found and why (e.g., “Coverage Verification Agent: policy active, peril covered under Volume 1 section 3.2, confidence high” / “Fraud Signal Agent: flagged — claim narrative mentions prior claim at similar location within 60 days, confidence medium”), rather than just a summary recommendation. This was chosen specifically so adjusters could catch agent errors rather than rubber-stamping a black-box recommendation, and it made the system’s mistakes visible and correctable rather than silently trusted.
-
Event-sourced audit log rather than a mutable claim status table: Every agent output, every tool call (including ones that were proposed but blocked by the approval gate), and every human decision is appended as an immutable event rather than overwriting a “current status” field. This was chosen for regulatory examinability — a state machine that only stores current state can’t answer “what did the system believe at 2:14pm before the human overrode it,” which auditors explicitly asked for during a compliance review.
13.4 Key Technical Decisions & Trade-offs
-
Constrained multi-agent state machine vs. a single autonomous planning agent. A single agent with a large toolset and free-form planning (the more “agentic” approach popular in demos) would have been faster to prototype and more flexible for edge cases. We chose the constrained state machine because regulatory auditability and blast-radius containment mattered more than flexibility for this domain, and because — as the incident below shows — an under-constrained agentic loop over financial actions is a genuinely dangerous failure mode, not a theoretical one.
-
Deterministic risk-threshold routing vs. LLM-judged escalation decisions. Letting the model itself decide “this is low-risk, auto-approve” would have adapted more gracefully to novel claim patterns. We chose deterministic, human-reviewed thresholds over structured agent outputs because compliance required an inspectable, settable decision boundary, and because we needed confidence that the auto-execute path could never be talked into approving something inappropriate by an unusual claim narrative — separating “the LLM assesses” from “a fixed rule decides” closed that door.
-
Auto-execute allowed only for a narrow, explicitly pre-approved action set (document requests, small clean auto-approvals) rather than any action below the risk threshold. Even for low-risk claims, we didn’t grant the system a general “take any reasonable action” capability — the tool layer itself only exposes a small allowlisted set of auto-executable actions, everything else requires human approval regardless of assessed risk. This cost us some automation coverage in the early months (some genuinely low-risk claims still needed a human to click “approve” for actions outside the allowlist) but gave us a much simpler security/safety review surface, since we only had to reason carefully about a handful of action types rather than an open-ended action space.
-
Synchronous tool calls with retries and idempotency keys vs. fire-and-forget async actions. Every tool call that could have a real-world effect (sending a claimant notification, initiating a payment) was built with an idempotency key derived from the claim ID and action type, and the orchestrator tracks tool-call completion state explicitly. We chose this over simpler fire-and-forget calls because early testing surfaced a duplicate-notification bug (described below) that made clear how easily a retry-on-timeout pattern could double-send a customer-facing action without idempotency protection — a risk we weren’t willing to accept in production.
-
Per-agent narrow tool access vs. a shared tool pool available to all agents. Each agent’s toolset is explicitly scoped — the fraud-signal agent has read-only access to claim history and policy data and cannot call the notification or payment tools at all, even indirectly. This was more setup work (maintaining per-agent tool permission configs) than giving every agent the full tool pool and trusting prompting to constrain behavior, but we treated prompt-based constraint as insufficient for anything with real-world side effects, given what we’d already seen prompt-only constraints fail to prevent during internal red-teaming.
-
LLM-based fraud-signal reasoning combined with deterministic pattern rules, rather than LLM-only or rules-only fraud detection. Pure rules (e.g., “flag if claim amount exceeds X and filed within Y days of policy start”) caught known patterns but missed novel ones; pure LLM reasoning over claim narratives caught subtler signals but was inconsistent and occasionally over-flagged based on incidental language choices. We combined both — deterministic rules for known high-confidence patterns, LLM reasoning as a supplementary signal contributing to, not solely determining, the fraud score — because relying on LLM judgment alone for something with real consequences for a claimant (getting flagged for potential fraud) needed a more stable, explainable foundation than model reasoning alone provided.
13.5 Implementation Challenges & How They Were Solved
-
The production incident: a document-request loop. About seven weeks after pilot launch on auto claims, we discovered that the Document Completeness Agent had sent the same “please provide your repair estimate” email to roughly 40 claimants multiple times over a single day — in the worst case, one claimant received the same request 11 times within about six hours. Root cause: the agent’s completeness check ran on a re-triggered basis whenever any update touched the claim record (including the notification-sent event itself), and because the notification-sent event was itself being written back into the claim record for audit purposes, it was inadvertently re-triggering the same completeness check, which — because the document genuinely still hadn’t arrived yet — re-concluded “document missing, send request” and re-sent the notification, creating a loop. This wasn’t caught in testing because our test fixtures always included the eventual document arrival shortly after the first request, masking the loop. Detection: a spike in the claimant notification service’s send volume tripped an alert (send-rate anomaly threshold), and the on-call engineer traced it to the same claim IDs recurring. Containment: we immediately paused the auto-execute path for the Document Completeness Agent’s notification action specifically (leaving the rest of the pipeline running) within about 20 minutes of the alert firing, and manually reviewed the affected 40 claims. Fix: we (a) decoupled the completeness-check trigger from notification-sent events so the agent no longer re-evaluates in response to its own prior action, (b) added an explicit per-claim, per-action-type rate limit at the tool layer (no more than one of a given notification type per claim per 48 hours, enforced independently of agent reasoning), and © added the idempotency-key architecture described in decision #4 above, which had not yet been built at the time of this incident and was directly motivated by it. Guardrail added afterward: we instituted a standing rule that any new auto-executable action must have an explicit rate limit and idempotency protection at the tool layer, not just correct agent logic, before it’s allowed into the auto-execute allowlist — treating the tool layer, not the agent’s reasoning, as the actual safety boundary.
-
OCR quality on scanned/photographed claim attachments was inconsistent enough to produce false “missing document” flags. Root cause: claimants frequently submitted photos of documents taken at an angle or with glare, and our first OCR pass had a meaningful failure rate on these, causing the Document Completeness Agent to conclude a required document was illegible/absent when it was actually present but unreadable. Fix: added an image quality pre-check (blur/glare/skew detection) before OCR, with a “please resubmit a clearer photo” specific message distinct from “document missing” when quality was the issue, and set a confidence threshold below which the system defers to human review rather than auto-flagging as missing. This cut false missing-document flags substantially and, as a side benefit, gave claimants a clearer, more accurate reason when we did ask them to resubmit something.
-
Coverage Verification Agent occasionally cited the wrong policy version when a claimant had a mid-term policy amendment. Root cause: the policy database tool returned the current policy version by default rather than the version in effect at the date of loss, and the agent wasn’t explicitly instructed to reconcile claim date against policy effective-date ranges — most of the time current-version and loss-date version were identical, so this only surfaced for the subset of claimants with mid-term amendments. Fix: modified the policy lookup tool’s interface to require a date-of-loss parameter and return the policy version effective on that date rather than defaulting to current, making the correct behavior the default rather than something the agent had to remember to request.
-
Latency and cost blew past target during property-claims expansion because we initially reused the auto-claims agent prompts without adjusting for property claims’ longer, more variable narrative descriptions. Root cause: property claim narratives (e.g., storm damage descriptions) were on average several times longer than auto claim narratives, and our classification and fraud-signal agents were sending the full narrative into context on every claim, which was fine for auto claims but pushed per-claim cost and latency well above target once property claims went live at volume. Fix: added a summarization pre-step for narratives above a length threshold before they’re passed to downstream agents, and moved the fraud-signal agent to only pull the full narrative when an initial lighter-weight pass flagged something worth deeper reasoning about, rather than always processing the full text at full depth.
13.6 Production Operations
- Monitoring: per-agent success/error rates, end-to-end triage completion time, auto-execute rate versus human-escalation rate (a sudden shift in this ratio is itself an alert-worthy signal — either the risk thresholds drifted or claim mix changed unexpectedly), and the notification/action send-rate anomaly detection that caught the loop incident.
- Eval: a golden set of several hundred historical claims with known-correct triage outcomes (verified against what actually happened when a human adjuster handled them), run against the pipeline on every change to agent prompts, tools, or the risk-aggregation thresholds, comparing predicted classification/routing/risk score against the historical ground truth before any change is promoted.
- On-call model: platform engineers rotated on-call for infra incidents; I was the standing escalation point for any incident involving an auto-executed action that shouldn’t have happened, given the customer and regulatory sensitivity, with a documented runbook whose first step is always “pause the specific auto-execute action type, not the whole pipeline” to minimize unnecessary disruption while containing risk.
- Cost management: per-claim cost tracked by agent and by claim type, monthly rolled up against the finance ceiling; the narrative-summarization and selective-deep-reasoning changes described above were direct responses to cost tracking flagging property claims as disproportionately expensive.
- How quality regressions get caught: golden-set regression testing before any prompt/threshold change is promoted (release-blocking on any accuracy drop), plus a weekly sample audit where a compliance-side reviewer independently re-reviews a random sample of both auto-executed and human-approved claims to check the system’s risk assessment against their own judgment, feeding disagreements back into threshold tuning.
13.7 Results & Metrics
- Median time from claim submission to “meaningfully triaged and assigned” dropped from several business days to under 25 minutes for the ~68% of auto and property claims that flowed through the automated path (the remainder routed to human review still saw faster triage than before, since the agents’ reasoning trail sped up the adjuster’s own review even when a human made the final call).
- Roughly 31% of eligible low-complexity claims were fully auto-processed end-to-end (document requests and small clean approvals) within the pre-approved action allowlist, with the remainder escalated for human approval as designed.
- Adjuster time spent on pure triage/routing work dropped by an estimated 40%+, redirecting that capacity toward the higher-judgment adjustment and negotiation work adjusters were originally trained for.
- Missing-document identification (previously often surfaced only when an adjuster got around to reviewing the claim, sometimes days later) now happened within the 15-minute triage window for the large majority of claims, meaningfully shortening the overall claim-resolution timeline.
- Zero regulatory findings related to the automated system in the compliance reviews conducted during my time on the project, which I attribute directly to the audit-log and human-approval-gate design decisions.
- The document-request loop incident affected roughly 40 claimants with duplicate (not incorrect) notifications; no claimant received an incorrect coverage decision or payment as a result, since the notification action itself was outside the payment/approval action set and the incident was contained to that one auto-execute action type.
13.8 What I’d Do Differently
- I would have required idempotency keys and per-claim rate limiting on every auto-executable action from day one rather than adding it after the document-request loop incident. In hindsight, “what happens if this action fires twice” is as fundamental a question for an agentic system with real-world side effects as “what happens if this action fires zero times,” and I should have made it a launch-blocking requirement rather than a lesson learned in production.
- I’d build the compliance weekly-sample-audit process before pilot launch rather than a few weeks after. We got lucky that the loop incident was caught by an infra-level send-rate alert rather than only being caught by the audit process, which came online slightly later — I’d rather have redundant detection layers in place from day one for a system that can take real-world actions.
- I’d push back harder, earlier, on expanding to property claims using auto-claims agent configurations largely as-is. We treated the expansion as “the same system, new claim type” when the narrative-length and cost implications should have prompted a more deliberate domain-specific tuning pass before going live at volume, rather than after cost and latency problems surfaced.
13.9 Anticipated Follow-Up Questions
-
“Why not just let one agent handle the whole claim end-to-end with a big toolset — isn’t that the more ‘agentic’ approach?” We considered it and rejected it specifically because of the regulatory auditability and blast-radius requirements — a constrained state machine of specialized agents with narrow toolsets gives us an inspectable decision boundary and contains the damage any single agent’s error can cause, which mattered more here than the flexibility a freer-form agent would offer. The document-request loop incident, even though it happened within our constrained design, would very plausibly have been worse — able to touch more action types — in a fully autonomous single-agent design.
-
“Walk me through the document-request loop incident in detail — how did you actually detect and fix it?” [Covered fully in Volume 1 section 5.1 above — I’d narrate root cause, detection via send-rate anomaly alert, containment by pausing the specific auto-execute action within ~20 minutes, and the three-part fix: decoupling the trigger, adding tool-layer rate limits, and adding idempotency keys.]
-
“How do you prevent an agent from taking an action it shouldn’t, beyond just prompting it not to?” Prompt-based constraint alone was something we explicitly didn’t trust for anything with real-world side effects — the actual safety boundary is the tool layer: each agent has a narrowly scoped, allowlisted toolset it can call, high-risk actions require human approval regardless of what the agent concludes, and auto-executable actions have deterministic rate limits and idempotency protection independent of the agent’s own reasoning.
-
“How did you decide what could be automated versus what needed a human?” A deterministic, compliance-reviewed threshold table combining structured agent outputs (claim type, complexity, coverage confidence, fraud signal) — not an LLM’s own judgment call — decides whether a claim’s assessed risk falls under the auto-execute allowlist. The allowlist of auto-executable actions itself was also deliberately narrow (document requests, small clean approvals) rather than “anything low risk,” so even most low-risk claims still had at least one human touchpoint outside that narrow set early on.
-
“How do you audit what the system did, especially for a claim that was later disputed?” Every agent output, tool call (including blocked/proposed ones), and human decision is written to an event-sourced, immutable audit log, so we can reconstruct exactly what each agent believed and recommended at any point in time, not just the final outcome — which is what a regulatory examiner or an internal compliance review actually needs to ask.
-
“What happens if a tool the agents depend on (like the policy database) goes down?” The orchestrator treats tool failures as a first-class state, not a silent no-op — a failed tool call is retried with backoff up to a limit, and beyond that the claim is routed to human review flagged with “automated verification unavailable,” rather than either blocking indefinitely or, worse, proceeding with a stale or default assumption about coverage.
-
“How did the fraud-signal agent avoid unfairly flagging legitimate claimants?” By combining deterministic, well-understood rules with LLM reasoning as a supplementary rather than sole signal, and by making sure a fraud flag alone was never enough to deny anything automatically — it only ever raised a claim’s priority for human review, never triggered an adverse action on its own, which was both a fairness safeguard and a regulatory requirement.
-
“How did you measure whether the system’s triage decisions were actually correct, not just fast?” The golden set of historical claims with known human-adjuster outcomes was the primary offline signal, and the weekly compliance sample audit — an independent human re-reviewing a random sample of both auto-executed and human-approved claims — was the ongoing production signal, specifically designed to catch cases where the system’s risk assessment diverged from expert judgment even when nothing had technically “errored.”
-
“Why build a rules engine plus agents rather than fully replacing the old rules engine?” We didn’t keep the old rules engine as a permanent architecture choice — it stayed live in parallel, handling only the cleanest claim types, purely as a risk-mitigation bridge while we proved the new system out on the messier majority of claims. It was fully retired for auto claims once we had sufficient production track record, and I’d frame that as a deliberate staged-rollout decision, not an endorsement of running two systems long-term.
-
“What was the hardest part of getting this into production, technically or organizationally?” Technically, it was the class of problem the loop incident represents — reasoning about the safety of an agentic system’s side effects under retries, re-triggers, and partial failures is a fundamentally different discipline than reasoning about a single request/response LLM call, and I don’t think our team fully internalized that until we hit it in production. Organizationally, it was earning compliance and claims leadership’s trust to expand the auto-execute allowlist incrementally — every expansion required a track record and a case-by-case risk conversation, which was the right amount of caution for this domain even when it slowed us down.