CONCEPTUALIZING RAG AND SECURITY GUARDRAILS

SUMIT MATHUR

Session Overview

Understanding RAG Through Storytelling, and Guarding It in Production.

Sumit Mathur made Retrieval-Augmented Generation (RAG) click through a simple story. Picture a law firm owner named "Ragini" — standing in for RAG — who hires a brilliant consultant, "Lakir Laxman" (the LLM), with vast worldly knowledge but a habit of confidently making things up whenever asked about the firm's own internal data. To fix this, Ragini brings on "Rita Pal" (the Retriever), whose job is to search the firm's private documents, pull out the relevant snippets, attach specific instructions, and hand them to the LLM before it answers. That handoff is RAG in a nutshell — it's how organizations can put powerful generative AI to work on their own private, sensitive data securely, instead of relying on the model's general knowledge alone.

From there, Sumit turned to what it actually takes to run RAG systems safely in production. He walked through two of the biggest risks: hallucinations, where the AI confidently invents false information, and prompt injections, where malicious users craft confusing or hidden instructions to trick the AI into bypassing its rules. His practical guidance for developers: combine model tuning, careful prompt engineering, probabilistic detection models, and dedicated moderation layers to filter out hate, abuse, and profanity (HAP) before it ever reaches an end user.


Key Takeaways & Concepts

  • RAG as a Story: "Ragini" (RAG) hires "Lakir Laxman" (the LLM) for his broad knowledge, but he hallucinates on firm-specific questions — so she brings in "Rita Pal" (the Retriever) to ground his answers in real documents.
  • How the Retriever Works: The Retriever searches private documents, extracts relevant snippets, appends instructions, and hands them to the LLM — letting the model answer from an organization's own data.
  • Secure Use of Private Data: RAG lets enterprises tap into generative AI's power without exposing sensitive internal data to a general-purpose model's training set.
  • Hallucination Risk: Even with RAG, models can confidently invent false information — a core risk that has to be actively managed.
  • Prompt Injection: Malicious users can craft confusing or hidden instructions to trick an AI system into bypassing its intended rules.
  • Practical Guardrails: A combination of model tuning, prompt engineering, probabilistic detection models, and dedicated moderation layers helps filter hate, abuse, and profanity (HAP) and keep systems safe in production.

Session Highlights

Sumit Mathur presenting at AI Dev Day India 2024
Sumit Mathur session moment
Audience engaging with Sumit Mathur's session
Sumit Mathur Q&A

Up Next:

Taking AI to the Edge

Sumit Sharma's Session