docs: Enhance README with detailed Guardrails workflow diagram for input and output validation

This commit is contained in:
Shubhamsaboo
2025-08-27 18:34:37 -05:00
parent f8d8ea1cdf
commit 1d18103dfa

View File

@@ -21,6 +21,38 @@ Guardrails are **automated safety mechanisms** that validate inputs and outputs
- Ensure compliance with content policies
- Provide automatic error handling and user feedback
```
┌─────────────────────────────────────────────────────────────┐
│ GUARDRAILS WORKFLOW │
├─────────────────────────────────────────────────────────────┤
│ │
│ USER INPUT │
│ │ │
│ ▼ │
│ ┌─────────────┐ 1. INPUT VALIDATION │
│ │ INPUT │ ◦ Check content safety │
│ │ GUARDRAILS │ ◦ Validate business rules │
│ └─────────────┘ ◦ Filter inappropriate requests │
│ │ │
│ ▼ 2. PASS/BLOCK DECISION │
│ ┌─────────────┐ │
│ │ AGENT │ ✅ PASS: Continue to agent
│ │ PROCESSING │ 🚫 BLOCK: Throw exception
│ └─────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ 3. OUTPUT VALIDATION │
│ │ OUTPUT │ ◦ Safety check responses │
│ │ GUARDRAILS │ ◦ Filter sensitive information │
│ └─────────────┘ ◦ Ensure policy compliance │
│ │ │
│ ▼ 4. FINAL DECISION │
│ ┌─────────────┐ │
│ │ FINAL │ ✅ SAFE: Return to user │
│ │ RESPONSE │ 🚫 UNSAFE: Block and handle │
│ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
```
## 🚀 Key Guardrails Concepts