
Regula
io.github.kuzivaai由 GitHub 账号 kuzivaai 发布v1.9.0更新于 Oct 24, 2026
Offline AI governance code indicators (EU AI Act, Korea, Colorado). Indication, not legal advice.
概览
Regula 是一个本地 MCP 服务器,可扫描源代码目录,找出与欧盟 AI 法案、韩国 AI 基本法和科罗拉多 SB 26-189 相关的 AI 治理迹象。
- 可以做什么
- 扫描本地代码库,找出 AI 治理迹象和候选风险类别,并关联可能相关的条款(regula_check)。按三个已实现的司法辖区对发现进行分类,并记录代码无法体现的部署事实(regula_classify)。评估合规差距,并生成差距结果、证据脚手架等供人工审查的材料(regula_gap)。
- 适用场景
- 适合开发者、治理负责人或顾问在开展情境与法律审查之前,先获得一份代码层面的 AI 治理问题清单,也适合在 CI 流程中加入可重复的检查。
- 运行要求
- 作为本地进程在用户机器上运行(仅限桌面),需要 Python 环境,README 建议使用 pipx 安装。无需账号、API 密钥或环境变量,核心扫描可离线运行。
安装
在 SourceWeft 中
- 打开 控制台中的 Regula,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Regula
Offline-capable, code-native AI governance scanning. The core scan runs locally, does not upload scanned file contents, and needs no account; telemetry is sent only with explicit opt-in consent. Regula flags patterns that may need review under the EU AI Act, South Korea's AI Basic Act, and Colorado SB 26-189, records the deployment facts code cannot show, and reports insufficient information rather than inventing a score.
[Distribution: source] [License: Apache 2.0] [Python 3.10+] [CI] [Tests] [Accessibility target: WCAG 2.2 AA]
Table of contents
- What it does
- Choose how to start
- Quick start
- What Regula tells you
- Key commands
- Who is this for?
- What Regula is (and isn't)
- Bias evaluation: methodology and ethics
- Important limitations
- Verified numbers
- Contributing
- Licence
Excerpt from the real output of the command shown, against the tracked fixture
examples/cv-screening-app. The per-category
counts that read zero and the next-steps footer are omitted for length; nothing
else is edited. scripts/verify_transcripts.py re-runs this command on every
check and fails if any line above stops appearing in its output.
What it does
Regula scans a local source-code folder for patterns that may need AI governance review. A questionnaire records facts that code cannot show, such as where and how a system will be used. Results identify candidate risk categories and link to provisions that may be relevant. Regula does not determine legal classification, compliance, or the obligations that apply to a real deployment.
Reference material covers the EU AI Act, South Korea's AI Basic Act (Act No. 20676), and Colorado SB 26-189. The core install has no required third-party runtime dependencies. Optional extras add dependencies, and some optional commands or configured features can contact external services. Assess territorial scope and data-processing duties independently.
In plain English: give Regula a source-code folder and answer questions about how the system will be used. It returns possible issues and a review trail so a developer, governance lead, or adviser can decide what to investigate next. A scan with no findings does not prove that a system is compliant or low risk.
Choose how to start
Quick start
PyPI distribution is currently unavailable. The command above installs a moving public source reference; pin a reviewed commit hash for reproducible use. See docs/installation.md for the verified status and alternatives.
Not sure if the AI Act applies? No code needed:
The scan tells you which facts it needs and cannot get from code. You supply them, and the decision moves:
Declared facts are yours, not Regula's. Each is stored with who declared it,
through which command, in answer to which question, and when, in
.regula/facts.json, and the scan prints that provenance beside the decision.
unknown is an answer and is never read as no. A declared fact can move a
decision from insufficient_information to an indication; it does not produce a
risk tier, a compliance score, a readiness percentage or an effort estimate.
Want to scan your code?
Need a review pack?
Generated files are inputs to human review, not an audit opinion, certification, or proof of compliance.
Just want to see it work? (requires the cloned repo : examples/ is not bundled in the pip package)
Install details
The recommended install is pipx : it isolates Regula from your system Python and avoids the externally-managed-environment error on Ubuntu 22.04+, Debian 12+, Fedora, Arch, and Homebrew Python.
If you don't have pipx yet, install it first (one-time):
Already using uv? uvx --from git+https://github.com/kuzivaai/getregula.git@main regula runs the public source without a persistent install. Or install it with uv tool install git+https://github.com/kuzivaai/getregula.git@main.
Running inside a venv or conda env? Use pip install git+https://github.com/kuzivaai/getregula.git@main. The PEP 668 restriction applies to managed system Python, not an activated virtual environment.
See docs/installation.md for troubleshooting (externally-managed-environment, command not found: regula after install, PATH setup per shell).
Try it against a known high-risk fixture:
The --scope all flag is needed because Regula's default scope (production) skips example directories. This fixture intentionally contains employment-related code indicators that exercise the Annex III Category 4 detector; the resulting label is a detector observation, not a legal determination.
See examples/ for runnable reference projects covering prohibited-practice, high-risk, transparency, and no-elevated-indicator scenarios, or walk through the full 10-minute evaluation journey in examples/cv-screening-app/ : install, scan, plan, gap, conform, verify, handoff to red-team tooling.
For a deeper first-time-user walk-through (policy tuning, CI integration, baselining) see docs/QUICKSTART.md. The full documentation is indexed by type (tutorials / how-to / reference / explanation) in docs/README.md.
CI/CD
What Regula tells you
The EU AI Act defines four risk tiers. Regula maps code patterns to each:
Every finding includes the relevant Article reference and explains when exceptions may apply. Regula flags patterns -- it does not make legal determinations.
Coverage has explicit levels. Regula has an evidence-gated questionnaire
and decision model for the EU AI Act, South Korea's AI Basic Act (Act No.
20676), and Colorado SB 26-189. It separately maps findings to selected control
or provision references in 13 frameworks, and publishes dated regional
trackers. A crosswalk or tracker is not an executable applicability decision or
a compliance assessment. See product coverage and user
journeys for the current capability
matrix and claim boundary. Use --jurisdictions on regula check to filter
selected reference mappings; that option also accepts uk, brazil, nist,
and iso, but it does not run an applicability decision. Use --jurisdiction eu, korea, or colorado on regula assess for the three implemented
decision-support configurations.
Developer guide sources: Python | JavaScript | Healthcare | Recruitment | Article 5 | Article 9 | Article 14 | Article 50
Key commands
Regula has 62 commands in total. Run regula --help-all for the full list, or see docs/cli-reference.md.
REST API and web dashboard
For GRC integration or non-terminal users:
Seven endpoints: /health, /v1/check, /v1/classify, /v1/gap, /v1/questionnaire, /v1/questionnaire/evaluate, /v1/dashboard. All return the same JSON envelope as the CLI. No auth -- run behind a reverse proxy for remote access.
Who is this for?
- Builders and maintainers who need an initial list of source-code signals to investigate before contextual and legal review.
- Governance and assurance reviewers who need observations, declared facts, unresolved questions, and provenance kept visibly separate.
- Evaluators and adopters who need reproducible tests, completion data, known failure modes, and a non-blocking path to test Regula on their own representative sample.
- Qualified contextual reviewers who may use Regula artefacts as inputs. Regula does not make their legal, conformity, security, accessibility, or domain determination.
The detailed tasks, failure paths, and required interface states are defined in product coverage and user journeys.
What Regula is (and isn't)
Regula is:
- A development-time evidence and triage tool that combines static code analysis with governance questionnaires, mapping observations and declared facts to possible obligations across 3 jurisdictions (EU AI Act, South Korea AI Basic Act, Colorado SB 26-189)
- A shift-left code-indicator scanner -- like ESLint for governance review, running in your terminal or CI/CD pipeline
- A questionnaire-based assessment tool for organisational obligations that code patterns cannot verify (Articles 9, 17, 27, 72)
- Pattern-based risk indication across 3 jurisdictions, not a legal compliance certificate
- A starting point for compliance awareness, not a finish line
Regula is not:
- A runtime monitoring system (it analyses source code, not running systems)
- A legal compliance certificate (findings are indicators, not legal determinations)
- A replacement for enterprise GRC platforms like Credo AI or Holistic AI (it complements them)
- A production fairness testing platform (
regula biasruns benchmark probes against a local model as a starting point, but does not replace runtime fairness monitoring) - Legal advice (consult qualified legal counsel for compliance decisions)
Regula helps development teams find AI-governance questions earlier across its
implemented jurisdictions and reference frameworks. It does not replace the
organisational, procedural, domain, and legal work required for compliance. For
a detailed account of what falls outside Regula's scope, see
docs/what-regula-does-not-do.md, and for
Regula's own model card (intended use, training data, evaluation, known failure
modes) see docs/MODEL_CARD.md.
Bias evaluation: methodology and ethics
regula bias runs two social-bias benchmarks against a locally-hosted
language model (Ollama, llama3.2/mistral/qwen variants supported)
as evidence for EU AI Act Article 10 data-governance documentation.
Both include Wilson confidence intervals for small-sample reliability and
bootstrap CIs for distribution estimates. Full methodology lives in
scripts/bias_eval.py and
docs/benchmarks/PRECISION_RECALL_2026_04.md.
Ethics statement. CrowS-Pairs and BBQ stereotype pairs are used
solely for scientific evaluation of model behaviour under controlled
conditions. Regula does not display individual stereotype pairs in
terminal output or reports : only aggregated scores, confidence
intervals, and benchmark-level verdicts. The pairs are distributed under
the dataset's own licence (CC BY-SA 4.0 for CrowS-Pairs) and are not
redistributed or modified by Regula. Opinions encoded in the stereotype
pairs do not reflect the views of the maintainer, Regula contributors,
or any user running the tool; their presence is instrumental, not
endorsing. regula bias is a development-time starting point for bias
documentation, not a production fairness monitor : see "What Regula is
(and isn't)" above.
Important limitations
Regula performs pattern-based risk indication, not legal risk classification.
- The EU AI Act classifies risk based on intended purpose and deployment context (Article 6), not code patterns. Regula's findings are indicators that warrant human review.
- False positives will occur. Regula has no current, independently
labelled real-world precision estimate. Its development corpora are
single-reviewer records, and the older random-corpus result cannot be
re-derived from a clean checkout because its measured subset and pinned
source snapshots were not preserved. The arithmetic, limitations, and
superseded measurement remain available as a dated research record in
benchmarks/README.md; they are not evidence of the current detector's accuracy. - TypeScript findings are advisory: current real-world precision is unmeasured. A dated six-finding development slice contained six false positives, which is a warning signal rather than a dependable rate.
- False negatives will occur. Novel risk patterns not in the database will be missed.
- Article 5 prohibitions have conditions and exceptions that require human judgment.
- The audit trail is self-attesting (locally verifiable, not externally witnessed).
- This is not a substitute for legal advice or DPO review.
Verified numbers
For reproduction commands, version-bounded benchmarks, known exceptions, security posture, and audit-trail design, see docs/TRUST.md. What version numbers promise, the public API they cover, and the deprecation policy: docs/VERSIONING.md.
Privacy and data handling
Regula's core scan runs on your machine. No code, findings, or metadata are transmitted during a default scan. There is no account system or API key, and no telemetry by default (crash reporting requires both regula telemetry enable and an endpoint you configure yourself via REGULA_SENTRY_DSN; published builds ship none, and DO_NOT_TRACK suppresses it regardless). The tool reads your source files, analyses them locally, and writes output to your local filesystem. Explicit network-enabled operations include RFC 3161 timestamping, feed or update checks, and integrations you configure. See SECURITY.md for the full security posture.
Contributing
Bug reports and pull requests are welcome.
- Run
pytest tests/ -qbefore opening a PR. - Pattern additions go in
scripts/risk_patterns.py. Each pattern should have a corresponding test. - Regula is intentionally risk indication, not legal classification. New patterns should be conservative -- false positives erode trust more than false negatives for a developer tool.
- See
CONTRIBUTING.mdfor the full contributor guide andCHANGELOG.mdfor version history.
Authorship
Regula currently has a single maintainer. Where commits identify a co-author, that attribution records the tools or collaborators involved. The maintainer remains accountable for reviewing and accepting every merged change. See GOVERNANCE.md for the bus-factor limitation.
Licence
Engine and CLI: Apache License 2.0 OR European Union Public Licence v. 1.2 : at your option. Pick the one that fits your context:
- Apache 2.0 includes an explicit patent grant, making it the preferred choice for enterprise adoption, commercial redistribution, and any context where patent clarity matters.
- EUPL-1.2 is explicitly recognised inside EU institutions and public-sector procurement, is strongly-copyleft on software, and has a formal compatibility appendix (GPL v2/v3, AGPL v3, OSL, EPL, CeCILL, MPL 2.0, LGPL, CC BY-SA 3.0) for downstream projects. If you work with a European public administration, EUPL is often the required or preferred licence.
You may choose either licence for any use. You do not need to state which one you picked, but attribution (keep the copyright notice and NOTICE file) is required under both.
Risk patterns and regulatory data: Detection Rule License (DRL) 1.1. You may use, modify, and redistribute the patterns freely. Attribution is required if you redistribute the patterns or use them in a product. If your tool generates match output from these patterns, the output must credit the source.
The SPDX expression for the full package is (Apache-2.0 OR EUPL-1.2) AND LicenseRef-DRL-1.1.
来源:README.md,提交 fbed8f3
工具
0版本历史
1- v1.9.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分