A financial services company is deploying a generative AI application that uses Amazon Bedrock to answer employee questions about internal policies. The security team requires that the application automatically redact personally identifiable information (PII) such as account numbers and social security numbers from both user prompts and model responses, without modifying the underlying foundation model. Which AWS service should be integrated into the application's request and response pipeline to meet this requirement?
Amazon Comprehend provides real-time PII detection and redaction through its ContainsPiiEntities and DetectPiiEntities APIs. By calling these APIs in the application pipeline before sending prompts to Bedrock and after receiving completions, the team can redact sensitive entities such as SSNs and account numbers without altering the foundation model itself. This satisfies the inline redaction requirement.
Why this answer
Amazon Comprehend offers purpose-built PII detection and redaction APIs that can be invoked synchronously within an application's request and response flow. Integrating it before Bedrock invocation and after completion generation ensures sensitive data is masked without retraining or modifying the foundation model. The other services address storage classification, audit logging, or threat detection, none of which provide inline content redaction for generative AI payloads.
Exam trap
The trap here is assuming that a data classification or audit service can perform inline redaction, when only Amazon Comprehend provides real-time PII detection and masking APIs for application payloads.