Guardrails, Hallucination Detection and Escalation Criteria
Safeguards control what AI systems accept, produce and do. This lesson explains guardrails, methods for detecting hallucinations and how to define escalation criteria, with Amazon Bedrock Guardrails as the AWS example.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the safeguards Amazon Bedrock Guardrails provides.
- Explain how hallucinations are detected and reduced.
- Describe effective escalation criteria.
- Describe layered safeguards from input checks to monitoring.
- Explain the balance between over-blocking and under-blocking.
Guardrails
Guardrails are configurable controls that check the inputs to and outputs from a generative AI application and block, mask or modify content that breaks policy. They implement the organisation's responsible AI policies consistently across applications. Amazon Bedrock Guardrails provides the following types of safeguard, which can be applied to models in Amazon Bedrock and to other models through its standalone interface.
- Content filters
- Detect and block harmful categories such as hate, insults, sexual content, violence and misconduct, and prompt attacks that try to bypass instructions.
- Denied topics
- Topics the application must not engage with, described in natural language, such as investment advice in a banking assistant.
- Word filters
- Block specific words or phrases, such as profanity or competitor names.
- Sensitive information filters
- Detect personally identifiable information (PII) and other sensitive data, and block or mask it in inputs and outputs.
- Contextual grounding checks
- Detect hallucinations by checking whether a response is supported by the source material and relevant to the question.
- Automated Reasoning checks
- Validate the factual accuracy of responses against formally defined rules, such as eligibility policies, and explain the result.
Layered safeguards
No single safeguard is sufficient, so effective designs place several layers between a request and its consequences. If one layer fails, another can still catch the problem. The following steps describe the layers in order.
-
Input checks
Guardrails screen requests for harmful content, denied topics, sensitive data and prompt attacks.
-
Instructions and grounding
The system prompt sets scope and rules, and answers are grounded in approved content.
-
Output checks
Guardrails check responses for harmful content, sensitive data and unsupported claims.
-
Action limits
Permissions and rules outside the model limit what an application or agent can do.
-
Escalation and review
Defined cases are handed to people, and high-impact outputs are reviewed.
-
Monitoring
Guardrail interventions, complaints and quality samples are tracked over time.
The following diagram shows a problem passing one layer and being caught by the next.

Layers of safeguards
Detecting hallucinations
No single technique eliminates hallucinations, so organisations combine several. Grounding answers in retrieved company content (RAG) and requiring citations lets users and reviewers verify claims. Grounding checks automatically compare responses with the source passages and flag unsupported statements. Rule-based verification, such as Automated Reasoning checks, validates answers against defined policies. Instructions that permit "I don't know" reduce the pressure to invent an answer. Finally, human review remains essential for high-stakes outputs.
Escalation criteria
Escalation criteria define, in advance, when an AI system must hand a case to a person. They should be explicit rules that the system and its operators apply consistently, not judgements left to the model. The following list gives typical criteria.
- The user asks for a human, or expresses distress, anger or a complaint.
- The request falls outside the approved scope or matches a denied topic.
- Confidence or grounding scores fall below a threshold.
- The case involves high value, vulnerable customers, legal claims or safety.
- An agent would take an action above its authority limit, such as a refund over a set amount.
Escalation must lead somewhere: a staffed queue with the context of the conversation, so the customer does not have to start again.
Escalate or continue?
Tuning safeguards: blocking too much or too little
Safeguards can fail in two directions. Under-blocking lets harmful or unsupported content through. Over-blocking refuses legitimate requests, which frustrates users, drives them to unapproved tools and reduces the value of the application. Stricter settings reduce the first risk and increase the second, so the right strictness depends on the use case: a children's education service tolerates more over-blocking than a tool for medical professionals.
Safeguards should therefore be tested with two sets of examples before launch: inputs that should be blocked, including adversarial attempts found through red teaming, and legitimate inputs that should be allowed. Both the block rate and the false-block rate are monitored in production. The module on enterprise AI risk management covers red teaming and incident response.
Tuning the safeguards
Safeguarding a banking assistant
A bank is launching a customer-facing assistant that answers questions about its accounts and fees. Compliance requires that it never gives investment advice, never displays full card numbers, never invents fee information and hands complaints to staff. Which safeguards meet each requirement?
A denied topic blocks investment advice. A sensitive information filter masks card numbers in inputs and outputs. Grounding answers in the official fee documents with RAG, plus contextual grounding checks, addresses invented fees. An escalation criterion routes any complaint to a staffed queue with the conversation history. Content filters for harmful content and prompt attacks provide baseline protection for any public-facing assistant.
An assistant that refuses too much
A hospital deploys an internal assistant for nurses that answers questions from clinical procedure documents. Content filters were set to their strictest level. Nurses report that questions about wound care, overdose protocols and patient injuries are frequently refused, and some have started using a public chatbot instead. What should change?
The safeguards are over-blocking: legitimate clinical language about injuries and medication is being treated as harmful content. The result is lost value and a new shadow AI risk. The hospital should test the filters with a set of real nurses' questions, adjust their strictness for this professional audience, and rely more on other layers, such as grounding in approved procedures, contextual grounding checks and restricting access to clinical staff. It should then monitor both refusals and harmful outputs, and address the public chatbot use directly.
Which Amazon Bedrock Guardrails safeguard checks whether a response is supported by its source material?
Show answer
Contextual grounding checks, which detect hallucinations by measuring grounding in the source and relevance to the question.
Exam Tips
Remember for the exam
- Amazon Bedrock Guardrails: content filters, denied topics, word filters, sensitive information filters, contextual grounding and Automated Reasoning checks.
- Combat hallucinations with RAG and citations, grounding checks, rule-based verification and human review.
- Define escalation criteria explicitly in advance and route to a staffed queue with context.
- Layer safeguards: input checks, grounding, output checks, action limits, escalation and monitoring.
- Over-blocking harms usefulness; test safeguards with both harmful and legitimate examples.