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.
| Data | Where it appears | How to mask | What to preserve |
|---|---|---|---|
| PESEL (Poland's national ID number) | policies, claims, CRM, payments | generate a new, valid number | birth date or age band, sex, check digit |
| Name and address | everywhere | dictionary of fictitious names and addresses | province and rating zone from the postal code |
| Payout bank account | claims, surrenders, refunds | a test account number with a valid checksum | format and bank, where it affects the process |
| VIN and registration number | motor insurance | a new identifier in the same format | make, model, year, vehicle type |
| Health data | life, personal accident, health insurance | remove or replace with synthetic data | benefit type code, amount, date |
| Claim description | claim reports, adjuster notes | replace names and numbers in the text | length, language, structure |
| Photos and scans | claims, applications | swap for template files | number, type and size of files |
| Beneficiaries and third parties | life, liability | same as customer data | relationship 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:
- 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.
- Synthetic text: replace the whole description with text of similar length and structure, generated from templates for each claim type.
- 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.
- Field catalog: a list of tables, columns, files and text fields with personal data in each system, with a masking rule for each.
- Masking inside the production zone: data leaves production already masked, and keys and mapping tables stay there.
- Subset selection: not the whole portfolio but a consistent slice, for example policies from selected months with all their claims, payments and documents.
- Output checks: a scanner looks for real values, and smoke tests confirm that rating and claims work on masked data.
- Refresh: a fixed schedule, for example before each major release, with the same set of rules.
- 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.