# What is Guardrails? Definition & Technical Mechanics

> **Source:** [SPIDITS AI AI Glossary](https://spidits.com/ai-glossary)  
> **Category:** Alignment & Safety  
> **Canonical Citation:** [https://spidits.com/ai-glossary/guardrails](https://spidits.com/ai-glossary/guardrails)

## Definition
Guardrails refer to validation layers placed around AI models to intercept inputs (prompts) and outputs (completions). They ensure safety policies, structure schemas, and prevent toxic leakage or jailbreaks.

## Architectural Mechanics & Deep Dive
Guardrails are software layers and safety filters wrapped around AI models to monitor and control inputs and outputs. Guardrails enforce safety constraints by intercepting toxic inputs, blocking unsafe generated text, redacting personally identifiable information (PII), and ensuring that the model adheres to predefined operational boundaries.

## Industry Applications & Real-World Use Cases
Safety alignment interfaces, compliance filtering, and API defense

## Frequently Asked Questions

### What is a typical guardrail pipeline?
It first scans the user prompt for malicious inputs (jailbreaks), allows the LLM to process it, and then validates the model's output for safety or formatting prior to rendering.

### Give an example of an open-source guardrail library.
Guardrails AI or Llama Guard, which offer template policies to validate outputs against json schemas or safety criteria.

### How do Guardrails AI and NeMo Guardrails compare?
Guardrails AI provides flexible Pydantic and JSON-LD schema validators for structured LLM outputs, whereas NVIDIA NeMo Guardrails specializes in dialogue rails, topical boundaries, and programmatic safety policies.

## Related Terminology
- [ai-safety](https://spidits.com/ai-glossary/ai-safety)
- [alignment](https://spidits.com/ai-glossary/alignment)
- [adversarial-attack](https://spidits.com/ai-glossary/adversarial-attack)

---
*From the SPIDITS AI Knowledge Base (336+ terms indexed). Explore full technical definitions: [https://spidits.com/ai-glossary](https://spidits.com/ai-glossary)*
