Skip to content
AWS Certified AI Practitioner (AIF-C01) Exam Prep

Lesson 32 of 34 · 6 min

x
32/34

AI Security Threats, Hallucination Detection and Grounding

Video lesson: AIF-C01 32/34: AI Security Threats, Hallucination Detection and Grounding

Security and privacy considerations (named in the guide)

ConsiderationWhat to do (design guidance; AWS services verified)
Application securitySecure the app around the model: authentication, input validation, least privilege
Threat detectionMonitor for abuse and unusual activity (CloudTrail logs, CloudWatch alarms)
Vulnerability managementScan workloads: Amazon Inspector scans EC2, container images in ECR and Lambda for software vulnerabilities
Infrastructure protectionVPCs, PrivateLink, security groups
Prompt injectionSeparate instructions from untrusted input; Guardrails Prompt Attack filter
Encryption at rest and in transitKMS; TLS
Data leakage preventionDon't put secrets in prompts; Guardrails sensitive information filters; scope retrieval permissions
Output filtering and validationGuardrails on responses; check structure and values before acting
Audit trail and loggingCloudTrail for API calls; Bedrock model invocation logging to CloudWatch Logs or S3 (off by default; you turn it on)
ToxicityGuardrails content filters; evaluation of toxicity

Hallucination detection and grounding (named in the guide)

MethodHow
RAG groundingAnswer from retrieved, trusted documents, with citations (20)
Contextual grounding checks (Bedrock Guardrails)Flag or block responses not grounded in the source or not relevant to the query (verified)
Automated Reasoning checks (Bedrock Guardrails)Validate responses against logical rules you define (verified)
Output validationCheck facts, numbers and formats against systems of record
Confidence scoringUse scores (e.g. grounding scores, model confidence) to route low-confidence answers to a human

Exam traps

  • Invocation logging is on by default. It's disabled until you enable it.
  • Lowering temperature as the hallucination fix. Grounding and checks are the fix.
  • Inspector for prompt injection. Inspector scans software vulnerabilities; prompt attacks need Guardrails and design.

References

  1. Bedrock Guardrails — checked Oct 19, 2026
  2. Bedrock model invocation logging — checked Oct 19, 2026
  3. Amazon Inspector — checked Oct 19, 2026
  4. AWS CloudTrail — checked Oct 19, 2026

Check your understanding

  • You must keep a record of every prompt and response for audits. Feature?Show answer

    Answer

    Bedrock model invocation logging (to CloudWatch Logs or S3).
  • A RAG answer contains a number not in any retrieved document. Which check catches it?Show answer

    Answer

    Contextual grounding check.
  • Who records which IAM role called the model API?Show answer

    Answer

    AWS CloudTrail.
Previous

Progress is saved in this browser.

Next Lesson