Skip to content

Insurance test data: masking customer and claims data

B2Bnetwork team · · 6 min

IT in insurance

In brief

Insurers build test data from a production copy by masking it: personal data is replaced with fictitious values while everything calculations depend on is preserved, such as age, region, claims history, dates and the links between policy, claim and payment. Health data, free-text claim descriptions and attachments need separate handling. Masking must be deterministic, so the same customer gets the same substitute data in every system.

What is sensitive in insurance data

An insurer holds more kinds of personal data than a typical company, and some of them affect the premium or the payout decision. That is why masking that simply replaces everything with random characters breaks tests: the rating engine calculates a different premium and the claims system cannot find the policy.

DataWhere it appearsHow to maskWhat to preserve
PESEL (Poland's national ID number)policies, claims, CRM, paymentsgenerate a new, valid numberbirth date or age band, sex, check digit
Name and addresseverywheredictionary of fictitious names and addressesprovince and rating zone from the postal code
Payout bank accountclaims, surrenders, refundsa test account number with a valid checksumformat and bank, where it affects the process
VIN and registration numbermotor insurancea new identifier in the same formatmake, model, year, vehicle type
Health datalife, personal accident, health insuranceremove or replace with synthetic databenefit type code, amount, date
Claim descriptionclaim reports, adjuster notesreplace names and numbers in the textlength, language, structure
Photos and scansclaims, applicationsswap for template filesnumber, type and size of files
Beneficiaries and third partieslife, liabilitysame as customer datarelationship to the insured

A PESEL number encodes the date of birth, sex and a check digit, so systems reject a random number. A VIN has a fixed 17 character structure defined in ISO 3779, and some rating engines read the model year and manufacturer from it. Masking must generate values that pass the same validations as real ones.

Pseudonymization is not anonymization

The GDPR distinguishes pseudonymized data from anonymous data. Pseudonymization (Article 4(5)) means data cannot be attributed to a person without additional information kept separately. Such data is still personal data. Anonymous data, from which a person cannot be identified by reasonable means, falls outside the GDPR (Recital 26).

Deterministic masking, which always replaces the same PESEL with the same substitute, is pseudonymization if someone keeps the key or the mapping table. On top of that there is the risk of identifying someone from a combination of attributes: a rare car model in a small town and a claim on a specific date can point to a person without a name. A test environment with such data therefore needs access control and the security measures of Article 32 of the GDPR, like production, if on a smaller scale. General principles are covered in Test data and the GDPR, and methods for assessing re-identification risk in NIST SP 800-188.

Masking rules that do not break tests

Insurance tests run across several systems: rating, policy administration, claims, payments and the data warehouse. Masking must keep the whole chain consistent.

  • Determinism: the same customer gets the same substitute data in every system and on every refresh, so links do not break.
  • Rating attributes unchanged or within the same bands: driver age, zone from the postal code, claim-free years, bonus malus class.
  • Date shifts consistent for the whole policy: if the birth date moves by a few days, so do the policy and claim dates, and the age at inception stays the same.
  • Distributions and extreme values: masking must not flatten sums insured or remove very large claims, because those are what test limits and reinsurance.
  • Valid formats: PESEL, NIP (Polish tax ID), IBAN and VIN with correct checksums.

These rules matter especially when testing calculations, where results depend on age and dates, as described in How to test policy value calculations in life insurance.

Free text, documents and photos

The hardest part of claims data does not sit in columns. The incident description typed by the customer, the adjuster's note and the email body contain names, registration numbers, addresses and, in bodily injury claims, diagnoses. Health data is a special category of data (Article 9 of the GDPR) and should not reach test environments in a form that identifies a person.

There are three approaches, often combined:

  1. Replacement in text: find names, numbers and addresses (with dictionaries and patterns, sometimes a named entity recognition model) and replace them with the same substitute values used in the columns.
  2. Synthetic text: replace the whole description with text of similar length and structure, generated from templates for each claim type.
  3. Template documents: swap scans and photos for a set of test files of the same type, size and page count.

Replacement keeps the data realistic but is never perfect, so the result must be checked with a scanner looking for leftover PESEL numbers, plates and surnames. Synthetic text is safer but tests the features that read this text less well, such as search or automatic claim type recognition.

The process: from a production copy to a test environment

Masking is a process, not a one-off script. It works when it has an owner and a fixed rhythm.

  1. Field catalog: a list of tables, columns, files and text fields with personal data in each system, with a masking rule for each.
  2. Masking inside the production zone: data leaves production already masked, and keys and mapping tables stay there.
  3. Subset selection: not the whole portfolio but a consistent slice, for example policies from selected months with all their claims, payments and documents.
  4. Output checks: a scanner looks for real values, and smoke tests confirm that rating and claims work on masked data.
  5. Refresh: a fixed schedule, for example before each major release, with the same set of rules.
  6. Access and logging: a list of people with access to the environment and a record of who extracted data and when.

Masked data is also the basis for rehearsals when moving a portfolio to a new system, as described in Migrating a policy portfolio to a new system. We build the masking and refresh process together with test automation, because automated tests need stable, predictable data.

Questions and answers

Can you test on a full production copy if the environment is well secured?

The GDPR requires data minimization and security appropriate to the risk, so a full copy with real data is hard to justify when tests can run on masked data. Exceptions, such as diagnosing a bug that cannot be reproduced otherwise, are worth describing in a procedure with the scope, duration and list of people involved.

Can synthetic data replace masking?

Partly. Synthetic data is good for edge cases and for new products that have no policies yet. It does not reproduce the odd combinations from a portfolio built up over many years, which most often break migrations and calculations. In practice both are used: synthetic data for functional tests, masked data for regression and migration.

How long does it take to set up a masking process?

Most of the time goes into the field catalog and the rules for free text. With several systems, that is a few weeks of work for a small team, and after that each refresh takes hours rather than days. The process must be updated with every change in data structure, because a new column without a rule means a leak into testing.

What about personal data in logs and screenshots from tests?

Application logs in a test environment contain the same data as the database, so the same access and retention rules apply. Screenshots attached to bug reports should be taken only on masked data. When a bug was reproduced on real data, the report should not include a screenshot or an extract of the record.

Changing a policy or claims system? Talk to an engineer who knows insurance products.

Let's talk

Read more: IT in insurance

All in IT in insurance →