Session replay that never records what it should not

How Neural records sessions without capturing passwords, card numbers or personal data: masking in the browser, before anything leaves the page.

Callum Pryce

Staff Engineer

A white database icon on a dark navy dithered field

Session replay is the feature people love most and worry about most. Watching a user struggle with a form explains a drop-off faster than any chart. It also means a recording of someone’s screen, and screens contain passwords, addresses and card numbers.

Our position is simple: sensitive data should never leave the user’s browser. Not encrypted, not hashed, not “deleted later”. This post explains how replay works and where the masking happens.

Replay is not video

A Neural replay is not a screen recording. The SDK takes a snapshot of the page structure when the session starts, then records every change to it: nodes added and removed, attributes changed, text updated, the mouse moving, the page scrolling.

In the dashboard, the player rebuilds the page from those changes. That is why a replay is small, about 180 KB per minute on an average web app, and why it stays sharp at any zoom level.

It is also why masking can work properly. Because we record structure, not pixels, we can decide for each node what to keep before it is ever serialised.

What is masked by default

Out of the box, without any configuration:

Content

What is recorded

All <input>, <textarea>, <select> values

Replaced with * of the same length

Password and card number fields

Not recorded at all, not even length

Text matching email, phone or card patterns

Replaced before it leaves the page

<img> and <video> sources on elements marked private

Replaced with a grey block

Network request and response bodies

Not recorded; only URL, method, status, timing

Everything happens in the SDK, in the browser. The masked text is what gets sent. There is no unmasked copy on our servers to leak, subpoena or misconfigure.

Marking your own private areas

Default rules cannot know that your dashboard shows bank balances or medical notes. For that, add a class or attribute to any element:

<section class="neural-mask">
  <!-- every piece of text in here is masked -->
</section>

<div data-neural-block>
  <!-- not recorded at all; shows as an empty box in replay -->
</div>
<section class="neural-mask">
  <!-- every piece of text in here is masked -->
</section>

<div data-neural-block>
  <!-- not recorded at all; shows as an empty box in replay -->
</div>
<section class="neural-mask">
  <!-- every piece of text in here is masked -->
</section>

<div data-neural-block>
  <!-- not recorded at all; shows as an empty box in replay -->
</div>
<section class="neural-mask">
  <!-- every piece of text in here is masked -->
</section>

<div data-neural-block>
  <!-- not recorded at all; shows as an empty box in replay -->
</div>

neural-mask keeps the layout and replaces text with placeholder characters, so you can still see that someone clicked the third row. data-neural-block removes the element entirely, which is the right choice for embedded third-party content like payment forms.

Some customers flip the default and mask all text everywhere, then unmask specific areas they know are safe. That takes one setting, maskAllText: true, and is the setup we recommend for healthcare and finance.

Testing that it works

Masking that you cannot verify is a policy, not a control. Two tools help:

  1. Privacy preview. In replay settings, open any page of your app in preview mode and see exactly what the SDK would record, with masked regions highlighted.

  2. Pattern alerts. If an unmasked string that looks like an email or a card number ever arrives in a replay, despite the in-browser rules, the session is quarantined and project admins get an alert. In the last 90 days this triggered on 0.002% of sessions, nearly all of them from canvas elements that drew text.

What we never record

Some things are off regardless of configuration:

  • Keystrokes as keystrokes. We record that a field changed, not the sequence of keys.

  • Anything inside cross-origin iframes.

  • Clipboard contents.

  • Browser extensions’ injected content.

Retention and access

Replays are stored in the region you chose for your project, EU or US, and kept for 30 days on the free plan and up to 12 months on paid plans. You can set a shorter period.

Access is a separate permission from analytics. Many teams give everyone access to charts, and replay only to product, design and support. Every time someone opens a replay, it is logged in the audit trail with who watched it and when.

If you would not be comfortable showing a recording to the user it belongs to, it should not be recorded.

That is the test we hold ourselves to. Masking in the browser is how we pass it.

session replay

privacy

security

Portrait of Callum Pryce

Written by

Callum Pryce

Staff Engineer

Keep reading

Buy template

Create a free website with Framer, the website builder loved by startups, designers and agencies.