Skip to content

Sentrie - Policy Enforcement Engine

The policy enforcement engine that scales with your needs

Sentrie is a powerful, flexible policy enforcement engine designed for modern applications. With its rich expression language, comprehensive type system, and JavaScript module integration, Sentrie makes it easy to implement complex authorization, access control, and business rules.

Rich Expression Language

Powerful expressions with arithmetic, logical, comparison, and collection operations. Support for quantifiers, pattern matching, and conditional expressions.

Type-Safe Policies

Comprehensive type system with shapes, constraints, and validation. Catch errors at policy definition time, not runtime.

JavaScript Integration

Seamlessly integrate JavaScript modules for complex logic. Built-in modules for UUID generation, crypto operations, and more.

  • 🎯 Policy-First Design: Define policies as code with clear, readable syntax
  • 🔒 Authorization & Access Control: Implement fine-grained permissions and business rules
  • 📦 Pack System: Organize policies into reusable, versioned packages
  • 🌐 HTTP API: RESTful API for policy evaluation with comprehensive tracing
  • ⚡ High Performance: Built-in caching and optimization for production workloads
  • 🔧 Developer Experience: Rich tooling, comprehensive error messages, and debugging support

Get up and running with Sentrie in minutes:

Terminal window
# Install Sentrie
go install github.com/sentrie-sh/sentrie@latest
# Create your first policy
mkdir my-policy && cd my-policy
echo 'namespace com/example/auth
policy user {
rule allow = default false when user.role == "admin" {
yield true
}
export decision of allow
}' > auth.sentrie
# Start the server
sentrie serve --pack-location .

Sentrie’s expression language is designed for clarity and power:

namespace com/example/pricing
policy pricing {
let discount = 0.1
let premiumUsers = ["alice", "bob"]
rule calculatePrice = default 0 {
let basePrice = product.price
let userDiscount = user.name in premiumUsers ? discount : 0
let finalPrice = basePrice * (1 - userDiscount)
yield finalPrice
}
export decision of calculatePrice
}

Get Started

Learn the basics and write your first policy

Start Building →

Language Reference

Explore the full language specification

View Reference →

Version 0.1.0 - Early Access