Underwriters rate on totals — total payroll, unit counts, revenue, subcontracted cost. But the numbers that matter live in hundred-row schedules. Turning row-level detail into header exposures is where a lot of “AI extraction” quietly goes wrong. There’s a right way to do it, and it isn’t arithmetic in a prompt.

Two ways it goes wrong

✗ Ask the LLM to add it up

“Sum the payroll column.” A model eyeballing 150 rows is slow, costs tokens per row, and is non-reproducible — run it twice, get two totals. Off by one row and the price is wrong.

✗ Hand-map every workbook

Bespoke code per broker template. Brittle, expensive to maintain, and it shatters the moment a column is renamed or a region sheet is added.

The right way: declarative derivation

InsightXtract computes totals with deterministic derived-field rules declared on the document type — not code, not a prompt. The extractor already produced clean, typed rows; a derivation rule reduces them exactly:

# on the exposure workbook document type
derived_fields:
  - { field: gl_payroll, agg: sum, from: general_liability.payroll }
52 rows $177,816,199 · exact, every run

The vocabulary is small and covers the underwriting need: sum, count, avg, min, max, with optional group_by and where:

derived_fields:
  - { field: number_of_autos, agg: count, from: automobile }
  - { field: payroll_by_state, agg: sum, from: workers_compensation.payroll, group_by: state }
66 autos  ·  {TX, CA, …} payroll by state

Cross-sheet totals with a wildcard

Some totals span many tables — contractor revenue across seven regional WIP sheets. A wildcard source sums a column across every table that has it, so it stays correct no matter how many regions a broker’s workbook holds:

derived_fields:
  - { field: total_project_revenue, agg: sum, from: *.current_project_estimate_revenue }
7 region sheets · 1,330 projects $45,789,700,000

Filters and breakdowns, for free

A group_by turns a column into the breakdown an underwriter rates on; a where filter isolates a slice — payroll in a monopolistic state, revenue above a threshold, autos of a given type — all without touching the source workbook:

derived_fields:
  - { field: payroll_by_state, agg: sum, from: workers_compensation.payroll, group_by: state }
  - { field: tx_payroll, agg: sum, from: workers_compensation.payroll, where: { state: TX } }
  - { field: avg_vehicle_value, agg: avg, from: automobile.cost_new }
{TX, CA, …} by-state payroll  ·  TX slice  ·  mean unit value

The same table, extracted once, answers many rating questions — totals, subtotals, filtered slices and averages — deterministically, and every answer traces back to the rows.

These are real numbers, verified

This isn’t a promise on a slide. Across eight validated industry submissions — construction, trucking, habitational, manufacturing, healthcare, energy, public entity and fire protection — the derived exposures match the ground truth to the dollar: gl_payroll of $177,816,199, a workers-comp payroll of $50,690,027, a 243-unit fleet, a 44-claim loss run summed in full. Every one computed by a rule over the extracted rows, not read off a summary line by a model.

Robust to the real world

  • Fuzzy source resolution — a rule written for payroll still binds a broker’s “Total Payroll” column, and general_liability matches a “GL Exposure” sheet. Naming variance across templates doesn’t break the total.
  • No fabricated zeros — if a source table or column genuinely isn’t present, the field is skipped, not silently set to 0. A missing exposure never masquerades as a real one.
  • Config, not code — derivations live on the document type and are editable without a deploy; they’re pinned to a published version, so an output made today reproduces tomorrow.
  • Free & auditable — zero LLM tokens, and every total traces to its schedule and rule.