During a live Salesforce Chat session we want to allow agents to view anything that is typed by a visitor. However to remain compliant we don't want certain sensitive content to be viewable or accessible in the saved transcript.
Sensitive Data Rules don't seem to help here since they mask content even in the agent's chat window (unless I understood this wrong). So I am thinking to write a trigger on before-insert of
LiveChatTranscript and remove sensitive content from the
Body just as the record is about to be committed. What I'm wondering is, will this also impact the agent's view of the chat? In other words, do chat transcripts get saved to the database every time a new message is sent, or, are they stored in memory until the chat has ended before being committed at once?
If this doesn't work what options do we have to allow an agent to accept sensitive content during a chat session without compromising compliance? I have looked at the Deployment API and couldn't find a suitable way to do this. The Pre-Chat customization doesn't work since sensitive content need to be collected upon request of an agent. The Post-Chat customization doesn't work either because the agent would otherwise have to look at the saved transcript to view the sensitive content.