AIP-C01 · LESSON 3

AI Safety, Security, and Governance20% · 4 topics

Learn input and output safety controls, data security and privacy, AI governance and compliance, and implementing responsible AI principles.

3.1Input and output safety controls

3.1 Implement input and output safety controls.

Concept

Bedrock Guardrails apply content filters (hate, insults, sexual, violence, misconduct, prompt attacks), denied topics, word filters, sensitive information filters (blocking and masking PII), contextual grounding checks (detecting hallucinations by checking grounding and relevance) and Automated Reasoning checks (rule-based logical verification) to input and output. They can also be used independently of model invocation via the ApplyGuardrail API.

How it works / steps

  1. Decide the needed filters and strengths from the use case's risks
  2. Detect jailbreaks and injection with the prompt attack filter
  3. Define denied topics (such as investment advice)
  4. In RAG, stop ungrounded answers with grounding checks
  5. Apply guardrails to input and output of non-Bedrock models with ApplyGuardrail

Workplace example

In an insurance consultation chat, set individual investment advice as a denied topic, and block answers with grounding checks when they stray from the knowledge base sources.

Common confusions and exam tips

Mini quiz

Q1. You want to verify that answers to HR policy questions do not logically contradict the policy rules. Which feature is most appropriate?

  1. Limit answers to a short length so there is no room for contradictions
  2. Lower the temperature to mathematically guarantee answers never contradict the policy rules
  3. Use Guardrails Automated Reasoning checks to verify answers against a policy built from the rules
  4. Set content filter strength to maximum to stop answers that contradict the policy
Show answer and explanation

Answer: C Use Guardrails Automated Reasoning checks to verify answers against a policy built from the rules

Automated Reasoning checks formally verify answer correctness using a logical policy built from documents.

Q2. You want to keep competitors' product names and words your company does not use out of answers. Which setting is most appropriate?

  1. Register each product name letter by letter as separate denied topics
  2. Register a list of words to block in the guardrail word filter
  3. Set the hate category of the content filter to maximum to block the words
  4. List the product names in the system prompt so the model memorizes them
Show answer and explanation

Answer: B Register a list of words to block in the guardrail word filter

The word filter blocks inputs and outputs containing specified words or profanity.

Reference links

3.2Data security and privacy controls

3.2 Implement data security and privacy controls.

Concept

In Bedrock, prompts and responses are not shared with model providers and are not used to train foundation models. Customers protect data with encryption using KMS customer managed keys (custom models, knowledge bases, agents), VPC endpoints, restricting model use with IAM condition keys, detecting sensitive information in training data with Macie, and masking PII with guardrails.

How it works / steps

  1. Classify data and decide which models and Regions may handle it
  2. Limit usable models with IAM policies
  3. Encrypt stored data with customer managed keys
  4. Call through VPC endpoints without going over the internet
  5. Detect and mask PII and keep it out of logs too

Workplace example

For summaries of customer inquiries, mask phone numbers and email addresses with guardrails, and encrypt custom models and knowledge bases with customer managed keys.

Common confusions and exam tips

Mini quiz

Q1. Before embedding chat text, you want to detect and remove personal information in real time. Which service is most appropriate?

  1. AWS Glue crawler
  2. Amazon Rekognition image label detection
  3. Amazon Comprehend PII detection
  4. Amazon Polly speech synthesis
Show answer and explanation

Answer: C Amazon Comprehend PII detection

Amazon Comprehend detects the type and location of PII in text.

Q2. Which statement about data protection and governance for generative AI is incorrect?

  1. An interface VPC endpoint lets you call Bedrock without going over the internet
  2. A KMS customer managed key can encrypt custom models
  3. CloudTrail can record Bedrock API operations
  4. Prompts sent to Bedrock are shared with model providers by default and used for training
Show answer and explanation

Answer: D Prompts sent to Bedrock are shared with model providers by default and used for training

Bedrock does not share prompts or responses with model providers and does not use them to train foundation models.

Reference links

3.3AI governance and compliance mechanisms

3.3 Implement AI governance and compliance mechanisms.

Concept

