How We Built an Agentic Claims System: Deterministic First, AI Second

Insurance claims processing is a textbook AI use case. Unstructured documents, complex rules, high volume, and expensive human review. Every insurer wants to automate it. But the companies that rush to "let AI decide everything" get burned. Models hallucinate policy details, miss obvious fraud signals, and produce decisions that no regulator will accept. Here is how we built it right for a Swiss car insurance provider.
The core insight
The most important architectural decision we made had nothing to do with AI. It was this: deterministic checks must run before the LLM ever sees the claim. Every yes/no question that can be answered by a database lookup or a rule engine should be answered that way. The AI only gets involved after the easy work is done and the data is clean.
This is not just an engineering preference. It is a compliance requirement in regulated industries, a cost optimization strategy, and a reliability guarantee rolled into one.
The four step pipeline
We designed the system as a sequential pipeline with four distinct stages. Each stage has clear inputs, outputs, and failure modes. No stage can be skipped.
Step 1: Validate (deterministic)
Is the policy active? Is the claim within the coverage period? Are the required documents attached? Is the claimant the policyholder or an authorized party? These are binary questions with definitive answers sitting in the policy database.
There is zero reason to involve an LLM here. A SQL query and a few conditional checks resolve these in milliseconds. If validation fails, the claim is rejected immediately with a specific reason code. No ambiguity, no interpretation, no cost.
Step 2: Enrich (data lookups)
Once validated, the system enriches the claim with external data. Vehicle history from the Swiss Traffic Office. Weather conditions at the reported accident location and time via MeteoSwiss API. Repair cost estimates from Audatex, the industry standard for vehicle damage assessment. Previous claims history for the same policyholder and vehicle.
This step transforms a thin claim submission into a rich, contextualized case file. Still no AI involved. Just API calls and database joins.
Step 3: Deterministic fraud checks (rule engine)
Now the enriched claim runs through a rule engine. Has the same VIN been involved in claims filed from multiple cantons? Does the claimed damage amount exceed 80% of the vehicle's current market value? Was the policy purchased less than 30 days before the incident? Does the repair estimate diverge significantly from Audatex benchmarks?
These patterns are well documented in insurance fraud literature. They do not require machine learning to detect. A rule engine catches them with 100% consistency, produces auditable decision trails, and runs in single digit milliseconds.
70% of claims in our system are fully resolved by steps 1 through 3 without a single LLM call. That means 70% of processing costs are measured in milliseconds of compute, not dollars of API tokens.
Step 4: AI evaluation (the last mile)
Only the remaining 30% of claims reach the AI layer. By this point, the model receives a structured, validated, enriched case file. It is not reading raw customer emails or parsing blurry photos in isolation. It has context.
The LLM performs three tasks. First, it assesses damage description consistency: does the narrative match the photos, the weather data, and the repair estimate? Second, it performs visual damage analysis on submitted photos using a vision model. Third, it produces a structured recommendation with a confidence score.
class ClaimEvaluation(BaseModel):
recommendation: Literal["approve", "flag_for_review", "deny"]
confidence: float # 0.0 to 1.0
reasoning: str
risk_factors: list[str]
estimated_payout: float
human_review_required: bool
async def evaluate_claim(enriched_claim: EnrichedClaim) -> ClaimEvaluation:
"""AI evaluation: only called after deterministic pipeline passes."""
# Build structured prompt with all enriched data
prompt = build_evaluation_prompt(
claim=enriched_claim,
vehicle_history=enriched_claim.vehicle_history,
weather=enriched_claim.weather_data,
fraud_score=enriched_claim.rule_engine_score,
repair_estimate=enriched_claim.audatex_estimate,
)
# Structured output ensures consistent, parseable responses
result = await llm.generate(
prompt=prompt,
response_model=ClaimEvaluation,
temperature=0.1, # Low creativity for insurance decisions
)
# Hard rule: confidence below 0.85 always triggers human review
if result.confidence < 0.85:
result.human_review_required = True
return resultThe critical detail: any claim where the model's confidence falls below 0.85 is automatically routed to a human reviewer. The AI never makes a final decision on uncertain cases. It recommends. A human decides.
Never set temperature above 0.2 for insurance decisions. You want the model to be boring and consistent, not creative. Creativity in claims assessment is called fraud.
Why this ordering matters
The "deterministic first" architecture is not just cleaner engineering. It solves four problems simultaneously.
Auditability. Swiss financial regulators (FINMA) expect clear, traceable decision logic. "The AI decided" is not an acceptable audit trail. "Rule 47B flagged the claim because the VIN appeared in two prior claims within 90 days" is. By the time AI is involved, it is adding a recommendation layer on top of an already documented decision chain.
Cost. Processing 70% of claims without any LLM call dramatically reduces API spend. For this client, that translated to roughly CHF 180,000 in annual savings compared to an "AI first" architecture that would route every claim through a frontier model.
Reliability. Deterministic checks produce identical results every time. LLMs do not. Running the same claim through an LLM ten times may yield ten slightly different assessments. By narrowing the AI's scope to genuinely ambiguous cases, you reduce the surface area where inconsistency can cause problems.
Speed. Steps 1 through 3 complete in under 200 milliseconds. The LLM step takes 3 to 8 seconds. When 70% of claims skip the slow step entirely, average processing time drops dramatically.
The results
After six months in production, the numbers speak for themselves. Average claim processing time dropped from 5 business days to 4 hours. 70% of claims are auto resolved without human review. Fraud detection rates improved by 40% compared to the previous manual process. And the system processes claims 24/7, not just during business hours.
Start every AI project by listing what does NOT need AI. The smaller the AI's scope, the more reliable, auditable, and cost effective the system becomes. Build the deterministic pipeline first. Add intelligence last.
The broader lesson
The most effective AI systems are not the ones where AI does the most. They are the ones where AI does the least, focused precisely on the tasks where it adds unique value. For insurance claims, that means letting databases answer database questions, letting rule engines catch known patterns, and reserving the expensive, probabilistic intelligence for the genuinely ambiguous 30% that requires judgment.
Never let AI make the first decision. Let it make the last one, after deterministic systems have narrowed the scope and enriched the context. That is how you build AI that regulators trust, actuaries respect, and customers actually benefit from.
If you are exploring AI automation for insurance or other regulated workflows, let's talk about your architecture.
