Lex Custis¶
Open-source, EU-sovereign compliance engine for the EU AI Act.
The product, in one paragraph
You built an AI feature. From 2 August 2026 it probably became a high-risk AI system under Annex III of the EU AI Act. You now owe a national Market Surveillance Authority a hash-verified log of every decision it made, an Annex IV technical-documentation dossier, a serious-incident workflow with a 10/2/15-day SLA, accuracy + drift metrics, a human-oversight record, and tamper-evident retention for 10 years. Lex Custis is the proof layer. Self-host it, point it at your LLM, and hand your regulator a signed zip file.
Who this is for¶
Lex Custis targets mid-market SaaS companies whose product became Annex III high-risk when they added an AI feature: HR-tech that ranks candidates, fintech with credit scoring, insurtech risk engines, edtech assessment and proctoring, healthtech triage, public-sector vendors.
If you run one of those companies, you have a short window to produce the evidence the EU AI Act demands, and most of you don't have a compliance team. Lex Custis is the engineering team's answer to that problem.
If you don't fall into Annex III, you probably don't need the whole
product — but Art. 4 (AI literacy) obligations apply from February 2025
to every EU employer using AI. The /compliance audit log is useful even
there.
What it ships today (OSS v0.1)¶
- Tamper-evident audit log with per-org HMAC-SHA256 chain derived via HKDF from a master key held outside Postgres. An attacker with database-only access cannot forge entries.
- One-click Annex IV dossier — a zip bundling the Art. 11 technical
doc PDF, Art. 12 JSONL event logs, integrity attestation, Art. 15
metrics, Art. 53 upstream-GPAI manifest, Art. 73 incidents for the
period, and a
MANIFEST.jsonwith SHA-256 per file. - Art. 73 serious-incident workflow with classification per Art. 3(49), per-category SLA countdown (10 days / 2 days / 15 days), status machine, and regulator-ready JSON export.
- Pre-checks — PII detection, prompt-injection flags, topic classification. Post-checks — confidence, source grounding, bias monitoring.
- Human oversight — accept / modify / reject per AI output, stored in a separate table so the core audit log stays strictly append-only.
- Multi-LLM — Mistral (EU-sovereign default) or self-hosted Ollama. Anthropic / OpenAI are commercial plugins.
- Multi-tenant — every query scoped by
organization_id, enforced with integration tests in CI. - Rate-limited + cost-capped —
slowapi+ per-org daily chat budget bound LLM spend. curl | bashinstaller — one command brings up Postgres, Redis, Qdrant, FastAPI, Next.js, and optionally Ollama, with demo data pre-seeded.
See the compliance matrix for the exact articles covered.
Why AGPL-3.0?¶
Compliance code has to be verifiable by your DPO, your legal team, and a regulator's technical auditor. You cannot prove integrity of a closed box. AGPL keeps the code open while discouraging closed SaaS forks.
If your deployment can't accept AGPL copyleft (embedding in a closed-
source product, offering a hosted SaaS without publishing modifications),
a commercial license is available — see
LICENSE-commercial.md.
Quickstart¶
git clone https://github.com/vbalagovic/lex-custis.git lex-custis
cd lex-custis
./install.sh --with-ollama # self-hosted; ~3-5 GB model pull
# or
./install.sh # expects MISTRAL_API_KEY in .env
Open http://localhost:3000, log in with the seeded demo admin:
- email:
admin@acme-hr.demo - password:
demo-demo-demo-demo
See Getting started → Install for the full walkthrough.
Further reading¶
- The EU AI Act, plainly — the regulation explained for engineers.
- Is my system high-risk? — Annex III paragraph-by-paragraph with worked examples.
- Articles that bind you — Arts. 9, 10, 11, 12, 13, 14, 15, 26, 27, 50, 53, 73 in plain English.
- Architecture → Hash chain — the cryptographic detail.
- Compliance → What we claim — the explicit list of what v0.1 covers and what is deferred.
- FAQ.
Not legal advice
This documentation explains how Lex Custis technically helps you meet EU AI Act obligations. It is not legal advice. Engage qualified counsel for your specific situation, especially for Art. 27 FRIA and any public-sector or healthcare deployment.