Skip to content
← Blogs

Jun 20, 2026 · 1 min read

Guardrails for an LLM chatbot on Amazon Bedrock

Keeping a healthcare chatbot on-topic and safe with Amazon Bedrock Guardrails, not just prompt instructions.

Building a chatbot for a health platform means the model can’t just be helpful - it has to stay inside hard boundaries: no medical advice it isn’t allowed to give, no drifting off-topic, no leaking personal information. Writing “do not do X” in the system prompt is a request, not a control. A determined user, or an unlucky phrasing, can talk the model around it.

Amazon Bedrock Guardrails move those rules out of the prompt and into a policy the platform enforces on every call - independent of what the model decides to say.

What the guardrail enforces

  • Denied topics - define off-limits subjects (e.g. dosage recommendations); requests and responses that fall into them are blocked with a safe fallback message.
  • Content filters - tunable thresholds for hate, violence, sexual content, and prompt-injection style attacks.
  • Sensitive information - detect and redact PII so it never lands in logs or replies.
  • Grounding checks - flag responses that aren’t supported by the context you supplied, which curbs confident-sounding hallucinations.

Where it sits

The guardrail wraps the model call on both sides - it screens the user’s input before the model sees it, and screens the model’s output before the user sees it:

user input -> [guardrail: input] -> model -> [guardrail: output] -> user

The important part is that it’s not the model policing itself. Even if a clever prompt gets past the instructions, the output filter still runs. Prompt instructions set intent; the guardrail is the enforcement, and for anything user-facing in a regulated domain you want both.