๐งฉ Composer
๐ฏ Smart Smart Guardrail
๐ง LLM Builder
โก Regex Builder
๐ Block Library
๐งช Tester
๐งฉ Guardrail Composer
Describe what you need. The system will decompose it into reusable blocks, identify existing ones, and build only what's missing.
๐ Guardrail Algebra Analysis
๐จ Build Missing Blocks
๐งฉ Compose Final Guardrail
๐
Publish Composite to GuardrailHub
Share this composite guardrail. Includes all component blocks and composition logic.
๐ Submit for Review
๐งฉ
Enter your requirements and click "Analyze" to see the guardrail algebra decomposition.
๐ฆ Available Blocks in Your Library
Loading blocks...
๐ Configuration Preview
// Fill in the form to see preview...
๐ก Quick Tips
๐ค LLM Mode: Best for nuanced policies (financial advice, medical compliance)
๐ Pattern Mode: Best for clear-cut cases (PII, profanity, URLs)
๐ Hybrid Approach: Use LLM + keywords for best coverage
๐ฏ Threshold: 90+ = strict, 70-80 = balanced, <70 = lenient
๐ Invert Score: Enable for "risk" metrics (e.g., diagnosis_risk)
๐ฐ Financial Compliance
LLM
Validates financial advice against SEC regulations. Blocks guaranteed returns, requires risk disclosures.
guaranteed
risk-free
insider
โ๏ธ Metric: sec_compliance_score | ๐ฏ Threshold: 85
๐ฅ Medical Advice Blocker
LLM
Blocks medical diagnoses and treatment plans. Ensures "consult a doctor" disclaimers.
you have
diagnosed
prescription
โ๏ธ Metric: diagnosis_risk | ๐ฏ Threshold: 30 (inverted)
๐ก๏ธ Content Moderation
LLM
Detects inappropriate content, hate speech, violence, and illegal activities.
profanity
hate
violence
โ๏ธ Metric: content_safety_score | ๐ฏ Threshold: 90
๐ HIPAA Compliance
Hybrid
Ensures medical AI doesn't expose Protected Health Information (PHI).
patient name
medical record
SSN
โ๏ธ Metric: hipaa_compliance | ๐ฏ Threshold: 95
โ๏ธ Legal Advice Blocker
LLM
Prevents AI from providing legal advice. Requires "consult a lawyer" disclaimers.
you should sue
legal advice
file a lawsuit
โ๏ธ Metric: legal_advice_risk | ๐ฏ Threshold: 25 (inverted)
๐ Start from Scratch
Create a custom guardrail from scratch with your own rules and prompts.
โ
๐งช Test Your Guardrail
Select Guardrail
-- Select a guardrail to test --
Test AI Response
Quick Test Scenarios
โ
Safe
๐ง PII
๐ฐ Financial
๐ฅ Medical
โ ๏ธ Toxic
๐ Run Test
๐ Test Results
๐งช
Run a test to see results here
๐ง LLM-Powered Guardrail Builder
Create guardrails that use an LLM to analyze content. Best for nuanced, context-aware validation.
โก Regex-Based Guardrail Builder
Create fast, rule-based guardrails using regex patterns. Best for PII detection, format validation.
Action on Match
๐ซ Block - Stop request if pattern matches
โ ๏ธ Flag - Allow but log violation
๐ Redact - Replace matched content with [REDACTED]
Quick Templates
๐ข SSN
๐ง Email
๐ณ Credit Card
๐ฑ Phone
๐ IP Address
Test Your Patterns
๐งช Test
๐พ Save Regex Guardrail
๐
Publish to GuardrailHub
Share with the community. Includes regex patterns, action type, and test results.
๐ Submit for Review
๐ฆ Platform Templates
Pre-built guardrail templates. Click to customize and add to your library.
๐ฅ
HEALTHCARE
Healthcare PHI Protection
HIPAA-compliant protection against unauthorized PHI access.
Click to use โ
๐ณ
PII
Financial PII Protection
Block SSN, credit cards, bank accounts extraction.
Click to use โ
๐
SECURITY
Prompt Injection Protection
Block jailbreak attempts and instruction overrides.
Click to use โ
โ๏ธ
LEGAL
Legal Advice Blocker
Block unauthorized legal advice and case predictions.
Click to use โ
๐
MEDICAL
Medical Advice Blocker
Block diagnoses and treatment recommendations.
Click to use โ
๐ฐ
FINANCE
Financial Compliance
SEC compliance, block guaranteed returns claims.
Click to use โ
๐ My Guardrail Library
Your proprietary guardrails organized by tier. Reuse these across multiple use cases.
All
Platform-Derived
Corporate
Use-Case Specific
Loading your guardrails...
๐ง Smart Guardrail Designer
Describe what you want to protect against in natural language.
AI will generate threat patterns, run simulations, and show accuracy metrics.
๐ Read the Tuning Guide โ
Guardrail ID
Optional - will be auto-generated if empty
๐ Quick Start - Choose a Template
๐ฅ Healthcare PHI
HIPAA compliant
๐ณ Financial PII
Credit cards, SSN
๐ Prompt Injection
Jailbreak protection
โ๏ธ Legal Advice
Liability protection
๐ Medical Advice
No diagnosis/treatment
โ๏ธ Custom
Write your own
๐ฃ๏ธ Guardrail Description
๐ LLM API Key (Groq or OpenAI)
Used for generating threat patterns and running LLM-as-Judge simulations
๐ฏ Design & Simulate
Clear
๐ Status
Ready to design. Enter a description and click "Design & Simulate".
๐ Simulation Results
๐๏ธ Tune Your Guardrail
(Adjust to improve accuracy)
โ๏ธ Advanced: Block Threshold
๐ Re-run Simulation
โ Add Examples
๐ Deploy Guardrail
๐ Re-run
๐
Publish to GuardrailHub
Share with the community
Your guardrail will be submitted for review. Once approved, it will appear in the
GuardrailHub Explorer
with a "Community" badge.
Included in submission:
โ
Test cases (safe & unsafe examples)
โ
Accuracy metrics (precision, recall, F1)
โ
Calibration data & thresholds
โ
Description & use case
๐ Submit for Review
โ๏ธ Generated Configuration
๐งช Test Case Results
#
Input
Expected
Predicted
Score
Result
Feedback
๐ Guardrail Development Guide
๐ฏ What are Guardrails?
Guardrails are safety validators that analyze AI responses before they reach users. They calculate metrics (like pii_risk or compliance_score) and block responses that violate your policies.
๐๏ธ Architecture: 3-Tier System
Tier 1: Built-in (Go) - Fast, rule-based (~1ms)
โข pii_detector_v1, grounding_analyzer_v1, hallucination_detector_v1
Tier 2: LLM-Template - Flexible, context-aware (~500ms LLM / ~1ms fallback)
โข Your custom guardrails registered via this UI
Tier 3: Custom Go - Optimized, production-grade (~0.5ms)
โข For high-volume scenarios, recompiled into gateway
๐ค LLM-Assisted vs Pattern-Based
Feature
LLM-Assisted
Pattern-Based
Latency
~500ms (GPT-4)
~1ms
Cost
$0.01-0.05/request
Free
Accuracy
High (contextual)
Medium (literal)
Use Case
Nuanced policies
Clear-cut cases
๐ก๏ธ Security: Defense-in-Depth
Prompt Injection Detection - Blocks adversarial attacks before LLM call
LLM Response Validation - Verifies LLM output integrity
Pattern Fallback - Always available if LLM fails
Input Sanitization - Removes malicious control characters
๐ก Best Practices
โ
Use pattern-based guardrails first - PII, profanity โ regex/keyword matching
โ ๏ธ LLM for complex cases only - Financial/medical compliance
๐ Always provide fallback keywords - System works without OPENAI_API_KEY
๐ฏ Set appropriate thresholds - 90+ strict, 70-80 balanced, <70 lenient
๐งช Test before deploying - Use the Tester tab with real scenarios
๐ Deployment Workflow
1. Builder โ Design your guardrail
2. Templates โ Or start from pre-built template
3. Tester โ Validate with test scenarios
4. Deploy โ Register to gateway
5. Contracts โ Assign to contracts
6. Monitor โ Track violations in dashboard
๐ API Reference
For programmatic access, see the API Documentation .
POST /api/guardrails/register
{
"id": "custom_policy_v1",
"name": "Custom Policy",
"description": "...",
"prompt_template": "...",
"keywords": ["..."],
"metric_name": "compliance_score",
"threshold": 75
}