Appearance
Introduction
elsai Guardrails provides programmable guardrails for LLM-based applications — detect toxic content, protect sensitive data, enforce token budgets, authorize tool calls, and persist runs through ARMS.
Why elsai Guardrails?
elsai Guardrails provides a comprehensive solution for securing your LLM-based applications. With built-in protection against common threats and flexible configuration options, you can ensure your AI applications are safe and compliant.
Key Features
Comprehensive Protection
Detect and block toxic content, sensitive data, jailbreak attempts, and malicious requests.
Off-Topic Detection
Keep conversations focused by defining allowed topics and blocking off-topic inputs.
SQL Syntax Validation
Validate SQL queries for 7 major dialects before execution to catch errors early.
PII/PHI Detection
Identify sensitive personal and health information with configurable policies, masking, and audit logging.
Token Budget Enforcement
Compute full-context token usage and reject oversized requests before LLM processing.
Tool Authorization
Restrict agent tool access with role-based allowlists, denylists, and sensitive tool gating.
Rate Limiting
Prevent abuse with per-session request, tool call, and execution time limits.
Data Exfiltration Detection
Block or mask LLM responses that leak credentials, bulk PII, or export-style payloads.
ARMS Storage
Persist guardrail runs to MongoDB, DynamoDB, or ClickHouse via the ARMS Backend.
Flexible Configuration
YAML-based or programmatic configuration with customizable thresholds and rules.
Easy Integration
Simple Python API with async support, detailed results, and input/output validation.
Multi-LLM Support
Works with OpenAI, Azure OpenAI, Anthropic, Gemini, AWS Bedrock, and more.
Quick Example
python
from elsai_guardrails.guardrails import LLMRails
# Initialize with configuration
rails = LLMRails.from_config("config.yml")
# Safe LLM calls with automatic guardrails
response = rails.generate(
messages=[{"role": "user", "content": "Hello!"}]
)What's New
Version 0.1.5 introduces powerful new features:
- ARMS Storage — Persist guardrail runs to MongoDB, DynamoDB, or ClickHouse via the ARMS Backend
- Data Exfiltration Detection — Block or mask credential leaks and bulk data exports in LLM output
- Migration — Direct database storage removed; use ARMS Backend storage instead
See What's New · Release Notes
Get Started
Ready to secure your LLM application? Check out the Installation Guide or jump to the Quick Start.