Describe the bug
Redaction is checked on all keys in request/response objects outside the specific exclusion of FirstSeen and LastSeen, this can lead to invalid data and failed import to OpenSearch. Adding more keys to the exclusion list is possible but there are potentially over 100 keys that would need to be added to the list to cover all scenarios.
To Reproduce
Comprehend needs to identify PII. Seems most impactful when it identifies a single digit/character or a common element (like QID). This appears to only show up in higher volume usage.
Expected behavior
User input should be redacted when enabled, but bot information, session IDs, timestamps, and settings should be skipped.
Please complete the following information about the solution:
Screenshots
Comprehend identified '2' as a problematic digit:

All 2's were redacted out of other string fields (with the exception of FirstSeen and LastSeen):

The invalid date caused error importing into OpenSearch:

Additional context
Solution appears to use Comprehend to analyze the input transcript/question for the specific locations with detected PII, then stores the strings at those locations as regex capture groups in an environment variable. Regex then uses this env variable to redact data in all fields. So if Comprehend recognizes "QID" as PII that QID is then removed from all string values within request and response.
Describe the bug
Redaction is checked on all keys in request/response objects outside the specific exclusion of FirstSeen and LastSeen, this can lead to invalid data and failed import to OpenSearch. Adding more keys to the exclusion list is possible but there are potentially over 100 keys that would need to be added to the list to cover all scenarios.
To Reproduce
Comprehend needs to identify PII. Seems most impactful when it identifies a single digit/character or a common element (like QID). This appears to only show up in higher volume usage.
Expected behavior
User input should be redacted when enabled, but bot information, session IDs, timestamps, and settings should be skipped.
Please complete the following information about the solution:
Screenshots



Comprehend identified '2' as a problematic digit:
All 2's were redacted out of other string fields (with the exception of FirstSeen and LastSeen):
The invalid date caused error importing into OpenSearch:
Additional context
Solution appears to use Comprehend to analyze the input transcript/question for the specific locations with detected PII, then stores the strings at those locations as regex capture groups in an environment variable. Regex then uses this env variable to redact data in all fields. So if Comprehend recognizes "QID" as PII that QID is then removed from all string values within request and response.