Governance mechanisms include model invocation logging (recording prompts and responses to S3 or CloudWatch Logs), CloudTrail (recording API operations), controlling usable models with SCPs and IAM, tags and cost allocation, version and approval management for models and prompts, and documentation (such as Model Cards).

How it works / steps

  1. Enable model invocation logging and decide the retention period
  2. Allow only models approved by the organization with SCPs
  3. Manage prompt and model versions and record change approvals
  4. Make usage and cost visible per department with tags
  5. Audit regularly and confirm regulatory requirements are met

Workplace example

To meet audit requirements, keep model invocation logs in encrypted S3 for one year, and deny InvokeModel for unapproved models with an SCP.

Common confusions and exam tips

Mini quiz

Q1. You want to prevent every account in the organization from calling any model other than approved ones. Which method is most appropriate?

  1. Check invocation logs once a month and warn violators
  2. Ask in the system prompt that unapproved models not be used
  3. Email users in each account a list of approved models
  4. Use an AWS Organizations SCP to deny calls to models other than approved ones
Show answer and explanation

Answer: D Use an AWS Organizations SCP to deny calls to models other than approved ones

An SCP sets the maximum permissions available across all accounts in an organization. You can deny with conditions on the model ARN.

Q2. You want every model call to use a specified guardrail, even if a developer forgets to add it. Which method is most appropriate?

  1. Deny calls without the specified guardrail with the IAM condition key bedrock:GuardrailIdentifier
  2. Attach the guardrail on every call through a shared SDK wrapper
  3. Check CloudTrail logs and notify about calls without guardrails
  4. Share the guardrail ID with all teams and document how to attach it
Show answer and explanation

Answer: A Deny calls without the specified guardrail with the IAM condition key bedrock:GuardrailIdentifier

With the IAM condition key bedrock:GuardrailIdentifier, you can allow only inference that uses a specific guardrail. [Other options] Direct calls that skip the wrapper aren't stopped. CloudTrail checks detect after the fact. Sharing and documentation don't prevent omissions.

Reference links

3.4Implement responsible AI principles

3.4 Implement responsible AI principles.

Concept

Implement the AWS dimensions of responsible AI (fairness, explainability, privacy and security, safety, controllability, veracity and robustness, governance, transparency) through evaluation (bias and harmfulness testing), guardrails, human review, disclosure to users and continuous monitoring.

How it works / steps

  1. Identify the use case's risks and the people affected
  2. Evaluate quality differences across attributes and harmful outputs
  3. Mitigate risks with guardrails and human review
  4. Disclose AI use and its limitations to users
  5. Monitor production complaints and feedback and improve

Workplace example

For summaries of job application documents, evaluate whether summary quality changes with applicant attributes, and state clearly that a person always makes the final decision.

Common confusions and exam tips

Mini quiz

Q1. You want to increase transparency in a chat for external customers. Which response is most appropriate?

  1. Indicate that answers are AI-generated, and show source documents and how to switch to a human agent
  2. Make switching to a human agent impossible and handle everything with AI only
  3. Treat answer sources as internal secrets and never show them to users even when citable documents exist
  4. Hide that AI is answering and make it look as if a human agent is responding
Show answer and explanation

Answer: A Indicate that answers are AI-generated, and show source documents and how to switch to a human agent

For transparency, show that it is AI, show the basis, and leave a path to consult a human.

Q2. For an assistant that summarizes job application documents, you want to check whether summaries change based on applicants' gender or age. Which method is most appropriate?

  1. Compare outputs on input pairs that differ only in attributes, and keep tracking the gap as a metric
  2. Remove gender and age columns before summarizing, and evaluate before launch
  3. Have developers compare sample résumés and call it fair if no bias appears
  4. Register discriminatory expressions as guardrail denied topics
Show answer and explanation

Answer: A Compare outputs on input pairs that differ only in attributes, and keep tracking the gap as a metric

Comparing outputs for input pairs that differ only in attributes makes bias easier to find. Evaluate continuously. [Other options] Removed attributes can still be inferred from names, and there's no ongoing evaluation. Guardrails stop harmful content but don't measure summary differences. A few manual reads aren't reproducible.

Reference links

Lessons are written by this site based on public information and do not guarantee exam content. Product specifications change, so check the latest information at the reference links.

Notes (unofficial, original questions, no pass guarantee)