OSFI P&C Insurance Return checks

Insurance Canada

Checks the P&C Insurance Return a Canadian property and casualty insurer files with OSFI, the quarterly PC1 and PC2 and the annual PC3, against OSFI’s own 5,093 validation rules: every total on a page, every tie between pages and every tie between the three returns. It also checks that each value is on a page, line and column of the return, that the reporting end date is a quarter end and that no cell is given twice.

From OSFI’s P&C Insurance Return for 2027: the PC1, PC2 and PC3 return workbooks, and OSFI’s validation rules for PC1 (version 15), PC2 (version 14) and PC3 (version 13)

OSFI P&C Insurance Return checks
Checks, OSFI’s rules as data, the returns’ cells, test returns and a pipeline snapshot. Zip, 731 KB.
Download the template

See it in Quantemplate

The pipeline

The OSFI P&C Insurance Return pipeline in Quantemplate: all 19 stages listed, from Prepare return rows to OSFI rules checked, with link lines between them. The test run’s Outputs tab lists its two outputs: Return rows checked with 27,489 rows and OSFI rules checked with 9,475.

The test run’s checks

The validation report for the test returns. Each of the 8 row checks fails 1 row, apart from the duplicate check, which fails 2. Of the 3 OSFI rule checks, the rules within a page and across pages each fail 1, and the rules across returns fail 2.

A rule across returns

The 2 rows that fail the check of OSFI’s rules across returns, for a fictional insurer at 31 December 2027: rule CR0044 in PC1’s rules is out by 40, and its twin, CR0015 in PC3’s rules, by −40. Both are EqualWithinThreshold rules with a threshold of 1.

What it checks

11 rules 11 Fail

A rule set to Fail marks its rows as failed, and any failure blocks Auto Export if you set it up. Validation never removes a row. Every rule and its formula is listed in VALIDATIONS.md in the download.

How the pipeline works

  1. Stages 1–2 Prepare Clean each returns file, add the numbers and keys the checks use, and stack the files
  2. Stages 3–7 Reference data The cells, rules and rule terms tables, each page’s cell count, and the rows given for each cell
  3. Stages 8–11 Check rows Bring each cell’s data point code, description and counts onto every row, and run the 8 row checks. Output: every row of every return
  4. Stages 12–14 Add up rules Match each value to the OSFI rules that read it, add up each rule for each insurer and reporting end date, and count the returns given
  5. Stages 15–17 Check rules Bring each rule’s type, threshold and formula onto it, and run the 3 rule checks. Output: each OSFI rule for each insurer and reporting end date
  6. Stages 18–19 Outputs Return rows checked and OSFI rules checked

OSFI’s validation rules

OSFI publishes a file of validation rules for each return, the checks its filing system runs. The pipeline keeps them as data, in two reference datasets: OSFI PC Rules lists each rule, and OSFI PC Rule Terms lists the cells each rule adds or takes away. Every rule is a sum, such as total assets less each asset line, that should come to zero, or to within 1 where OSFI allows for rounding.

Return
Within a page
Across pages
Across returns
PC1, quarterly, rules version 15
823
29
42
PC2, quarterly, rules version 14
3,425
15
39
PC3, annual, rules version 13
706
1
13

The rules across returns tie PC1, PC2 and PC3 together, so each is checked when an insurer gives every return it reads for the same reporting end date: PC1 and PC2 each quarter, and all three at the year end. OSFI’s files also have 90 rules that check a cell is filled in, nearly all on PC3’s summary of selected financial data, and 5 that check ratios on the same page. They aren’t sums, so they’re left out.

What’s in the download

OSFI’s workbooks aren’t included. Download the PC1, PC2 and PC3 returns and their validation rules from OSFI’s Property and casualty (P&C) insurance return (2027) page. All six are Excel workbooks.

Build it

  1. Install the Quantemplate skills, version 1.0.0 or later, if you haven’t already. Then unzip the download.
  2. With Claude in Chrome signed in to Quantemplate, ask Claude Code:
    Build the OSFI P&C Insurance Return pipeline from the osfi-pc-return folder. Test it with the test returns and the clean returns and compare the results with the expected ones.
  3. Claude creates the three reference datasets, uploads the test returns, builds the 19 stages and checks the test returns and the clean ones. This takes around 5 minutes.

The agent builds through the Quantemplate app’s own API in your browser. That API isn’t published, so if a release changes it, the build stops and tells you what went wrong. Review what the agent builds before you rely on it.

Using your own returns

Contact the Quantemplate support team, or use your AI agent, to build custom logic for your use case.

Limits