|
| 1 | +# Runnable Assurance — Sentinel v2.4 Governance Artifacts |
| 2 | + |
| 3 | +This directory upgrades the Sentinel v2.4 governance artifacts from *declarative* |
| 4 | +(schemas, prose controls, policy sketches) to **executable and verifiable**. Where |
| 5 | +the master reference documents assert that a control "holds," the artifacts here |
| 6 | +*prove* it with industry-standard tooling. |
| 7 | + |
| 8 | +> Scope note. These artifacts implement the standards-grounded core (OSCAL 1.1.2, |
| 9 | +> OPA/Rego, TLA+/TLC, Circom/Groth16, FIPS 203/204/205 references). AGI/ASI |
| 10 | +> *containment* is modelled as a control-and-invariant discipline; speculative |
| 11 | +> regime fixtures (ICGC/GACP, GAIRA) remain tagged `feasibility-tier` C/D in the |
| 12 | +> OSCAL catalog and are not claimed as settled practice. |
| 13 | +
|
| 14 | +## One command |
| 15 | + |
| 16 | +```bash |
| 17 | +bash governance_artifacts/run_runnable_assurance.sh |
| 18 | +``` |
| 19 | + |
| 20 | +Runs all five checks below and fails fast on any error. |
| 21 | + |
| 22 | +## What is proven, and against which control |
| 23 | + |
| 24 | +| # | Check | Tool | Backs OSCAL control | Regime anchor | |
| 25 | +|---|-------|------|---------------------|---------------| |
| 26 | +| 1 | Deny-by-default release gate + high-impact credit gate | `opa test` (12 tests) | release-gate semantics; `con-07` quorum | SR 11-7, EU AI Act Art. 14, ECOA, GDPR Art. 22 | |
| 27 | +| 2 | Containment one-way ratchet & terminal-actuation quorum | TLA+ `tlc2.TLC` | `con-04`, `con-07` | EU AI Act Art. 14, DORA resilience testing | |
| 28 | +| 3 | GC-IR cross-target conformance (policy ⇔ circuit ⇔ expectation) | `opa eval` + Circom witness | obligation `ob-ecoa-adverse-reason-codes` | ECOA, GDPR Art. 22, EU AI Act Art. 13 | |
| 29 | +| 4 | Systemic-risk concentration bound (HHI) zk proof | Circom + Groth16 (snarkjs) | `cry-05` | Basel op-risk, systemic telemetry | |
| 30 | +| 5 | Governance artifact schema validation | Python validator | manifest/schema integrity | OSCAL, evidence logging (EU AI Act Art. 12) | |
| 31 | + |
| 32 | +## 1. OPA policy tests — `rego/` |
| 33 | + |
| 34 | +- `release_gate.rego` — high-impact release is **deny-by-default**; `allow` requires |
| 35 | + containment `ENFORCED`, dual-control quorum ≥ 2, signed bundle, and both the |
| 36 | + Omni-Sentinel safety control and the SR 11-7 validation control. |
| 37 | +- `high_impact_credit.rego` — adverse credit underwriting requires human review, |
| 38 | + ≥ 3 reason codes, fairness within an equal-opportunity delta, verified lineage, |
| 39 | + no active incident. |
| 40 | +- `fairness_credit_decision.rego` — the Rego emission target of the GC-IR obligation. |
| 41 | + |
| 42 | +```bash |
| 43 | +opa test governance_artifacts/rego/ -v # 12/12 PASS |
| 44 | +``` |
| 45 | + |
| 46 | +## 2. TLA+ containment ratchet — `tla/KillSwitchAbstract.tla` |
| 47 | + |
| 48 | +Models containment levels L0 NORMAL → L4 TERMINATED. Autonomous Supervisory Agents |
| 49 | +(ASAs) may only *raise* level within L0–L2; lowering the level or actuating the |
| 50 | +terminal levels L3/L4 requires a human dual-control quorum. TLC exhaustively checks: |
| 51 | + |
| 52 | +- `TypeOK`, `ASARatchet`, `TerminalNeedsQuorum` (invariants) |
| 53 | +- `ASANeverLowers`, `DeEscalationNeedsQuorum` (action properties) |
| 54 | + |
| 55 | +```bash |
| 56 | +cd governance_artifacts/tla |
| 57 | +java -cp tools/tla2tools.jar tlc2.TLC -config KillSwitchAbstract.cfg KillSwitchAbstract.tla |
| 58 | +# -> "Model checking completed. No error has been found." (13 distinct states) |
| 59 | +``` |
| 60 | + |
| 61 | +## 3. GC-IR cross-target harness — `zk/gcir_harness.py` |
| 62 | + |
| 63 | +The GC-IR design claims a single obligation compiles to multiple targets and that |
| 64 | +"any disagreement fails the build." This harness makes that real for |
| 65 | +`ob-ecoa-adverse-reason-codes`: it runs each shared fixture through the **Rego** |
| 66 | +rule (`opa eval`) and through the **Circom** circuit (real witness generation), then |
| 67 | +asserts `rego_allow == circuit_witness_producible == declared_expectation`. |
| 68 | + |
| 69 | +```bash |
| 70 | +cd governance_artifacts/zk && python3 gcir_harness.py |
| 71 | +# fx-001 allow / fx-002 deny (too few codes) / fx-003 deny (unapproved code) — all agree |
| 72 | +``` |
| 73 | + |
| 74 | +## 4. SRC-1 systemic-risk concentration proof — `zk/` |
| 75 | + |
| 76 | +`circuits/src1_concentration_bound.circom` proves, in zero knowledge, that the |
| 77 | +decision-volume **Herfindahl-Hirschman Index** across foundation-model providers |
| 78 | +does not exceed a board-ratified threshold (basis points), with `circuit_tag` |
| 79 | +binding the proof to circuit revision SRC-1. The flow runs a dev Powers-of-Tau |
| 80 | +ceremony, Groth16 setup, proves the compliant fixture, verifies it, and emits a |
| 81 | +`proof_statement.json` conforming to `proof_statement_schema.json`. The negative |
| 82 | +test shows an over-concentrated portfolio **cannot** produce a witness. |
| 83 | + |
| 84 | +```bash |
| 85 | +cd governance_artifacts/zk && bash run_src1_proof.sh |
| 86 | +# -> snarkJS: OK! (proof verifies); violation fixture rejected (soundness) |
| 87 | +``` |
| 88 | + |
| 89 | +> The Powers-of-Tau ceremony here is a **development** ceremony and is **not** |
| 90 | +> production-secure. A production deployment requires a multi-party trusted setup |
| 91 | +> (or a transparent system such as PLONK/STARK as noted in the schema enum). |
| 92 | +
|
| 93 | +## Reproducing from a clean checkout |
| 94 | + |
| 95 | +```bash |
| 96 | +# OPA |
| 97 | +curl -sSL -o /usr/local/bin/opa https://openpolicyagent.org/downloads/v0.70.0/opa_linux_amd64_static && chmod +x /usr/local/bin/opa |
| 98 | +# circom 2.1.9 + snarkjs/circomlib |
| 99 | +curl -L -o ~/.local/bin/circom https://github.com/iden3/circom/releases/download/v2.1.9/circom-linux-amd64 && chmod +x ~/.local/bin/circom |
| 100 | +( cd governance_artifacts/zk && npm install ) |
| 101 | +# TLA+ tools |
| 102 | +curl -L -o governance_artifacts/tla/tools/tla2tools.jar https://github.com/tlaplus/tlaplus/releases/download/v1.7.4/tla2tools.jar |
| 103 | +# Python |
| 104 | +pip install pyyaml jsonschema |
| 105 | +# Run everything |
| 106 | +bash governance_artifacts/run_runnable_assurance.sh |
| 107 | +``` |
| 108 | + |
| 109 | +> Sandbox note: compile circuits with `--O0` if circom raises a `SystemTimeError` |
| 110 | +> during constraint simplification (a known clock-skew issue in some containers). |
0 commit comments