AI Guardrails: Implementing Security Controls for LLM Applications
AI Guardrails are security controls that intercept and validate inputs to and outputs from Large Language Models (LLMs), addressing unique attack vectors that traditional security controls cannot prevent. Learn to build a complete guardrails stack, test it against prompt injection attacks and PII disclosure, and monitor and tune these controls.

Course Content
AI Guardrails are security controls that intercept and validate inputs to and outputs from Large Language Models (LLMs), addressing unique attack vectors that traditional security controls cannot prevent. This course provides hands-on demonstrations implementing production-grade guardrails using LiteLLM proxy as a unified security gateway, Microsoft Presidio for PII masking to prevent sensitive data leakage, and Lakera AI for prompt injection detection to block malicious inputs and outputs. Unlike traditional application security controls that focus on code vulnerabilities, AI guardrails address unique risks introduced by probabilistic AI systems that can be manipulated through natural language. By the end of this course, you will have the knowledge to build a complete guardrails stack, test it against real prompt injection attacks and PII disclosure scenarios, and learn to monitor and tune these controls for production environments.
Target Audience
This course is for security engineers, application security professionals, penetration testers, and developers who need to secure LLM applications against prompt injection, data leakage, and policy violations.
Course Level
Intermediate
Prerequisites
Basic understanding of APIs, HTTP requests, Linux command line, and familiarity with LLM concepts (prompts, responses, system instructions).
Links
OWASP LLM Top 10 2025: https://genai.owasp.org/ LiteLLM Documentation: https://docs.litellm.ai/ Microsoft Presidio: https://microsoft.github.io/presidio/ Lakera AI: https://www.lakera.ai/
Course Goals
By the end of this course, you should be able to:
- Define AI guardrails, explain why traditional security controls are insufficient for LLM applications, and identify the primary attack vectors addressed by guardrails.
- Implement PII masking using Microsoft Presidio and prompt injection detection using Lakera AI within a LiteLLM proxy architecture.
- Demonstrate monitoring and tuning strategies for production guardrail deployments, including observability through database logging and adjusting detection thresholds.
Course Outline
Module 1 | Introduction to AI Guardrails
- Understanding AI Guardrails and the LLM Threat Landscape
- The LiteLLM Security Stack Architecture
Module 2 | Implementing PII Masking
- Microsoft Presidio for PII Detection
- Lab: Test Presidio PII Masking
Module 3 | Prompt Injection Detection
- Lakera AI Prompt Defense
- Lab: Block Prompt Injection Attacks with Lakera
Module 4 | Understanding Guardrails in Practice
- Observability, Performance, and Decision Frameworks














