Skip to main content

Installation

Requirements​

  • Python 3.9 or higher
  • No OPA binary — evaluation is in-process via regopy

Core package​

pip install comply54

This installs the evaluation engine, all 21 policy packs, and the sector packs for Nigeria (fintech, healthcare, insurance), Kenya, and Pan-African coverage.

Framework adapters​

Install the adapter for your AI framework alongside the core:

pip install comply54 langchain-core langgraph
from comply54.langchain import Comply54Guard, comply54_route, compliance_node, comply54_tool

Verify installation​

import comply54

# Check package version
print(comply54.__version__) # 0.2.4

# List all available packs
from comply54 import list_packs
for pack in list_packs():
print(f"{pack.id} ({pack.jurisdiction}) — {pack.regulation}")

Expected output:

nigeria/ndpa        (NG)  — NDPA 2023
nigeria/cbn (NG) — CBN Transaction Controls
nigeria/bvn-nin (NG) — CBN BVN Framework, NIBSS BVN Scheme Rules & NIMC Act 2026
nigeria/nfiu-aml (NG) — NFIU/MLPPA 2022
nigeria/nha (NG) — National Health Act 2014
nigeria/naicom (NG) — Insurance Act 2003 / NAICOM Guidelines
kenya/kdpa (KE) — Kenya Data Protection Act 2019
south-africa/popia (ZA) — POPIA
ghana/dpa (GH) — Ghana Data Protection Act 2012
rwanda/dpa (RW) — Law No. 058/2021
egypt/pdpl (EG) — Egypt PDPL No. 151/2020
ethiopia/pdp (ET) — Ethiopia PDP Proclamation 1321/2024
mauritius/dpa (MU) — Mauritius DPA 2017
tanzania/pdpa (TZ) — Tanzania PDPA 2022
uganda/dppa (UG) — Uganda DPPA 2019
universal/pii-leakage — OWASP LLM01
universal/prompt-injection — OWASP LLM01
universal/tool-permissions — OWASP LLM08
universal/human-approval — OWASP LLM08
universal/model-routing — OWASP LLM09

Environment variables​

comply54 requires no mandatory environment variables. Optional configuration:

VariableDefaultDescription
COMPLY54_AUDIT_BACKENDnoneAudit log destination: none, stdout, file, or a URL
COMPLY54_AUDIT_FILEcomply54-audit.jsonlPath when AUDIT_BACKEND=file
COMPLY54_STRICT_MODEfalseTreat escalate decisions as deny

Docker / Lambda​

comply54 works in any Python environment — no system dependencies:

FROM python:3.12-slim
RUN pip install comply54

The regopy wheel bundles Microsoft's rego-cpp, a C++ implementation of Rego, as a compiled extension. No apt-get or brew install opa is required.

Engine compatibility​

rego-cpp is a separate implementation from OPA, and it handles some text differently. comply54 compensates so the bundled packs behave as they do under OPA, and a CI job checks every output regex against real OPA:

  • Case-insensitive matching. Packs match lowercase patterns against lowercased text instead of using (?i), which rego-cpp does not support.
  • Line breaks and control characters. Tabs, line breaks, form feeds and carriage returns in evaluation input are treated as spaces, and other control characters as a non-space placeholder. A pattern's . can therefore match across what was a line break, which can only add matches, never remove them.
  • Non-ASCII text. rego-cpp's regex engine counts bytes, not characters. Before evaluation, non-ASCII characters in the agent output are replaced with a one-byte placeholder, except characters that a loaded pack or your config mentions (such as ₦ or Arabic text), which stay matchable. Signed receipts still hash the original output.
  • Quotes and backslashes are passed through with an escape that rego-cpp keeps, so only length checks (count) see one extra character for each.