Chat History PII Redaction

Chat History PII Redaction

AWS Comprehend-based PII redaction for messages

Note the following features are available for redaction under different circumstances:

  • Messenger Redaction - allows for regex-based redaction at the edge of the messenger.
  • Virtual Assistant Ingress Pipeline Redaction - allows for regex-based redaction at the edge of the virtual assistant, just as messages come in.
  • Secure Input - allows for a sensitive user message to be sent as-is without being stored in chat history. Can be used while chat history PII redaction is on for select user entries, though chat history PII redaction will not be applied to the message due to it being sent through secure input instead of going to chat history as normal. See here for more details.

Overview

Chat history PII redaction is a feature which automatically passes all message content that gets stored in chat history through AWS Comprehend to detect and redact personally identifiable information (PII) from chat messages, preventing it from being stored in the chat history database. It is available for English and Spanish languages.

Messages which do not get stored in chat history (e.g. secure input) are not subject to chat history PII redaction.

Please note that AWS Comprehend is a best-effort service and is not 100% accurate at all times. We strongly advise testing your bot thoroughly to ensure that PII redaction is working as expected before your bot goes live.

Tip

This feature is disabled by default for organizations. To enable it, please contact ServisBOT support.

See Customization below for more information on how this feature can be configured.

How it applies

Sensitive content such as names, email addresses, phone numbers, identification numbers, and other personal data are replaced with a placeholder specifying the type of PII detected, for example, Yes I would like to change my contact details. Please update my contact email to be my-new-user-email@gmail.com and my phone to be +1234567890. would be redacted to Yes I would like to change my contact details. Please update my contact email to be [REDACTED_EMAIL] and my phone to be [REDACTED_PHONE_NUMBER].

  • The redaction itself happens at the storage boundary i.e. immediately before the message is stored in the chat history database.
  • At the same time, the original message is sent to the messenger for display to the user. This is a non-redacted version of the message stored in memory, and is not persisted; on refresh, the non-redacted message is discarded and the redacted version is pulled from chat history.

Customization

Whitelist

Chat history PII redaction is performed by AWS Comprehend, which categorizes PII into a number of different types.

  • An organization can be configured with a whitelist of certain PII categories, which will prevent them from being redacted.
  • For example, if an organization whitelists the EMAIL category, then email addresses will not be redacted from chat messages, while other PII categories will still be redacted e.g. 'Yes I would like to change my contact details. Please update my contact email to be my-new-user-email@gmail.com and my phone to be +1234567890.' would be redacted to 'Yes I would like to change my contact details. Please update my contact email to be my-new-user-email@gmail.com and my phone to be [REDACTED_PHONE_NUMBER].'.

Tip

To whitelist one or more PII categories, please contact ServisBOT support and provide a list of AWS Comprehend PII categories to not redact and we will configure your organization accordingly.

You can see the full list of PII categories that AWS Comprehend can detect in the AWS Comprehend documentation page.

Ignoring PII Redaction for Select Bot Messages

Because chat history PII redaction is enabled at the organization level, it will apply to all messages from the user and bot.

In some cases, this redaction may not be desired e.g. when the bot provides contact information for its business or any other information that is safe to share publicly. For these cases, you can skip PII redaction for the message by enabling the Skip PII Redaction checkbox in either the flow node or intent fulfillment action that sends the message, markup, or markdown content.

Note

Only bot messages can skip PII redaction, not user messages, as what a user sends is inherently arbitrary and can never be trusted not to contain PII.

  • Note that in flows, the last user message is still available within the msg object to use as usual e.g. for fetching data, like sending a specific CMS item or calling an API through an api-connector node and using the user message as a parameter.
  • Alternatively, you may use Secure Input to collect sensitive user input without storing it in chat history and without having the content be available directly in the flow. When secure input is used, chat history PII redaction is not applied as the content never reaches the chat history database.
    • Here, the flow only has access to an unresolved SRN of the message that passed through secure input - this SRN can still be passed into an api-connector node for use, where it gets dereferenced only within the BaaS API call, outside of the flow’s reach. The resolved data is only used to make the API call and is not persisted anywhere outside of secure input’s Enigma.

Caution

We strongly recommend skipping PII redaction only for bot messages which meet the following criteria:

  • The content is deterministic i.e. does not echo any user input, does not include text from an LLM response; something hard-coded into the bot.
  • It only contains information that is safe to share publicly, such as contact information for a business.

Example of hard-coded message content that is safe to not redact: 'Please contact us at hello@servisbot.com, or call us at +1234567890.'

An example of a message that should not skip PII redaction due to templating in user-specific content is: 'Thank you for your confirmation - your email address end-user-email@gmail.com has been added to our mailing list.'

Flow

In flows, you can skip PII redaction within the following nodes by enabling the Skip PII Redaction checkbox in the node’s configuration panel:

  • Dialogue
  • Markup
  • Interaction
  • Markdown

Intent Fulfillment Action

The following intent actions can skip PII redaction by enabling the Skip PII Redaction checkbox for any of the following actions:

  • Send Message
  • Send Markup
  • Send Markdown
Last updated on