How to Build a claims processing Agent Using AutoGen in Python for insurance

By Cyprian AaronsUpdated 2026-04-21
claims-processingautogenpythoninsurance

A claims processing agent takes a first notice of loss, gathers the missing facts, checks policy and coverage rules, drafts a claim summary, and routes the case to the right human or downstream system. For insurance, that matters because claims handling is where cycle time, leakage, compliance risk, and customer experience all collide.

Architecture

  • Claim intake agent

    • Receives FNOL data from email, web forms, call center notes, or an API.
    • Normalizes fields like policy number, loss date, peril type, and claimant details.
  • Policy retrieval tool

    • Pulls policy terms, endorsements, limits, exclusions, and residency constraints from approved systems.
    • Keeps the model grounded in source-of-truth data.
  • Claims reasoning agent

    • Uses AutoGen AssistantAgent to classify the claim, identify missing information, and draft next actions.
    • Produces structured output for adjusters and workflow systems.
  • Compliance/review agent

    • Checks for regulated language, unfair claims handling risks, missing disclosures, and escalation triggers.
    • Flags cases that need human review before any customer-facing response.
  • Audit logger

    • Persists prompts, tool calls, model outputs, and final decisions with timestamps.
    • Supports traceability for regulators and internal audit.
  • Human adjuster handoff

    • Routes low-confidence or high-severity claims to an UserProxyAgent or case management queue.
    • Prevents automation from making unsupported determinations.

Implementation

1. Install AutoGen and define your claim schema

Use a structured payload from the start. Claims work best when the agent sees normalized fields instead of raw free text.

from dataclasses import dataclass
from typing import Optional

@dataclass
class Claim:
    claim_id: str
    policy_number: str
    claimant_name: str
    loss_date: str
    peril: str
    description: str
    jurisdiction: str
    estimated_loss: Optional[float] = None

2. Create an assistant agent with a bounded system prompt

The key pattern is to keep the model in a narrow role: extract facts, identify gaps, and recommend next steps. Do not let it decide coverage on its own unless your rules engine has already validated the inputs.

import os
from autogen import AssistantAgent

llm_config = {
    "config_list": [
        {
            "model": "gpt-4o-mini",
            "api_key": os.environ["OPENAI_API_KEY"],
        }
    ],
    "temperature": 0,
}

claims_agent = AssistantAgent(
    name="claims_agent",
    llm_config=llm_config,
    system_message=(
        "You are a claims processing assistant for an insurance carrier. "
        "Your job is to summarize FNOL data, identify missing information, "
        "flag compliance concerns, and draft a recommended next action. "
        "Never invent policy terms. If coverage cannot be confirmed from provided data, "
        "escalate to a human adjuster."
    ),
)

3. Add a human proxy for controlled approval

AutoGen’s UserProxyAgent is useful as the approval gate. In production this is usually wired to an adjuster UI or workflow engine rather than stdin.

from autogen import UserProxyAgent

adjuster = UserProxyAgent(
    name="adjuster",
    human_input_mode="NEVER",
)

4. Run the conversation with an explicit handoff pattern

This example sends one claim into the assistant and captures a structured response you can store or forward downstream.

claim = Claim(
    claim_id="CLM-100245",
    policy_number="POL-77821",
    claimant_name="Jordan Lee",
    loss_date="2026-04-18",
    peril="water damage",
    description="Kitchen ceiling leak after overnight pipe burst.",
    jurisdiction="NY",
)

prompt = f"""
Process this insurance claim:

Claim ID: {claim.claim_id}
Policy Number: {claim.policy_number}
Claimant: {claim.claimant_name}
Loss Date: {claim.loss_date}
Peril: {claim.peril}
Description: {claim.description}
Jurisdiction: {claim.jurisdiction}

Return:
1) A concise claim summary
2) Missing information needed to continue
3) Compliance flags if any
4) Recommended next action
"""

result = adjuster.initiate_chat(
    claims_agent,
    message=prompt,
)

print(result.chat_history[-1]["content"])

In practice you would insert a retrieval step before initiate_chat, using your policy admin system or document store to fetch relevant coverage text. The agent should only reason over retrieved excerpts plus the FNOL payload.

Production Considerations

  • Put policy lookup behind deterministic tools

    • Don’t ask the LLM to “remember” coverage rules.
    • Use approved retrieval APIs or internal services so every decision traces back to source data.
  • Log everything needed for audit

    • Store prompt text, retrieved policy excerpts, model version, output text, timestamps, and human overrides.
    • Claims teams need this for dispute handling and regulator requests.
  • Apply jurisdiction-aware guardrails

    • Different states have different claims handling rules, disclosure requirements, and timelines.
    • Route responses through templates validated by legal/compliance before anything reaches a claimant.
  • Respect data residency and PII boundaries

    • Keep sensitive claim data in-region if your operating model requires it.
    • Mask SSNs, medical details, bank info, and other PII before sending context to the model whenever possible.

Common Pitfalls

  • Letting the model infer coverage from thin context

    • This is how you get hallucinated denials or approvals.
    • Fix it by grounding every decision in retrieved policy text and deterministic business rules.
  • Skipping human review on high-severity claims

    • Large losses, injury claims, litigation threats, fraud indicators, and ambiguous jurisdictional cases need escalation.
    • Build confidence thresholds and severity triggers into the workflow.
  • Ignoring auditability

    • If you cannot reconstruct why a recommendation was made six months later, you do not have a production claims system.
    • Persist inputs/outputs/versioning at every step and make them searchable by claim ID.

A good claims agent does not replace adjusters. It removes repetitive work: summarizing FNOLs, collecting missing facts, flagging compliance issues, and routing cases faster with less manual triage. That is where AutoGen fits well in insurance—controlled orchestration around a narrow task with humans still owning final decisions.


Keep learning

By Cyprian Aarons, AI Consultant at Topiax.

Want the complete 8-step roadmap?

Grab the free AI Agent Starter Kit — architecture templates, compliance checklists, and a 7-email deep-dive course.

Get the Starter Kit

Related Guides