praevisio
AI governance through verifiable promises — a Python CLI that turns governance requirements into repeatable checks, CI gates, and replayable audit artifacts.
Praevisio evaluates a promise (a claim about your system) using deterministic evidence (today: pytest + semgrep), computes credence via ABDUCTIO, and emits an audit trail you can replay.
- White paper (source of truth):
docs/white-paper.md(rendered by Sphinx) - Tutorials (learn‑by‑doing):
docs/tutorials/ - Sandbox / governed repo to experiment with: https://github.com/Promise-Foundation/praevisio-lab
Choose your path
- Developer (Tier 1): “Will this commit be blocked, and what do I fix?”
- Start with: Tutorials 1–3 (
docs/tutorials/01-logging-basics.md,02-static-analysis.md,03-branch-policy.md)
- Start with: Tutorials 1–3 (
- Governance engineer / compliance (Tier 2): “What promise are we enforcing, and what evidence supports it?”
- Focus: promise files +
.praevisio.yaml+ CI artifacts (.praevisio/runs/**)
- Focus: promise files +
- Power user / auditor (Tier 3): “Can I replay the decision later and inspect integrity?”
- Focus:
audit.json,manifest.json,praevisio replay-audit
- Focus:
What is a “verifiable promise”?
A promise is a machine‑checkable claim defined in your repo:
governance/promises/<promise_id>.yaml
Praevisio evaluates that promise by collecting evidence and producing artifacts:
repo/
├─ governance/promises/<promise_id>.yaml # the claim
├─ tests/ # procedural evidence (pytest)
├─ governance/evidence/semgrep_rules.yaml # observational evidence (semgrep)
└─ .praevisio/runs/<run_id>/ # audit bundle (generated)
├─ evidence/pytest.json
├─ evidence/semgrep.json
├─ audit.json
└─ manifest.json # artifacts + SHA-256 hashes + metadata
Key terms:
- Evidence: artifacts produced by deterministic tools (pytest + semgrep today).
- Credence: probability‑like support that the promise holds given evidence.
- Audit: replayable trace of how credence was computed.
- Manifest: inventory of artifacts with SHA‑256 hashes for integrity review.
- Gate: a policy decision (pass/fail) based on credence + thresholds.
Requirements (current release)
Praevisio is repo‑local: it runs against your governed repository and shells out to tools there.
- Python (recommended: 3.11+)
pytestavailable in the governed repo (if you setpytest_targets)semgrepCLI available onPATH(if you setsemgrep_rules_path)
Tutorials 4+ use optional tooling (e.g., Promptfoo) inside pytest. Those are not base requirements; they’re tutorial‑specific patterns.
Install (PyPI)
pip install praevisio
Verify:
praevisio version
10‑minute quickstart (use the sandbox repo)
If you want a ready‑made governed repository, use: https://github.com/Promise-Foundation/praevisio-lab
Typical flow inside a governed repo:
- Add a promise file:
governance/promises/<id>.yaml - Add evidence: tests + (optionally) Semgrep rules
- Add config:
.praevisio.yaml - Run:
praevisio evaluate-commit . --config .praevisio.yaml --json
You’ll get:
- credence + verdict
- artifact paths for
audit.jsonandmanifest.json - evidence summaries and stable references (
pytest:sha256:…,semgrep:sha256:…)
Quickstart: scaffold config
Create a default .praevisio.yaml:
praevisio install --config-path .praevisio.yaml
This writes a starter configuration you can customize.
CI quickstart (GitHub Actions)
This is a minimal CI gate that:
- runs Praevisio
- writes a JSON report
- uploads audit artifacts for review
name: Praevisio Governance Gate
on:
pull_request:
branches: [main]
jobs:
governance-gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
# If you use Semgrep evidence, ensure Semgrep is installed on the runner.
# - run: pip install semgrep
- name: Install Praevisio
run: |
python -m pip install --upgrade pip
pip install praevisio
- name: Run governance gate
run: |
praevisio ci-gate . \
--severity high \
--fail-on-violation \
--output logs/ci-gate-report.json \
--config .praevisio.yaml
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: praevisio-run
path: |
logs/ci-gate-report.json
.praevisio/runs/**
What the CI report contains
logs/ci-gate-report.json contains (at minimum):
- promise id, credence, verdict
- threshold + severity
- artifact paths + hashes (audit + manifest)
This is designed so reviewers can:
- inspect evidence artifacts
- replay the audit deterministically
Local workflows
Evaluate a repo (JSON output):
praevisio evaluate-commit . --config .praevisio.yaml --json
Replay the most recent audit:
praevisio replay-audit --latest --json
Show a stored run (manifest + artifacts):
praevisio show-run <run_id> --runs-dir .praevisio/runs
Install a pre‑commit gate:
praevisio install-hooks
This writes .git/hooks/pre-commit to invoke praevisio pre-commit.
Configuration: .praevisio.yaml
The configuration binds a promise to evidence sources and gate policy.
Minimal example:
evaluation:
promise_id: llm-input-logging
threshold: 0.95
severity: high
pytest_targets:
- tests/test_logging.py
semgrep_rules_path: governance/evidence/semgrep_rules.yaml
semgrep_callsite_rule_id: llm-call-site
semgrep_violation_rule_id: llm-call-must-log
run_dir: .praevisio/runs
thresholds:
high: 0.95
medium: 0.90
hooks: []
Notes:
- Severity selects the threshold from
evaluation.thresholds[severity]when present. - If
pytest_targetsis empty, tests are considered skipped and credence is penalized (see Tutorial 1). - If Semgrep is configured but the rules file is missing or invalid, evaluation can return error.
Promise files: governance/promises/*.yaml
Example:
id: llm-input-logging
version: 0.1.0
domain: /llm/observability
statement: All LLM API calls must log input prompts.
critical: true
success_criteria:
credence_threshold: 0.95
evidence_types:
- procedural
- pattern
parameters: {}
stake:
credits: 0
Conventions:
- The promise describes what must be true.
- Thresholds / severity belong in
.praevisio.yaml(policy), not in promise YAML.
Evidence and audit artifacts
Each run produces a directory under .praevisio/runs/<run_id>/ with:
evidence/pytest.json— pytest targets, args, exit code, errorsevidence/semgrep.json— rule ids, coverage metrics, violations, findingsaudit.json— ABDUCTIO audit trace for deterministic replaymanifest.json— artifacts + SHA‑256 hashes + run metadata (versions, UTC timestamp, ABDUCTIO config)
These artifacts are intended to be uploaded from CI and reviewed like any other governance record.
Security & data handling
Praevisio writes governance artifacts to disk. Treat them as audit records.
Do not store secrets in .praevisio.yaml or promise YAML files.
Evidence artifacts may include:
- file paths, rule ids, and snippets depending on tool output (e.g., Semgrep findings)
- test metadata and errors
If your organization logs prompts as part of governance:
- redact before writing, and keep raw prompts out of CI artifacts unless explicitly approved
Praevisio provides tamper‑evidence (hashes in a manifest), not hardware‑backed attestation.
Tutorials (canonical learning path)
All tutorials live under docs/tutorials/:
- Logging & credence (ABDUCTIO) — end‑to‑end evaluation + replay
- Static analysis that scales — Semgrep coverage/violations as evidence
- CI gate & branch policy — enforce thresholds in CI + artifact upload
- Red‑teaming via pytest — run tools (Promptfoo) inside pytest, gate on policy
- Prompt injection defenses — enforce boundary wiring + effectiveness in tests
- Privacy protection — PII redaction tests and gating
- Third‑party risk — enforce approvals/expiry via repo‑local registry + tests
If you want a guided sandbox, start with: https://github.com/Promise-Foundation/praevisio-lab
Architecture (short)
Praevisio is layered:
- Domain: core concepts (Promise, EvaluationResult, ports)
- Application: orchestration (evaluation + gates)
- Infrastructure: adapters (Semgrep, subprocess pytest, YAML loaders, evidence store)
- Presentation: Typer CLI (praevisio)
The CLI is intentionally thin: commands map to application services so the engine can be embedded later.
Development
Quickstart (uv)
Install uv: https://docs.astral.sh/uv/
Create venv + install dependencies:
uv venv
uv sync --all-groups
Build docs:
uv run sphinx-build -b html docs docs/_build/html
Open docs/_build/html/index.html.
Alternative (pip/venv)
python -m venv .venv && source .venv/bin/activate
pip install -e .
make -C docs html
BDD (Behave)
uv sync --group dev
uv run behave -f progress
Roadmap (planned)
- Multi‑promise evaluation and per‑promise gating
- Collector plugins beyond pytest/semgrep (structured evidence ingestion)
- Calibrated evidence weighting and tuning guides
- Stronger integrity primitives (signing / provenance bindings)
Contributing
- Keep changes small and outcome‑focused.
- Update docs alongside code changes.
- Prefer tests that exercise the CLI surface area.
License
TBD by the repository owner.
Metadata
Release files for praevisio 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| praevisio-0.1.5.tar.gz | 20.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| praevisio-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.6 kB
Release files / praevisio-0.1.5.tar.gz
| Download URL | praevisio-0.1.5.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
043ac6b6f1cda2ad12995af457fcb67b3895bdcca62a1501df7ff4aeb8f8b152
|
|
BLAKE2b-256 checksum How to use checksums |
624420793291331861c00ca1cfe5c244dceef34e495ddef425d53aa5a6b0dd5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 20, 2025.
Transparency logRelease files / praevisio-0.1.5-py3-none-any.whl
| Download URL | praevisio-0.1.5-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8edf5f68364ac0467f461807ff8db378cd5c1091314aa926b4606aceb979a9c
|
|
BLAKE2b-256 checksum How to use checksums |
bf07d996668a9942908ca56ef1cce0f99d21880b7473e1d39f1b71c8f4eb9311
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 20, 2025.
Transparency logSecurity for praevisio 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for praevisio-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 20, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.