Skip to content

Guardrails ​

elsai Guardrails provides programmable guardrails for LLM-based applications — detect toxic content, protect sensitive data, enforce token budgets, authorize tool calls, defend agent memory, 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.

Memory Protection

Defend agent memory banks against poisoning with trust scoring, isolation, TTL, and provenance logging.

Agent Trust

Defend multi-agent pipelines with identity/trust registries, HMAC attestation, trust-based privilege isolation, and independent re-validation of upstream agent output.

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.8 is a maintenance release with bug fixes. Recent highlights:

  • Agent Trust (v0.1.7) — Multi-agent trust boundary with identity/trust registry, HMAC attestation, trust-based privilege isolation, and independent re-validation of upstream agent output

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.

Copyright © 2026 elsai foundry.