Skip to content

elsai GuardrailsProgrammable Guardrails

for LLM-based Applications

elsai Guardrails Architecture

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

  • Toxicity Detection: Automatically detect and block offensive or harmful content
  • Sensitive Data Protection: Identify and protect personal information like emails, phone numbers, and credit cards
  • Content Classification: Detect jailbreak attempts, prompt injection, and malicious code using semantic routing
  • Off-Topic Detection: Keep AI conversations focused by defining allowed topics and blocking off-topic inputs
  • SQL Syntax Validation: Validate SQL queries for major dialects (PostgreSQL, MySQL, SQLite, and more) before execution
  • PII/PHI Detection and Data Masking: Entity-based detection with configurable policies, confidence thresholds, data masking, and audit logging
  • Token Budget Enforcement: Compute full-context token usage and reject oversized requests before LLM processing
  • Tool Authorization: Role-based tool allowlists and denylists with agent hook integration
  • Rate Limiting & Abuse Prevention: Per-session request, tool call, and execution time quotas
  • Data Exfiltration Detection: Block or mask credentials, bulk sensitive data, and export-style payloads in LLM output
  • ARMS Storage: Persist guardrail runs to MongoDB, DynamoDB, or ClickHouse through the ARMS Backend
  • Multi-LLM Integration: Seamless integration with major LLM providers
  • Flexible Deployment: Use as a wrapper or perform separate input/output checks

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 our Installation Guide to get started in minutes!

Released under the MIT License.