AI Security Threats, Hallucination Detection and Grounding
Security and privacy considerations (named in the guide)
| Consideration | What to do (design guidance; AWS services verified) |
|---|---|
| Application security | Secure the app around the model: authentication, input validation, least privilege |
| Threat detection | Monitor for abuse and unusual activity (CloudTrail logs, CloudWatch alarms) |
| Vulnerability management | Scan workloads: Amazon Inspector scans EC2, container images in ECR and Lambda for software vulnerabilities |
| Infrastructure protection | VPCs, PrivateLink, security groups |
| Prompt injection | Separate instructions from untrusted input; Guardrails Prompt Attack filter |
| Encryption at rest and in transit | KMS; TLS |
| Data leakage prevention | Don't put secrets in prompts; Guardrails sensitive information filters; scope retrieval permissions |
| Output filtering and validation | Guardrails on responses; check structure and values before acting |
| Audit trail and logging | CloudTrail for API calls; Bedrock model invocation logging to CloudWatch Logs or S3 (off by default; you turn it on) |
| Toxicity | Guardrails content filters; evaluation of toxicity |
Hallucination detection and grounding (named in the guide)
| Method | How |
|---|---|
| RAG grounding | Answer 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 validation | Check facts, numbers and formats against systems of record |
| Confidence scoring | Use 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
- Bedrock Guardrails — checked Oct 19, 2026
- Bedrock model invocation logging — checked Oct 19, 2026
- Amazon Inspector — checked Oct 19, 2026
- AWS CloudTrail — checked Oct 19, 2026
Check your understanding
You must keep a record of every prompt and response for audits. Feature?Show answerHide 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 answerHide answer
Answer
Contextual grounding check.Who records which IAM role called the model API?Show answerHide answer
Answer
AWS CloudTrail.