defending-llms-with-guardrails

Solid

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

AI & Automation 46 stars 7 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 90/100

Stars 20%
56
Recency 20%
100
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
9 months ago
Last Updated
3 days ago
Language
Jupyter Notebook
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

add-llm-guardrails

Use this to add safety and security guardrails to an LLM/agent app - blocking prompt injection, PII leakage, jailbreaks, toxic output, off-topic responses, or invalid structured output. Trigger on "add guardrails", "prevent prompt injection", "stop PII leaks", "validate the model's output", "make this safe for production", especially for regulated/finance/enterprise use.

26 Updated yesterday
ContextJet-ai
AI & Automation Listed

llm-guardrails-designer

Design input and output guardrails for an LLM app — decide what to check (injection patterns, PII, secrets, policy, schema, leakage, toxicity), place them as input vs. output rails, implement with a library like NeMo Guardrails or LLM Guard, and fail closed. Use when adding a safety/validation layer around an LLM, not relying on the prompt alone.

1 Updated 1 weeks ago
imtiazrayhan
AI & Automation Featured

moai-ref-llm-security

AI/LLM defensive security reference: prompt-injection defense, OWASP LLM Top 10 defensive mapping, MCP and agentic tool-call hardening, training-data poisoning detection, model-output validation and guardrails, MITRE ATLAS defensive correlation, and NIST AI RMF governance. Agent-extending skill that amplifies backend, security, and AI-application engineering with production-grade defensive patterns for LLM-backed systems. NOT for: offensive techniques (jailbreak authoring, attack-payload crafting, red-team exploitation), model training or fine-tuning methodology, prompt optimization for capability, web-app OWASP Top 10 (see moai-ref-owasp-checklist), or general API design (see moai-ref-api-patterns).

1,143 Updated today
modu-ai