OSFI Life Insurance Return checks

Insurance Canada

Checks the Life Insurance Return a Canadian life insurer or fraternal benefit society files with OSFI, the quarterly LF1 and the annual LF3, against OSFI’s own 2,350 validation rules: every total on a page, every tie between pages and every tie between the two 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 Life Insurance Return for 2027: the LF1 and LF3 return workbooks, and OSFI’s validation rules for LF1 (version 15) and LF3 (version 13)

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

See it in Quantemplate

The pipeline

The OSFI Life 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 9,762 rows and OSFI rules checked with 3,848.

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 CR0018 in LF1’s rules is out by 40, and its twin, CR0006 in LF3’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 LF Rules lists each rule, and OSFI LF 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
LF1, quarterly, rules version 15
1,443
39
10
LF3, annual, rules version 13
848
0
10

The rules across returns tie LF1 to LF3, so they’re checked when an insurer gives both returns for the same reporting end date. OSFI’s files also have 98 LF1 rules that read the LF2 capital return, which isn’t covered, and 9 LF3 rules that read a line no longer on page 45.060. Those are left out.

What’s in the download

OSFI’s workbooks aren’t included. Download the LF1 and LF3 returns and their validation rules from OSFI’s Life Insurance Return 2027 page. All four 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 Life Insurance Return pipeline from the osfi-life-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 4 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