Thanks for considering a contribution. GOPAL is an open, community-curated library of OPA Rego policies encoding AI-governance requirements; the more eyes on each rule, the better the policies get.
- New policies for an existing framework (e.g. an additional EU AI Act article)
- New frameworks (e.g. UK AI Principles, California SB-1047 successor, MAS banking AI guidance)
- New industry verticals (e.g. media, energy, defence)
- Fixes for bugs in existing policy logic
- Tests — every policy should have a sibling
*_test.rego. Missing tests on existing policies are open invitations. - Translations — the README ships in 5 languages. Native-speaker review of any of them is gold.
- Documentation improvements (CONTRIBUTING, README, AGENTS, STYLE)
- Open or check an issue first. For new frameworks or larger additions, a quick "I'm planning to add X" comment avoids duplicate work.
- Run the same checks CI runs. See Development below.
- Match the existing policy shape. Every policy file follows the same structure (package, imports, METADATA, default deny, allow rule, report). See diagrams/diagram3_policy_anatomy_light.svg and any existing
.regofor the canonical pattern. - Add a test sibling. A new
foo.regoneeds afoo_test.regocovering both allow and deny cases. - Update CHANGELOG.md under
[Unreleased]with a one-line entry describing your change.
# One-time setup
pip install pre-commit
curl -L -o opa https://openpolicyagent.org/downloads/latest/opa_linux_amd64 \
&& chmod +x opa && sudo mv opa /usr/local/bin/
curl -L -o regal https://github.com/StyraInc/regal/releases/latest/download/regal_Linux_x86_64 \
&& chmod +x regal && sudo mv regal /usr/local/bin/
pre-commit install
# Run the checks CI runs
opa check --ignore custom/ .
regal lint --ignore-files custom/ .
# Run tests for a specific package
opa test international/eu_ai_act/v1/If opa check fails it usually means a typo in a package path or an undeclared rule. If regal lint fails, run with --format pretty for human-readable advice on the issue.
- Package path mirrors the directory.
international/eu_ai_act/v1/transparency.regodeclarespackage international.eu_ai_act.v1.transparency. - Default deny. Every policy starts with
default allow := falseso a missing rule produces a safe (deny) result, never an accidental allow. - Metadata comments. Use
# METADATAfollowed by# title:and# description:so the rule is human-readable in audit reports. - Report composition. Use
data.helper_functions.reporting.compose_report(...)to produce the standardized output shape — don't roll your own report dict. The helper guarantees the field names auditors expect. - Versioning. New frameworks go under
<framework>/v1/. When a regulation amends, the oldv1/stays put and a newv2/ships alongside. See COMPATIBILITY.md. - Reference data needed? Add it as a constant inside the policy or under a sibling
_data.rego. Avoid runtime dependencies on external services.
The fastest path:
- Decide where it goes:
international/,industry_specific/,global/, oroperational/. mkdir <category>/<framework>/v1/- Drop in a first policy that follows the standard shape. The
draft-rego-policyskill scaffolds this for you under Claude Code. - Add a test sibling.
- Update the README count + add a row under "What's Inside".
- Open a PR.
PRs are reviewed for:
- Correctness — does the policy logic accurately encode the regulation?
- Test coverage — does the test cover both allow and deny? Edge cases?
- Style —
opa check+regal lintclean? Matches existing patterns? - Scope — single concern per PR, easier to revert.
We aim to respond within 5 business days. Larger framework additions may take longer if the regulator's text needs verification.
The custom/ directory is .gitignored and CI-skipped — that's where your organization's proprietary rules go. They evaluate alongside the public set without ever being pushed to this repo. See the README's Custom Policies section.
- Questions — open a Discussion or comment on the relevant issue.
- Security disclosures — see SECURITY.md. Do not file public issues for vulnerabilities.
- Code of conduct — be kind, assume good faith, focus on the work.
By contributing, you agree your contributions will be licensed under the Apache License 2.0, the same license as GOPAL itself.