Sentrie

Sentrie is an open-source policy enforcement engine that lets you write business rules in a dedicated language. Instead of embedding policy logic in your application code, you define rules declaratively and let Sentrie evaluate them.
Installation
Sentrie is distributed as a single binary with no external dependencies.
Quick Install
macOS (recommended):
brew install sentrie-sh/tap/sentrie
Note: We use Homebrew Formulas instead of Casks because macOS Gatekeeper flags binaries installed via Casks, requiring workarounds. Formulas are treated as regular binaries by Gatekeeper, providing a better user experience.
macOS, Linux, and WSL2:
curl -fsSL https://sentrie.sh/install.sh | bash
Windows:
irm https://sentrie.sh/install.ps1 | iex
For detailed installation instructions and platform-specific options, see the installation guide.
Basic Usage
Write a Policy
Create a policy file policy.sentrie:
namespace user_management
shape User {
role: string
status: string
}
policy user_access {
fact user:User
rule allow = {
yield user.role == "admin" or (user.role == "user" and user.status == "active")
}
export decision of allow
}
Execute a Policy
sentrie exec user_management/user_access/allow --facts '{"user":{"role":"admin","status":"active"}}'
Run as HTTP Service
sentrie serve
Then make a request:
curl -X POST http://localhost:7529/decision/user_management/user_access/allow \
-H "Content-Type: application/json" \
-d '{"facts":{"user":{"role":"admin","status":"active"}}}'
Learn More
License
Licensed under the Apache License, Version 2.0. See LICENSE and LICENSE-DUAL.md for details.