Embedded policy engine

MaelysDatalog

MODEL · DERIVE · DECIDE

Datalog release · v0.11.1 · 2026-09-26 · release →

I do not predict.
I organize the possible.

A bounded Datalog policy engine in pure C for systems where every decision must remain understandable, reproducible, and auditable.

[ DETERMINISTIC ]bounded fixed-point evaluation
  • semi-naive evaluation
  • stratified negation
  • reproducible results
[ AUDITABLE ]every decision is attributable
  • SHA-256 policy identity
  • fail-closed loading
  • deterministic diagnostics
[ ZERO-MALLOC ]bounded memory discipline
  • stack-bounded solver
  • no heap on hot path
  • reusable session storage
[ PORTABLE ]embed in your runtime
  • C11 static library
  • Python & JavaScript
  • WASM / WASI
C11portable C core
0 ALLOCinside fixed-point evaluation
BOUNDEDdeterministic evaluation
WASMbrowser-ready runtime
FAIL CLOSEDerrors never authorize

Engine

From rules to decisions

EVALUATOR

Semi-naive evaluation

Delta-driven iteration derives only what changed instead of recomputing the whole fixed point.

allow(R) :- safe_source(R), has_text(R).
PLANNER

Static join ordering

A deterministic bounded planner orders rule bodies before evaluation.

build_static_join_order(rule, delta_idx, order, &count)
NEGATION

Stratified negation

Negative cycles are rejected at load time and lower strata remain frozen during evaluation.

deny(R) :- request(R), not(approved(R)).
MEMORY

Zero-malloc hot path

The reference session reserves bounded working storage at creation and reuses it across requests. Solving itself does not allocate.

fixed bounds · explicit failure
IDENTITY

SHA-256 policy identity

Every loaded policy carries the fingerprint of the exact source that produced its decisions.

policy source → digest → ruleset
SAFETY

Fail-closed by design

Missing policies, parse failures, solver errors and unauthorized queries all resolve to denial.

error ≠ authorization