Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST
Cloud & DevOps
AWS & DevOps

The HR Chatbot That Almost Leaked Salary Bands: Lessons from Bedrock Guardrails

Learn to wire Knowledge Bases and Guardrails into a RAG app so it retrieves facts safely and never improvises sensitive answers.

MCB Editorial
MCB Editorial
Tech Buzz Daily Desk · 10 min read ·
New story
The HR Chatbot That Almost Leaked Salary Bands: Lessons from Bedrock Guardrails
Narrated by Study Buddy Narration
Voiceover Engine • Interactive Audio Sync
0:0010:00

Learning Objectives & Key Takeaways

0 / 4 Completed
🚀 Architecture Ready
100%
What you will learn
  1. RetrieveAndGenerate combines retrieval and generation in one call but needs explicit guardrail configuration per request.
  2. Ingestion is asynchronous, so poll GetIngestionJob before trusting a knowledge base to answer queries.
  3. Guardrails evaluate both the input prompt and the model output separately, so test each side independently.
  4. Word filters are exact-match only and PII detection is probabilistic, never assume either catches everything.
  5. A guardrail version is immutable, so publish a new version after every configuration change before deploying.

The Friday Afternoon Near-Miss

Our internal HR assistant was supposed to answer questions like how many casual leaves are left this quarter, pulling answers straight from the employee handbook stored in Amazon S3. It used Amazon Bedrock Knowledge Bases for retrieval and a foundation model to draft the final response, and everyone on the platform team was proud of how fast it shipped.

Then someone in a demo asked what the current CTC band for senior engineers was, half joking, and the model confidently generated a plausible-sounding salary range pulled from a stray compensation note that had accidentally landed in the same S3 bucket as the leave policy. Nothing was technically wrong with retrieval; the document existed and the model was grounded in it. The problem was that nobody had decided this topic should never be answered at all.

In the rest of this story
  1. Preparing IAM and the Data Source
  2. Creating the Knowledge Base and Running Ingestion
  3. Building the Guardrail That Blocks Compensation Questions
  4. Wiring RetrieveAndGenerate With the Guardrail Attached
  5. Testing the Edges Before Going Live
3 code examples · 10 min read in full
Member-only story

Checking your membership…

Members read every Tech Buzz story in full, with code examples, audio and the discussion, plus every course, quiz and interview set in the Learning Dashboard.

0
MCB Editorial
Written By

MCB Editorial

Tech Buzz Daily Desk. Contributing deep-dive engineering architectures, cloud paradigms, and system design insights to Master Class Buddy.