{
  "markdown": "<!-- mcp-name: io.github.kuzivaai/regula -->\n# Regula\n\n**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.**\n\n[![Distribution: source](https://img.shields.io/badge/distribution-source%20install-orange.svg)](docs/installation.md)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE.txt)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://python.org)\n[![CI](https://github.com/kuzivaai/getregula/actions/workflows/ci.yaml/badge.svg)](https://github.com/kuzivaai/getregula/actions)\n[![Tests](https://img.shields.io/badge/tests-2936%20collected-blue.svg)](#verified-numbers)\n[![Accessibility target: WCAG 2.2 AA](https://img.shields.io/badge/accessibility%20target-WCAG%202.2%20AA-blue.svg)](docs/accessibility/README.md)\n\n---\n\n## Table of contents\n\n- [What it does](#what-it-does)\n- [Choose how to start](#choose-how-to-start)\n- [Quick start](#quick-start)\n- [What Regula tells you](#what-regula-tells-you)\n- [Key commands](#key-commands)\n- [Who is this for?](#who-is-this-for)\n- [What Regula is (and isn't)](#what-regula-is-and-isnt)\n- [Bias evaluation: methodology and ethics](#bias-evaluation-methodology-and-ethics)\n- [Important limitations](#important-limitations)\n- [Verified numbers](#verified-numbers)\n- [Contributing](#contributing)\n- [Licence](#licence)\n\n---\n\n```console\n$ regula check examples/cv-screening-app --scope all\n\nDecision: insufficient_information\nJurisdiction: eu\nRule resolution: unresolved\nFacts needed to resolve the next decision: 2\n  - is_ai_system: Does the subject meet the governing law's definition of an AI system or regulated automated technology?\n  - jurisdiction_in_scope: Does this jurisdiction's territorial and operator scope apply?\n\nDetector observations (not legal facts):\n\n  Detector summary: ANNEX III OR SECURITY PATTERNS\n  The scanner found patterns relevant to Annex III or security review.\n  Resolve the facts listed above before attaching Article 9 to 15 duties.\n  Files scanned:      1\n  High-risk:          1\n  INFO tier:          1\n\n  HIGH-RISK INDICATORS:\n    [INFO] [ 43] app.py — Employment and workers management [plan]\n\n  Detector priority: 0-100 (higher = more code patterns matched; not a correctness probability)\n```\n\n*Excerpt from the real output of the command shown, against the tracked fixture\n[`examples/cv-screening-app`](examples/cv-screening-app/). The per-category\ncounts that read zero and the next-steps footer are omitted for length; nothing\nelse is edited. `scripts/verify_transcripts.py` re-runs this command on every\ncheck and fails if any line above stops appearing in its output.*\n\n---\n\n## What it does\n\nRegula 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.\n\nReference 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.\n\nIn 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.\n\n## Choose how to start\n\n| If you want to… | Start here |\n|---|---|\n| Explore the questions without installing anything | The browser assessment source is in [`site/assess/`](site/assess/). The public Pages deployment is currently unavailable; when restored, it records declared context for review but does not inspect your repository or make a legal determination. |\n| Check a local codebase | Follow the [Quick start](#quick-start), then run `regula check .`. |\n| Evaluate Regula before adopting it | Follow the [10-minute example journey](examples/cv-screening-app/) and read the [documented limitations and verification evidence](docs/TRUST.md). |\n| Add a repeatable team check | Use the [CI/CD example](#cicd) and review the exit-code policy before making it blocking. |\n| Prepare material for a human reviewer | Generate a reviewer-completable evidence scaffold, then complete and validate its contextual fields. |\n\n## Quick start\n\n```bash\npipx install git+https://github.com/kuzivaai/getregula.git@main\n```\n\nPyPI 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`](docs/installation.md) for the verified status and alternatives.\n\n**Not sure if the AI Act applies?** No code needed:\n```bash\nregula assess               # record declared context for human review\nregula assess --save-facts  # and write the answers where `regula check` reads them\n```\n\nThe scan tells you which facts it needs and cannot get from code. You supply\nthem, and the decision moves:\n\n```bash\nregula check . --list-facts                     # every fact id the model defines\nregula check . --fact is_ai_system=yes \\\n               --fact jurisdiction_in_scope=yes # declare them for one run\n```\n\nDeclared facts are **yours**, not Regula's. Each is stored with who declared it,\nthrough which command, in answer to which question, and when, in\n`.regula/facts.json`, and the scan prints that provenance beside the decision.\n`unknown` is an answer and is never read as `no`. A declared fact can move a\ndecision from `insufficient_information` to an indication; it does not produce a\nrisk tier, a compliance score, a readiness percentage or an effort estimate.\n\n**Want to scan your code?**\n```bash\nregula check .              # 423 tier patterns, 8 language families; runtime varies\nregula check . --jurisdictions eu,korea,colorado  # selected reference mappings\n```\n\n**Need a review pack?**\n```bash\nregula evidence-pack --project .   # reviewer-completable evidence scaffold\nregula conform --sign --timestamp  # integrity metadata (requires regula[signing])\n```\n\nGenerated files are inputs to human review, not an audit opinion, certification, or proof of compliance.\n\n**Just want to see it work?** (requires the cloned repo :  `examples/` is not bundled in the pip package)\n```bash\ngit clone https://github.com/kuzivaai/getregula && cd getregula\nregula demo                 # scan a bundled example project\n```\n\n### Install details\n\nThe 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.\n\nIf you don't have pipx yet, install it first (one-time):\n\n| Platform | Install pipx |\n|---|---|\n| macOS | `brew install pipx && pipx ensurepath` |\n| Debian / Ubuntu | `sudo apt install pipx && pipx ensurepath` |\n| Fedora | `sudo dnf install pipx && pipx ensurepath` |\n| Arch | `sudo pacman -S python-pipx && pipx ensurepath` |\n| Windows | `python -m pip install --user pipx && python -m pipx ensurepath` |\n\n**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`.\n\n**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.\n\nSee [`docs/installation.md`](docs/installation.md) for troubleshooting (`externally-managed-environment`, `command not found: regula` after install, PATH setup per shell).\n\n### Try it against a known high-risk fixture:\n\n```bash\nregula check examples/cv-screening-app --scope all\n```\n\nThe `--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.\n\nSee [`examples/`](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/`](examples/cv-screening-app/) :  install, scan, plan, gap, conform, verify, handoff to red-team tooling.\n\nFor a deeper first-time-user walk-through (policy tuning, CI integration, baselining) see [`docs/QUICKSTART.md`](docs/QUICKSTART.md). The full documentation is indexed by type (tutorials / how-to / reference / explanation) in [`docs/README.md`](docs/README.md).\n\n### CI/CD\n\n```yaml\n# .github/workflows/regula.yaml\nname: AI Governance Check\non: [push, pull_request]\njobs:\n  regula:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: kuzivaai/getregula@v1\n        with:\n          path: '.'\n          upload-sarif: 'true'\n          fail-on-prohibited: 'true'\n```\n\n## What Regula tells you\n\nThe EU AI Act defines four risk tiers. Regula maps code patterns to each:\n\n| Tier | Action | What it means |\n|------|--------|---------------|\n| **Potentially prohibited** (Article 5) | Block indicator | Reports code patterns associated with listed practices for urgent contextual review. |\n| **Potentially high-risk** (Article 6 and Annex III) | Warn + review map | Reports candidate use categories and maps provisions that may be relevant if a reviewer confirms the legal classification. |\n| **Potential transparency duty** (Article 50) | Transparency indicator | Reports chatbot, synthetic-content and related implementation signals; the applicable paragraph and exceptions require review. |\n| **No elevated code indicator** | Log only | Means the scanner did not observe a configured elevated indicator. It does not establish minimal-risk status or absence of legal duties. |\n\nEvery finding includes the relevant Article reference and explains when exceptions may apply. Regula flags patterns -- it does not make legal determinations.\n\n**Coverage has explicit levels.** Regula has an evidence-gated questionnaire\nand decision model for the EU AI Act, South Korea's AI Basic Act (Act No.\n20676), and Colorado SB 26-189. It separately maps findings to selected control\nor provision references in 13 frameworks, and publishes dated regional\ntrackers. A crosswalk or tracker is not an executable applicability decision or\na compliance assessment. See [product coverage and user\njourneys](docs/PRODUCT_COVERAGE_AND_JOURNEYS.md) for the current capability\nmatrix and claim boundary. Use `--jurisdictions` on `regula check` to filter\nselected reference mappings; that option also accepts `uk`, `brazil`, `nist`,\nand `iso`, but it does not run an applicability decision. Use `--jurisdiction\neu`, `korea`, or `colorado` on `regula assess` for the three implemented\ndecision-support configurations.\n\n**Developer guide sources:**\n[Python](site/guides/eu-ai-act-python.html) |\n[JavaScript](site/guides/eu-ai-act-javascript.html) |\n[Healthcare](site/guides/eu-ai-act-healthcare.html) |\n[Recruitment](site/guides/eu-ai-act-recruitment-hiring.html) |\n[Article 5](site/guides/article-5-prohibited-practices.html) |\n[Article 9](site/guides/article-9-risk-management.html) |\n[Article 14](site/guides/article-14-human-oversight.html) |\n[Article 50](site/guides/article-50-transparency.html)\n\n## Key commands\n\n| Command | What it does |\n|---------|-------------|\n| `regula` | Scan the current directory, show an indicator summary and next steps |\n| `regula check .` | Detailed risk scan with per-file findings |\n| `regula comply` | EU AI Act obligation evidence and unresolved facts; `--article 50` separates declared applicability facts from static implementation signals |\n| `regula gap --project .` | Compliance gap assessment against Articles 9-15 |\n| `regula plan --project .` | Prioritised remediation plan based on gap results |\n| `regula fix --project .` | Generate compliance fix scaffolds for findings |\n| `regula evidence-pack --project .` | Reviewer-completable evidence scaffold with integrity metadata |\n| `regula conform --project .` | Article 43 conformity assessment evidence pack |\n| `regula dpv --project .` | Export the risk indication as DPV-AIAct JSON-LD (aligned to the DPVCG EU-AIAct vocabulary) for RDF/GRC tooling |\n| `regula check --ci .` | CI mode -- exit code 1 on any WARN or BLOCK finding, SARIF output |\n| `regula assess` | Structured declared-context questionnaire for applicability and risk review |\n| `regula demo` | Scan a bundled example project -- zero-commitment trial |\n| `regula api-server` | Start the REST API (localhost:8487) with web dashboard |\n| `regula conform --organisational` | Governance self-assessment for Articles 9/17/27/72 |\n| `regula questionnaire` | Context-driven risk assessment questionnaire (also via REST API) |\n| `regula exempt` | Article 6(3) high-risk exemption decision tree |\n| `regula oversight .` | Article 14 human oversight analysis (cross-file flow tracing) |\n| `regula guardrails .` | Article 15 guardrail implementation coverage detection |\n| `regula owasp-agentic` | OWASP Top 10 for Agentic Applications assessment |\n| `regula monitor` | Analyse locally recorded agent/tool events for selected Article 12 record-keeping signals; it does not observe a running system by itself |\n| `regula gdpr` | GDPR cross-reference scan ([14 focused checks](scripts/gdpr_scan.py), 4 AI Act/GDPR hotspots) |\n| `regula bias` | CrowS-Pairs bias evaluation (1,508 sentence pairs) with optional BBQ benchmark. Aligned with Digital Omnibus bias-testing safeguards (Article 4a, COM(2025)836). |\n| `regula mcp-server` | MCP server (JSON-RPC stdio) exposing three tools :  `regula_check`, `regula_classify`, `regula_gap` :  for Claude Code, Cursor, and other MCP clients |\n| `regula install <integration>` | Set up the pre-commit framework or direct Git hook integration |\n\nRegula has 62 commands in total. Run `regula --help-all` for the full list, or see [`docs/cli-reference.md`](docs/cli-reference.md).\n\n### REST API and web dashboard\n\nFor GRC integration or non-terminal users:\n\n```bash\npython3 scripts/api_server.py --port 8487\n# Open http://localhost:8487/v1/dashboard\n```\n\nSeven 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.\n\n## Who is this for?\n\n- **Builders and maintainers** who need an initial list of source-code signals to investigate before contextual and legal review.\n- **Governance and assurance reviewers** who need observations, declared facts, unresolved questions, and provenance kept visibly separate.\n- **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.\n- **Qualified contextual reviewers** who may use Regula artefacts as inputs. Regula does not make their legal, conformity, security, accessibility, or domain determination.\n\nThe detailed tasks, failure paths, and required interface states are defined in\n[product coverage and user journeys](docs/PRODUCT_COVERAGE_AND_JOURNEYS.md).\n\n## What Regula is (and isn't)\n\n**Regula is:**\n\n- A development-time evidence and triage tool that combines static code\n  analysis with governance questionnaires, mapping observations and declared\n  facts to possible obligations across 3 jurisdictions (EU AI Act, South\n  Korea AI Basic Act, Colorado SB 26-189)\n- A shift-left code-indicator scanner -- like ESLint for governance review, running in your terminal or CI/CD pipeline\n- A questionnaire-based assessment tool for organisational obligations that code patterns cannot verify (Articles 9, 17, 27, 72)\n- Pattern-based risk indication across 3 jurisdictions, not a legal compliance certificate\n- A starting point for compliance awareness, not a finish line\n\n**Regula is not:**\n\n- A runtime monitoring system (it analyses source code, not running systems)\n- A legal compliance certificate (findings are indicators, not legal determinations)\n- A replacement for enterprise GRC platforms like Credo AI or Holistic AI (it complements them)\n- A production fairness testing platform (`regula bias` runs benchmark probes against a local model as a starting point, but does not replace runtime fairness monitoring)\n- Legal advice (consult qualified legal counsel for compliance decisions)\n\nRegula helps development teams find AI-governance questions earlier across its\nimplemented jurisdictions and reference frameworks. It does not replace the\norganisational, procedural, domain, and legal work required for compliance. For\na detailed account of what falls outside Regula's scope, see\n[`docs/what-regula-does-not-do.md`](docs/what-regula-does-not-do.md), and for\nRegula's own model card (intended use, training data, evaluation, known failure\nmodes) see [`docs/MODEL_CARD.md`](docs/MODEL_CARD.md).\n\n## Bias evaluation: methodology and ethics\n\n`regula bias` runs two social-bias benchmarks against a locally-hosted\nlanguage model (Ollama, `llama3.2`/`mistral`/`qwen` variants supported)\nas evidence for EU AI Act Article 10 data-governance documentation.\n\n| Benchmark | Paper | Method | What it measures |\n|---|---|---|---|\n| CrowS-Pairs | Nangia et al., 2020 | Log-probability difference between stereotypical and anti-stereotypical sentence pairs | Intrinsic bias in masked/causal LM output |\n| BBQ | Parrish et al., 2022 | Question-answering on ambiguous-context prompts | Bias surfacing in downstream QA behaviour |\n\nBoth include Wilson confidence intervals for small-sample reliability and\nbootstrap CIs for distribution estimates. Full methodology lives in\n[`scripts/bias_eval.py`](scripts/bias_eval.py) and\n[`docs/benchmarks/PRECISION_RECALL_2026_04.md`](docs/benchmarks/PRECISION_RECALL_2026_04.md).\n\n**Ethics statement.** CrowS-Pairs and BBQ stereotype pairs are used\n**solely for scientific evaluation** of model behaviour under controlled\nconditions. Regula does **not display individual stereotype pairs** in\nterminal output or reports :  only aggregated scores, confidence\nintervals, and benchmark-level verdicts. The pairs are distributed under\nthe dataset's own licence (CC BY-SA 4.0 for CrowS-Pairs) and are not\nredistributed or modified by Regula. Opinions encoded in the stereotype\npairs do not reflect the views of the maintainer, Regula contributors,\nor any user running the tool; their presence is instrumental, not\nendorsing. `regula bias` is a development-time starting point for bias\ndocumentation, not a production fairness monitor :  see \"What Regula is\n(and isn't)\" above.\n\n## Important limitations\n\nRegula performs **pattern-based risk indication**, not legal risk classification.\n\n- 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.\n- **False positives will occur.** Regula has no current, independently\n  labelled real-world precision estimate. Its development corpora are\n  single-reviewer records, and the older random-corpus result cannot be\n  re-derived from a clean checkout because its measured subset and pinned\n  source snapshots were not preserved. The arithmetic, limitations, and\n  superseded measurement remain available as a dated research record in\n  [`benchmarks/README.md`](benchmarks/README.md); they are not evidence of the\n  current detector's accuracy.\n- **TypeScript findings are advisory:** current real-world precision is\n  unmeasured. A dated six-finding development slice contained six false\n  positives, which is a warning signal rather than a dependable rate.\n- **False negatives will occur.** Novel risk patterns not in the database will be missed.\n- Article 5 prohibitions have conditions and exceptions that require human judgment.\n- The audit trail is self-attesting (locally verifiable, not externally witnessed).\n- This is not a substitute for legal advice or DPO review.\n\n## Verified numbers\n\n| What | Count |\n|------|------:|\n| CLI commands | 62 |\n| Risk detection patterns (regexes) | 423 |\n| Language families scanned | 8 (Python, JS, TS, Java, Go, Rust, C/C++, Jupyter) |\n| Framework identifiers with selected references | 13 |\n| Tests (pytest --collect-only) | 2,936 |\n| Required production dependencies | 0 |\n\nFor reproduction commands, version-bounded benchmarks, known exceptions, security posture, and audit-trail design, see [`docs/TRUST.md`](docs/TRUST.md). What version numbers promise, the public API they cover, and the deprecation policy: [`docs/VERSIONING.md`](docs/VERSIONING.md).\n\n## Privacy and data handling\n\nRegula'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`](SECURITY.md) for the full security posture.\n\n## Contributing\n\nBug reports and pull requests are welcome.\n\n- Run `pytest tests/ -q` before opening a PR.\n- Pattern additions go in `scripts/risk_patterns.py`. Each pattern should have a corresponding test.\n- 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.\n- See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the full contributor guide and [`CHANGELOG.md`](CHANGELOG.md) for version history.\n\n### Authorship\n\nRegula 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](GOVERNANCE.md) for the bus-factor limitation.\n\n## Licence\n\n**Engine and CLI:** [Apache License 2.0](LICENSE.txt) **OR** [European Union Public Licence v. 1.2](LICENSE.EUPL) :  at your option. Pick the one that fits your context:\n\n- **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.\n- **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.\n\nYou 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.\n\n**Risk patterns and regulatory data:** [Detection Rule License (DRL) 1.1](docs/LICENSE.Detection.Rules.md). 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.\n\nThe SPDX expression for the full package is `(Apache-2.0 OR EUPL-1.2) AND LicenseRef-DRL-1.1`.\n",
  "bytes": 24271,
  "sha": "22c4eca3a895a21766ba972ad24cdbfbcef84dfcb2b986ce1c496861268ea7b6",
  "repo_slug": "kuzivaai/getregula",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kuzivaai_regula_63d6775b/readme"
}