Developer · Modelling

Build and test a real pricing model

Swallow models are plain JSON that AI agents can write and people can read. Here's a complete UK pet insurance model, priced by the Swallow engine

Model format

Made for AI. Clear to people.

The agent that drafts a model, the engine that prices it and the person who signs it off all work from one file. No generated code to review

For AI
Easy for agents to write
One JSON schema, a short list of step types and validation on the server. An AI client can draft a model, check it and run its tests over MCP
For people
Reads like a rating guide
Inputs carry labels and plain descriptions, rate tables are rows and every formula is written out. Underwriters can review a change without reading code
For both
Tested and versioned
Each version keeps its own tests, so every change, from a person or an agent, is checked against known prices before it goes live
The model

UK Pet Insurance: Cats and Dogs

Rates annual lifetime vet-fee cover for one cat or dog in the UK. Base rates by species and annual vet-fee limit are adjusted for age band, breed, region, voluntary excess and neutering, then 12% Insurance Premium Tax is added. Older pets and breed/species mismatches are declined; high-limit cover on high-risk breeds is referred.

7inputs
6rate tables
4calculations
5/5tests passing
Swallow project page for UK Pet Insurance: Cats and Dogs, showing Version #3 in Draft with its version summary, and quote, sales and conversion charts
01Inputs

Set what you rate on

Each input has a key, a type, a default and a description your brokers can read. Fields with set options keep their list of options with them

InputInputs
Input step editor listing the pet inputs: species, breed, pet age, region, vet-fee limit, excess and neutered, with types and defaults
02Collections

Add your rate tables

Tables are plain rows and lookups chain filters, so an age band that depends on species is a single line. Upload or download any table as a CSV in the dashboard

CollectionAge factor
Collection step editor for the age factor rate table, with species, minimum age, maximum age and factor columns
03Calculations

Work out the premium

Calculations run in order and can use any input or earlier result. Here the risk premium multiplies six factors together, then 12% UK Insurance Premium Tax goes on top

CalculationPremium
Calculation step editor for the risk premium, showing the formula that multiplies the base premium by the age, breed, region, excess and neuter factors, marked valid
04Underwriting

Decline and refer

An exclusion makes a quote invalid. A refer still prices it but flags it for an underwriter. Pets over 14 and breeds that don't match the species decline, and 7,000 cover on a high-risk breed refers

Exclusion & referUnderwriting rules
Refer rule being edited: 7,000 limit on a high-risk breed, with the expression checking the vet-fee limit and breed, marked valid
05Tests

Pin it with tests

Every test fixes a set of inputs to the result you expect. Run the whole suite on each change and know the prices still hold before you publish

Tests5 scenarios
Test results after running all five tests, with expected and actual validity and result side by side and 0% movement on each
Test results

Five scenarios, all passing

Two priced quotes that match a hand calculation to the penny, two declines and a refer. This is what the engine returned for the suite above

ScenarioAnnualMonthlyValidRefer
Persian cat, 3, Greater London, 4k limit, 100 excess, neutered255.3421.28valid–
Labrador, 6, North, 2k limit, 250 excess, entire269.7622.48valid–
Decline: cat aged 15––declined–
Refer: French Bulldog on 7k limit621.4751.79validrefer
Decline: cat with a dog breed––declined–
06 · Release

Draft, approve, publish

Each version moves from draft to approved to published, so every change is reviewed before it prices a live quote

Draft
Build and edit
New versions start as a draft copied from the live model, and only a draft can change. Edit it in the dashboard or upload a new model file. A project has one draft at a time
Approved
Review
Run the tests, look over the changes and approve. Your team's roles decide who can approve, and approving fires your webhooks
Published
Go live
Publish and the version starts pricing. Quotes that don't name a version use the latest published one. Every step is logged with who did it and when
Previous Versions tab listing Version #2 as Published, with its version summary expanded, and Version #1 as Archived
Process tab for draft Version #3, with the version summary, Approve and Delete buttons, and the version team with write and approve roles
Build it from your AI client

Connect Claude, ChatGPT or Cursor to the Swallow MCP server. Your agent can read the rules, start from an example model, validate it and run its tests

Connect over MCP
Rather we built it?

Send us your rating guide, spreadsheet or filing and we'll talk you through getting it live on Swallow

Talk to our team