@openinsure/rating and @openinsure/underwriting packages together implement the actuarial and operational heart of the platform. The rating engine is deterministic and auditable — given identical inputs and rate table version, it always produces the same output with a full step-by-step calculation log.
How the Rating Engine Works
Input Model
Every quote starts with aRatingInput object that captures the risk characteristics:
Factor Execution Order
The engine applies factors in a fixed order. Each step records the intermediate premium value, the factor applied, and the source table:Audit Trail
Every rating step is stored in therating_audit table:
Supported Lines of Business
Configuring Rate Tables
Rate tables are managed through the Admin UI (/admin/rate-tables) or via the API.
Rate Table Structure
Upload via API
effectiveDate. The rating engine automatically selects the version in effect on the quote’s
effective date.
:::
The Underwriting Workbench
The Underwriting Workbench is a real-time web application for underwriters to review, decision, and bind submissions that require human judgment.When Submissions Hit the Queue
A submission is automatically escalated to the Workbench when:- The quoted premium exceeds the program’s auto-bind threshold (configured per program).
- The risk falls in an excluded class that requires prior approval.
- The experience mod exceeds 1.5 (poor loss history).
- The submission was referred by DA enforcement (exceeds per-policy or aggregate limits).
- An underwriter manually escalates it from the producer portal.
Workbench Features
Real-Time Queue
New submissions appear instantly via WebSocket (Durable Objects). Underwriters claim submissions to prevent double-decisioning.Risk Scorecard
AI-generated summary of the risk with flagged items, peer comparisons, and recommended premium adjustments.Schedule Rating
Apply credits/debits (-25% to +25%) with required reason codes. Changes are logged to the audit trail.Referral Notes
Threaded notes between MGA underwriters and carrier technical underwriters. Full history preserved on the submission record.Aspire Form Tab System
The Workbench includes a full-featured Aspire form for commercial auto submissions, organized into five tabs:- Insured Information — Company details, virtualized contacts grid (paste from Excel), addresses
- Commercial Automobile — Vehicles (VIN-decoded), drivers (MVR), coverage & limits, mileage distribution, filings, additional interests
- Prior Carrier & Loss History — Prior carriers, loss records with summary panel, work experience for new ventures
- Notes & Attachments — Categorized notes, file uploads with optimistic UI updates
- Other Coverages — Cargo, physical damage, trailer interchange, officers, knockout underwriting questions with risk indicators
useTableSpreadsheet for keyboard navigation and clipboard paste.
Quote Readiness Engine
TheQuoteReadinessService evaluates submission completeness using a strategy pattern — each carrier (Southwind, Bulldog, Commodore) can define custom checks on top of the common checks.
Scoring formula:
| Check | Severity | Tab |
|---|---|---|
| Company name missing | Blocker | Insured |
| Policy state missing | Blocker | Insured |
| No vehicles | Blocker | Commercial Auto |
| No contacts | Warning | Insured |
| No prior carriers (established business) | Warning | Loss History |
| Knockout “yes” answers (referral triggers) | Warning | Other Coverages |
- FMCSA inactive status → Blocker
- Unsatisfactory safety rating → Blocker
- High vehicle out-of-service rate (>30%) → Warning
- Invalid VINs → Warning
- Missing ADAS safety tech → Info
Referral Workflow
Underwriting Rules Engine
The@openinsure/underwriting package evaluates a set of configurable rules against every submission before and after rating. Rules either auto-bind (no UW touch), auto-refer, auto-decline, or flag specific conditions for manual review.
Rule structure
Example rules
Rule execution
AI Risk Adjustment
After the rating waterfall completes, theUnderwritingAgent optionally applies an AI risk adjustment of ±5% based on factors the rate tables don’t capture:
- Revenue trend (growing vs. contracting business)
- Geographic risk concentration
- Prior carrier’s reason for non-renewal
- Industry-specific news (WorldIntelligenceAgent feed)
- Management quality signals from the application
- Calculated by
claude-sonnet-4-6with the full submission context - Bounded to ±5% (hard limit enforced in code — not adjustable by prompting)
- Logged to
rating_auditas step 11 (“ai_risk_adjustment”) - Flagged as an adverse action if the adjustment increases premium — the adverse action notice lists each contributing factor