Skip to content

mjmalafa/openguardrails

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

133 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€— Hugging Face Β· Free Platform Β· Tech Report

OpenGuardrails

License Version Stars

🏒 The only production-ready, fully open-source AI guardrails platform for enterprise AI applications

OpenGuardrails is an open-source runtime AI security and policy enforcement layer that protects the entire AI inference pipeline β€” prompts, agents, tool calls, and outputs.

It is designed for real enterprise environments, not just moderation demos.

Video Introduction


Why OpenGuardrails

Most LLM guardrails focus on one question:

"Is this content unsafe?"

OpenGuardrails focuses on a more important enterprise question:

"Is this behavior allowed by your enterprise policy at runtime?"

Key Differences vs Typical Guardrails

Dimension Typical Guardrails OpenGuardrails
Focus Content moderation Runtime policy enforcement
Enterprise rules Fixed / hardcoded First-class, configurable
Custom scanners Limited Native & extensible
Agent & tool safety Weak Built-in
Deployment SaaS-centric On-prem / private
Open source Partial Fully open-source

What You Can Do

  • πŸ›‘οΈ Runtime AI Security

    • Prompt injection & jailbreak detection
    • Unsafe and non-compliant content detection
    • Input / output data leak prevention
  • πŸ“œ Policy-Based Guardrails

    • Enforce enterprise rules beyond "unsafe"
    • Off-topic, scope control, business constraints
    • Auditable, versioned policies
  • 🧩 Custom Scanners (Core Capability)

    • LLM-based, regex-based, keyword-based
    • Trainable and application-scoped
    • No code changes required
  • πŸ€– Agent & Tool Protection

    • Pre-tool-call checks
    • Post-output validation
    • Prevent unsafe actions, not just text
  • 🏒 Enterprise-Ready by Design

    • Multi-application management
    • High concurrency & low latency
    • Visual management & audit logs

Quick Start (10 Minutes)

Option 1: Try Online (Fastest)

πŸ‘‰ https://www.openguardrails.com/platform/

Option 2: Python SDK

pip install openguardrails
from openguardrails import OpenGuardrails

client = OpenGuardrails("your-api-key")
result = client.check_prompt("Teach me how to make a bomb")

print(result.overall_risk_level)  # high_risk
print(result.suggest_action)       # reject

Option 3: OpenAI-Compatible Gateway (Zero-Code)

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:5002/v1",
    api_key="sk-xxai-your-key"
)

# No other code changes needed - automatic safety protection!
response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello"}]
)

Enterprise Deployment & Integration

OpenGuardrails is designed for private and regulated environments:

  • βœ… Fully on-prem / private cloud deployment
  • βœ… No data leaves your infrastructure
  • βœ… Compatible with OpenAI / Claude / local models
  • βœ… Works as:
    • API service
    • Security gateway
    • Platform-level component

Typical integration points:

  • API Gateway / Proxy
  • Agent runtime
  • Central AI platform

See Deployment Guide for detailed instructions.


Models

  • πŸ€— OpenGuardrails-Text-2510
    • 3.3B parameters
    • 119 languages
    • Purpose-built for guardrails & policy interpretation

Documentation

Detailed guides are intentionally moved out of the README:


Community & Support


Citation

If you find our work helpful, feel free to give us a cite.

@misc{openguardrails,
      title={OpenGuardrails: A Configurable, Unified, and Scalable Guardrails Platform for Large Language Models},
      author={Thomas Wang and Haowen Li},
      year={2025},
      url={https://arxiv.org/abs/2510.19169},
}

Build enterprise AI safely β€” with policy, not prompts.

Made with ❀️ by OpenGuardrails

About

A production-ready, open-source AI guardrails platform and lightweight AI security gateway for enterprise AI applications, with support for user-defined scanners and custom model training.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 66.7%
  • TypeScript 27.0%
  • PLpgSQL 2.1%
  • Shell 1.8%
  • Go 1.3%
  • HTML 0.5%
  • Other 0.6%