defending-llms-with-guardrails

Featured

Deploy Llama Guard, NeMo Guardrails, and LLM Guard input/output scanners as runtime defenses.

AI & Automation 61 stars 15 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 89/100

Stars 20%
60
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Defending LLMs with Guardrails > **Defensive scope:** This skill describes runtime defenses for production LLM applications. The example jailbreak/injection payloads exist only to validate that guardrails block them. Test against systems you own or are authorized to assess. ## Overview Large language model (LLM) applications are exposed to adversarial input (jailbreaks, prompt injection, toxic content) and can emit unsafe, biased, or sensitive output. A guardrail is a runtime control that inspects and constrains the data flowing into and out of an LLM. Three production-grade, open-source guardrail systems dominate the ecosystem and are complementary rather than mutually exclusive: - **Llama Guard 3** (Meta) — a Llama-3.1-8B model fine-tuned as a *safety classifier*. Given a prompt or a response, it emits `safe` or `unsafe` plus the violated MLCommons hazard categories (S1–S14). It is the strongest *semantic* content-safety classifier of the three and supports prompt classification, response classification, and tool-call/code-interpreter classification across 8 languages. - **NeMo Guardrails** (NVIDIA) — a *programmable* dialogue-rail framework. You define `input`, `output`, `dialog`, `retrieval`, and `execution` rails in a `config.yml` plus Colang (`.co`) flows. It can call external models (including Llama Guard) as actions, enforce topical boundaries, and add fact-checking/jailbreak-detection rails. - **LLM Guard** (Protect AI) — a *scanner pipeline* with 15 input scan...

Details

Author
adriannoes
Repository
adriannoes/awesome-agentic-ai
Created
11 months ago
Last Updated
1 weeks ago
Language
Jupyter Notebook
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category