Docs

Kaloko

Download
Markdown with pictures (.zip)Docusaurus folder (.zip)VitePress folder (.zip)MkDocs folder (.zip)Offline HTML (.zip)PDFChangelog as JSON
Pages

Hide personal data in captures

Walking a copy of production, or reading production pages, puts real names and e-mail addresses in front of the browser. Kaloko can hide them in everything a step stores: the screenshot, the captured HTML, the page outline the evaluators read, traces, recordings and captured e-mails. Checks still run against the real page, so a criterion like "the summary shows the name from the form" keeps its verdict.

Mask what you know

List the elements that hold personal data under capture.mask, on the scenario or on a single step:

capture:
  mask: [".customer-name", "[data-qa=email]", ".payer"]

The scenario's masks and the step's add up. In the screenshot each element gets a dark striped box. In the HTML its text becomes [hidden] padded to the same length ([skryto] in Czech runs), so the layout of the copy holds. Form fields (hidden ones too), mailto: and tel: links, title, alt and data-* attributes are covered as well. Attributes nobody sees, such as data-*, change only in the stored HTML: the page itself never notices.

Let Kaloko find it

pii: redact on the scenario turns on detection for every step. It finds e-mail addresses, phone numbers (+420 and 00420 numbers, and the Czech 603 123 456 grouping next to a word like Telefon, Mobil or Kontakt), birth numbers (rodné číslo, with the checksum; the old nine-digit form and numbers without the slash only next to a label like RČ), IBANs and Czech account numbers, dates of birth next to a label, addresses with a postcode, and names in greetings ("Dobrý den, Jano,"). Amounts such as 250 000 000 Kč and order numbers are left alone. Form fields are recognised by their type, autocomplete and name. Values in URLs count too, also when they are encoded (jan%40firma.cz). capture: { mask: auto } does the same for one step.

Detection also reads text in open shadow DOM and in frames from the same origin. It cannot read closed shadow roots, frames from another origin, or text drawn into images and canvases: mask those elements by selector.

Values that look like personal data but are not, such as your support line, go under pii.allow in kaloko.config.yml. * matches any text:

pii:
  allow: ["info@acme.cz", "*@support.acme.cz", "+420 800 100 200"]

Fake values instead of boxes

pii: pseudonymize replaces personal data with made-up values: eva.svobodova42@example.com, +420 000 731 205, Petr Novák. One value gets the same stand-in everywhere in the run, and in every later run of the scenario, so screenshots compare pixel by pixel and approvals carry over. Two different values never share a stand-in. The screens stay readable for a client, and you can still see that the name typed into the form reached the summary and the confirmation e-mail. Fake phone numbers have 000 after the country code and fake birth numbers month 00, so nobody takes them for real ones.

The stand-in is picked by a hash of the value, the scenario and the project. It keeps far too little of the value to lead back to it. If you want a secret in the mix, set KALOKO_PII_SALT (the same one on every machine, or the stand-ins differ between your laptop and CI).

Values masked on one step are replaced on the later ones too, also when the next step runs in a new kaloko process: the run keeps them in .pii-known.json in its folder, which stays on your computer. Short values are not carried over, so a masked 2024 or Praha does not turn into a placeholder everywhere else.

E-mails

The recipients of a captured e-mail (To and Cc) are hidden whenever a step masks anything. For the greeting and the payer's details, mask their elements on the e-mail step (capture: { mask: [".greeting", ".payer"] }) or rely on detection. A text-only e-mail is covered by detection and by the values masked earlier in the run.

Require it on an environment

environments:
  production:
    base_url: https://shop.acme.cz
    pii: required

With pii: required, kaloko start creates no run unless the scenario says pii: redact or pseudonymize, or you start with --pii redact. pii: redact or pii: pseudonymize on the environment turns hiding on for every run there.

The check before sharing

kaloko share reads what it is about to upload. In a run that hides personal data (pii on the run, the scenario or the environment, or mask: auto), an unmasked e-mail, phone number, birth number or IBAN stops the upload, and Kaloko names the step and the element:

Not shared: the run holds 1 unmasked personal data value(s):
  summary (cs, desktop)  <p.contact>  email ja….cz

Mask it and capture the step again, or add it to pii.allow when it is not personal data. kaloko share --allow-pii uploads anyway. A run that does not hide personal data is uploaded, with the same list as a warning.

The site's own contacts do not count: e-mails on the domain of the environment, e-mails and phone numbers in the page footer, and those of an Organization or ContactPoint in JSON-LD. Neither do sample addresses like you@company.com, placeholder text and numbers in SVG drawings. To check the site's contacts like any other value, set pii: { site_contacts: false } in kaloko.config.yml. Screenshots and videos are not read: what covers them is the mask.

On the canvas

A run that hides personal data says so next to the environment ("Personal data hidden"). In the step detail the masked places are outlined in purple, with a note that a dark striped box is on purpose, not a bug in the app.

On this pageOn this page