How to allow sensitive data to be displayed on screen but not saved to file?

I found a related idea in:

You could try overriding the ContentsManager which handles saving/loading notebooks:
https://jupyter-server.readthedocs.io/en/latest/developers/contents.html#writing-a-custom-contentsmanager