Course menuAIP-C01

Exams / AIP-C01 / Study guide / Protecting PII and sensitive data (Guardrails sensitive info filters, Macie, Comprehend)

Protecting PII and sensitive data (Guardrails sensitive info filters, Macie, Comprehend): AIP-C01 study notes and practice questions

What to know about Protecting PII and sensitive data (Guardrails sensitive info filters, Macie, Comprehend) for the AIP-C01 exam, from the AI Safety, Security, and Governance domain (20% of the exam guide), then 1 free question to test it. Part of the AIP-C01 study guide.

Last verified against current AWS documentation ·How we write our questions

What to know for the exam

AIP-C01 asks where personal data can leak in a generative system: user input, model output, source documents, training data and logs. Each leak point has its own control, and the exam expects you to match the control to the place where the data appears.

Guardrail sensitive information filters

Bedrock Guardrails sensitive information filters detect predefined PII entities, such as names, addresses, email addresses, phone numbers and account numbers, and custom regular expressions for formats your company uses, such as employee IDs. Each entity has an action:

  • Block rejects the request or response.
  • Mask (anonymize) replaces the value with a placeholder and lets the rest of the exchange continue.

Filters apply to input and output. Use mask when the user still needs an answer, and block when the data must never appear. See sensitive information filters.

Finding PII before ingestion

Amazon Macie scans Amazon S3 buckets and reports sensitive data it finds, including PII. Run it before a knowledge base sync, then remove the data, restrict the bucket or exclude the documents. Macie checks stored data, not live prompts, so it complements the guardrail rather than replacing it.

Redacting training data

Before fine-tuning, use Amazon Comprehend PII detection to find and redact personal data in training text. Keep the original data in restricted storage with its own access controls, and train only on the redacted copy.

Retention and data handling

Bedrock does not use your prompts or outputs to train models and does not share them with model providers. Your own stored copies are still your responsibility. Use S3 lifecycle rules to expire invocation logs and stored prompts automatically, and encrypt them with KMS. Pick a geographic cross-Region inference profile when data must stay within one geography. See data protection in Amazon Bedrock.

Logging hygiene

Redact personal data before it reaches application logs. Enable model invocation logging only where needed, and restrict who can read those logs. Logging raw input while masking the output still exposes the data.

How to choose

Scenario wording Choose
“Mask names in answers but still respond” Sensitive information filter with the anonymize action
“Find customer records already stored in S3” Amazon Macie
“Internal employee ID format must not appear” Custom regex entity in the guardrail
“Remove personal data from a fine-tuning dataset” Comprehend PII detection and redaction
“Old prompt logs must expire automatically” S3 lifecycle rule with KMS encryption

Common traps

  • Assuming Bedrock trains on your prompts. It does not.
  • Writing regex in application code and expecting it to catch every name or address. Use the guardrail’s managed PII entities.
  • Using Macie for live traffic. Macie scans stored data, not model calls.
  • Masking the answer but logging the unmasked prompt.
  • Keeping training data forever because it is redacted once. Keep the originals restricted and audited.

See also Audit and traceability.

Try the 1 practice question

An insurance company runs a claims assistant for its adjusters. Adjusters paste claim notes into the chat, and the assistant drafts replies using a model on Amazon Bedrock.

Generated replies sometimes repeat full Social Security numbers, card numbers and internal claim reference codes copied from the notes. Adjusters need the rest of each reply unchanged, and the company does not want an entire reply refused because of one value.

The control must mask Social Security and card numbers in every reply, and mask internal claim codes that follow a known format. The team accepts a small configuration change to its Converse calls but does not want to write or run any scanning code.

Which solution meets these requirements with the LEAST custom code?

Choose one answer.

  1. A. Add a system prompt that tells the model never to repeat numbers that look like personal identifiers, and have a supervisor check a random sample of replies each day for any values that leaked.
  2. B. Store every reply in an Amazon S3 bucket, run Amazon Macie on the bucket each night, and delete any object in which Macie finds personal data, so that stored records do not keep the identifiers.
  3. C. Attach a guardrail to the Converse calls with sensitive information filters set to ANONYMIZE for Social Security and card numbers and a custom regex for claim codes.
  4. D. Call Amazon Comprehend to detect personal data in each reply, and return a generic error message in place of any reply that contains a detected identifier, so that no personal data is shown.
Show the answer and explanation

Answer: C

  • A. Wrong: A prompt instruction is not an enforced control, and the model can still repeat identifiers in its reply. Daily sampling finds leaks after adjusters have already seen them, and it does nothing to mask the values.
  • B. Wrong: Macie finds sensitive data at rest in S3, so it works on stored replies after the fact. Adjusters would still see the raw values on screen, and deleting whole objects removes replies the team needs.
  • C. Right: The sensitive information filters replace matched values in the reply with placeholders, and the custom regex covers the internal claim format. The rest of each reply is returned unchanged, and the only change is the guardrail setting on the Converse calls. Learn more: Sensitive information filters in Amazon Bedrock Guardrails (opens in a new tab)
  • D. Wrong: Comprehend detects personal data well, but returning an error hides the whole reply, which the company does not want. It also adds a second service call and custom code in every application.

Explanation

Guardrail sensitive information filters can anonymize matched values in the reply, and a custom regex covers internal identifiers, so the rest of each answer is still returned. Prompt instructions and after-the-fact scans leave values visible, and replacing whole replies with errors removes useful content.

Study

Want more on Protecting PII and sensitive data (Guardrails sensitive info filters, Macie, Comprehend)? The 5 full-length practice sets have 6 more Protecting PII and sensitive data (Guardrails sensitive info filters, Macie, Comprehend) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets

Study Protecting PII and sensitive data (Guardrails sensitive info filters, Macie, Comprehend)

More AI Safety, Security, and Governance topics