2-NVIDIA NeMo Guardrails Tutorial: Defend RAG Apps Against Prompt Injection | Part 1 @krishnaik06
2-NVIDIA NeMo Guardrails Tutorial: Defend RAG Apps Against Prompt Injection | Part 1  @krishnaik06
Uploaded November 2026 | Updated November 2026, 1 day ago
Code: github.com/krishnaik06/Ai-Safety-And-LLM-Security
Learn how to add NVIDIA NeMo Guardrails to a RAG application and test defenses against direct prompt injection, poisoned documents, and unsafe responses.

In this hands-on tutorial, we configure input, document/retrieval, and output checks, then integrate them into a LangGraph workflow. Using an example company help assistant, we compare the application’s behavior before and after adding guardrails.

You’ll see how policy-based checks can block off-topic instructions, filter suspicious retrieved passages, and inspect generated answers. We also test normal questions to check whether the guarded application still provides useful responses.

This is Part 1 of the NeMo Guardrails walkthrough, combining architecture explanations, Python implementation, and practical attack testing.

⏱️ TIMESTAMPS & TOPICS

00:00 Introduction and recap of prompt injection attacks
00:50 What is NVIDIA NeMo Guardrails?
01:30 Tutorial roadmap and guardrail categories
02:46 What are rails? Understanding policy-based checks
04:44 Where input, retrieval, and output rails fit in RAG
06:28 Python dependencies, imports, and RailStatus
07:53 Project structure and NeMo configuration files
09:20 Configuring self-check input policies
10:26 Configuring self-check output policies
12:19 Document rail configuration
13:05 Retrieval rails: checking context before generation
14:35 Loading configurations with LLMRails
15:06 Testing input rails with allowed and blocked questions
16:39 Testing document rails with clean and poisoned passages
17:43 Testing output rails with safe and damaging answers
18:37 Building a guarded RAG workflow with LangGraph
20:36 Preparing direct and indirect attack examples
21:16 Creating clean and poisoned vector stores
21:56 Direct prompt injection: before vs after guardrails
23:51 Indirect prompt injection and poisoned-document results
24:47 Comparing results in the attack scoreboard
25:12 Testing normal questions and checking false positives
25:58 Summary and what’s coming in Part 2

💡 WHAT YOU’LL LEARN
- How programmable guardrails fit around an LLM application.
- How to define policies in config.yml.
- How to configure self_check_input and self_check_output.
- How to load configurations using RailsConfig and LLMRails.
- How to run asynchronous checks and inspect their status.
- How to filter retrieved documents before passing context to the LLM.
- How to connect input checks, retrieval, document checks, generation, and output checks in LangGraph.
- How to compare guarded and unguarded applications using the same test cases.
- How to check that legitimate user questions still work.
2-NVIDIA NeMo Guardrails Tutorial: Defend RAG Apps Against Prompt Injection | Part 1All You Need To Know About Model Context Protocol(MCP)Day 3-Live Session- Learning Python With Vibe Coding In 2026Run NemoClaw with a Local LLM- Deploy More Secure AI AgentsAI Engineering Vs AI Forward Deployed Engineer(FDE)Getting Started With Claude Code With VS CodeTransition From Data Analyst to Gen AI Engineer-Debdoot Successful Transition @sunnysavita10Get Best SellervUdemy Courses in 399Rs or 9.99$ #aiforbusiness #artificialintelligencemodelWill Jev Replace LLMs? What is Jev From TypeSafe AIFinal Call-AI Forward Deployed Engineer(FDE) BootcampLoop Engineering And Harness Engineering Crash CourseStart Your AI Engineering Journey With These 2 Tracks
Krish Naik |

2-NVIDIA NeMo Guardrails Tutorial: Defend RAG Apps Against Prompt Injection | Part 1

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER