Domain 3: AI Safety, Security, and Governance
This lesson covers 5 exam topics: Input and Output Safety Controls, Hallucination Controls and Defense in Depth, Data Security and Privacy for GenAI, AI Governance, Lineage and Compliance, Responsible AI: Transparency and Fairness. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.
1. Input and Output Safety Controls
Central question: How do you stop harmful inputs reaching the model, and harmful outputs reaching users?
Bedrock Guardrails
- Policies: content filters (hate, insults, sexual, violence, misconduct, prompt attack), denied topics, word filters, sensitive information filters (block or mask PII, custom regex), contextual grounding checks, Automated Reasoning checks.
- Evaluate inputs and outputs; a blocked input returns a configured message and the model is not called.
- Use with Bedrock models, Agents and Knowledge Bases, or standalone with the ApplyGuardrail API (for example for models hosted elsewhere).
- Input tagging: with InvokeModel, XML tags mark which part of the prompt (for example the user query, not trusted system text or retrieved docs) guardrails evaluate; with Converse, use the content-block guardrail configuration. Saves cost and latency.
Custom moderation (guide examples)
- Step Functions + Lambda for custom moderation workflows and real-time validation.
- Specialised FM evaluations for toxicity detection.
- Text-to-SQL to get deterministic results from data instead of free text when answers must be exact.
Exam traps
- Running guardrails on the whole RAG prompt including trusted documents, when tagging the user input is cheaper and more accurate.
- Assuming guardrails only work inside Bedrock: ApplyGuardrail works standalone.
- Free-text answers for exact figures when a query against the database is deterministic.
2. Hallucination Controls and Defense in Depth
Central question: How do you keep answers accurate, and layer protections so one failure isn't fatal?
Accuracy verification (3.1.3; verified where linked)
| Control | How |
|---|---|
| Grounding with Knowledge Bases | Answer from retrieved sources; cite them; fact-check claims against retrieval |
| Contextual grounding check | Guardrails flag responses not grounded in the source or irrelevant to the query, using thresholds |
| Automated Reasoning checks | Validate responses against logical rules; detect hallucinations, suggest corrections |
| Confidence scoring, semantic similarity | Compare the answer with sources; route low scores to a person |
| JSON Schema / structured outputs | Constrain responses to a schema |
Defense in depth (3.1.4; guide examples)
- Pre-processing: Amazon Comprehend filters (PII, toxicity, language), input sanitisation.
- Model-based guardrails: Bedrock Guardrails on input and output.
- Post-processing validation: Lambda checks format, facts, policy.
- API response filtering: API Gateway layer before the client.
Threat detection (3.1.5; general background plus guide)
Prompt-injection and jailbreak detection, input sanitisation, safety classifiers, and automated adversarial testing (red-teaming in CI) before every release.
Exam traps
- A single guardrail as the only protection.
- Lower temperature as the hallucination fix.
- No adversarial testing before launch.
3. Data Security and Privacy for GenAI
Central question: How do you isolate GenAI workloads and protect sensitive data end to end?
Protected environments (3.2.1; verified where linked)
- VPC endpoints (AWS PrivateLink) to reach Bedrock privately, with no internet gateway or NAT.
- IAM policies for least-privilege data and model access.
- AWS Lake Formation: fine-grained access control for data lake data in S3 and its Glue Data Catalog metadata, with grant/revoke permissions that augment IAM.
- CloudWatch to monitor data access.
Privacy-preserving systems (3.2.2, 3.2.3)
| Need | AWS |
|---|---|
| Detect PII in text | Amazon Comprehend PII detection |
| Find PII in S3 | Amazon Macie |
| Mask PII in prompts and responses | Bedrock Guardrails sensitive information filters |
| Bedrock privacy | Inputs and outputs not used to train base models, not shared with providers; encrypted; fine-tuning uses a private copy (verified) |
| Retention | S3 Lifecycle configurations to expire or archive data |
| Masking, anonymisation | Replace identifiers before data reaches the model (design guidance) |
Exam traps
- Public endpoints for a regulated workload when PrivateLink is required.
- Sending raw PII to the model when masking before the call keeps utility.
- Keeping logs forever: use S3 Lifecycle.
4. AI Governance, Lineage and Compliance
Central question: Can you prove where data came from, how models behave, and that policy is enforced?
Compliance frameworks (3.3.1)
- SageMaker AI programmatic model cards: document intended use, risk rating, training and evaluation; versions are immutable (verified).
- AWS Glue to track data lineage automatically.
- Metadata tagging for source attribution.
- CloudWatch Logs for decision logs.
Data source tracking (3.3.2)
- AWS Glue Data Catalog to register data sources.
- Metadata tags so generated content can cite its source.
- AWS CloudTrail for audit logging of API activity.
Organisational governance (3.3.3; design guidance)
Frameworks aligned with policy, regulation and responsible-AI principles: owners, approval gates, review cadence, model inventory.
Continuous monitoring (3.3.4; guide examples)
Automated detection of misuse, drift and policy violations; bias drift monitoring; automated alerting and remediation; token-level redaction; response logging (Bedrock model invocation logging, off by default — verified); AI output policy filters (guardrails).
Exam traps
- Documenting models only in wikis instead of model cards.
- No source attribution, so content can't be traced.
- Assuming invocation logging is on.
5. Responsible AI: Transparency and Fairness
Central question: Can users see why the system answered, and is it fair and policy-compliant?
Transparency (3.4.1)
- Reasoning displays: user-facing explanations.
- Evidence presentation: citations for source attribution (Knowledge Bases citations — verified).
- Confidence metrics in CloudWatch to quantify uncertainty.
- Agent tracing: Bedrock Agents traces show the reasoning process at each orchestration step; AgentCore Observability traces each step for AgentCore agents (verified).
Fairness evaluations (3.4.2)
- Pre-defined fairness metrics tracked in CloudWatch.
- Systematic A/B testing with Prompt Management variants and Bedrock Flows.
- LLM-as-a-judge automated evaluations in Bedrock (verified).
- Compare outputs when only a demographic attribute changes (design guidance).
Policy compliance (3.4.3)
- Bedrock Guardrails configured from policy requirements.
- Model cards to document FM limitations.
- Lambda automated compliance checks on outputs.
Exam traps
- Hiding sources when users must verify answers.
- Testing fairness once instead of continuously.
- Guardrails without documented policy mapping.
References
- AIP-C01 Domain 3 — checked Oct 19, 2026
- Bedrock Guardrails — checked Oct 19, 2026
- Guardrails input tagging — checked Oct 19, 2026
- Contextual grounding check — checked Oct 19, 2026
- Automated Reasoning checks — checked Oct 19, 2026
- Structured outputs — checked Oct 19, 2026
- Bedrock PrivateLink — checked Oct 19, 2026
- AWS Lake Formation — checked Oct 19, 2026
- Amazon Macie — checked Oct 19, 2026
- Bedrock FAQs — checked Oct 19, 2026
- SageMaker Model Cards — checked Oct 19, 2026
- Model invocation logging — checked Oct 19, 2026
- CloudTrail — checked Oct 19, 2026
- Bedrock agent trace — checked Oct 19, 2026
- LLM as a judge — checked Oct 19, 2026
Check your understanding
Apply Bedrock Guardrails to a model hosted on SageMaker AI?Show answerHide answer
Answer
ApplyGuardrail API.RAG answer adds facts not in the sources. Guardrail?Show answerHide answer
Answer
Contextual grounding check.Fine-grained table and column access to data lake data used for RAG?Show answerHide answer
Answer
Lake Formation.Register data sources centrally?Show answerHide answer
Answer
AWS Glue Data Catalog.Show users the documents behind an answer?Show answerHide answer
Answer
Citations (evidence presentation).