# CAIN-42 L5 GOVERNANCE READINESS REPORT

**Evolution #2 — L5 Autonomous Agent Governance Fabric**
Generated 2026-09-28. Every number below is derived from the repository, a test run, a build script, or a
measured benchmark performed for this report.

> **CAIN-42 IS NOT THE AGENT. CAIN-42 IS THE TRUSTED GOVERNANCE FABRIC THAT MAKES HIGHLY AUTONOMOUS AGENTS
> GOVERNABLE. NO AUTHORIZATION → NO EXECUTION.**
> **No L5 production claim is made.** The authoritative conformance result is `cag-l5-conformance.json`
> (`overall: FAIL`), and it is not overridden by any label in this document.

Companion documents: [`CAIN42_L5_AUTONOMY_SPEC.md`](docs/strategy/CAIN42_L5_AUTONOMY_SPEC.md),
[`CAIN42-TO-GOVERNED-L5-AGENT.md`](docs/strategy/CAIN42-TO-GOVERNED-L5-AGENT.md),
`CAIN42_L5_THREAT_MODEL.md`, `CAIN42_L5_REFERENCE_ARCHITECTURE.md`, `CAIN42_L5_REPOSITORY_AUDIT.md`
(repository bypass audit — in progress at the time of writing; see §J).

---

## A. Implemented

What actually exists (library code + wiring + tooling), all under `cain45/l5/` unless stated.

| Component | File | What it does |
|---|---|---|
| Autonomy vector (12 dims) | `cain45/l5/autonomy.py` | A1–A12 with current/max/ceiling + trust/risk/authority/evidence/revocation requirements; no single score |
| Authority root | `cain45/l5/authority.py` | `AUTHORITY_ROOT` over 10 governed states via existing `cain45.canon` |
| Effective authority | `cain45/l5/authority.py` | `MIN(...)` over 12 constraints; DENY/REVALIDATE; downgrade rules |
| Certificate + lease | `cain45/l5/certificate.py` | signed, expiring, bounded; lease non-self-renewing; restrict-only emergency override |
| Admission + registry | `cain45/l5/governance.py` | 15-requirement admission; lifecycle; external certified decision required |
| Change control | `cain45/l5/governance.py` | model/tool/memory/world-model change → REVALIDATE |
| Execution gate | `cain45/l5/governance.py` | ALLOW/DENY/REVALIDATE/PAUSE/ESCALATE/QUARANTINE/ROLLBACK + evidence digest |
| Invariants I01–I20 | `cain45/l5/invariants.py` | executable, all hold |
| ActionIntent | `cain45/l5/intent.py` | signed, hash-chained canonical intent; chain verification |
| Boundary (restriction-only) | `cain45/l5/boundary.py` | `restrict()` is one-directional; bridges hypervisor + MCPGate |
| Caller↔subject auth | `cain45/l5/caller_auth.py` | signed `CallerAssertion`; replay/expiry/revocation/tenant/subject checks |
| Hypervisor wiring | `cain45/hypervisor.py` | `l5_boundary=` consulted in `_gate`; `caller_authenticator=` enforced in `authorize` |
| MCPGate wiring | `cain/mcp_proxy.py` | `l5_boundary=` + `subject_authenticator=` in `evaluate_tool_call` |
| CLI | `scripts/cain42_l5/cain_l5_cli.py`, `bin/cain-l5` | `audit`, `verify`, `conformance`, `simulate` |
| Artifacts | `CAIN42_L5_BASELINE.json`, `..._ATTACK_MATRIX.json`, `..._CONFORMANCE_MATRIX.json`, `..._ACCEPTANCE_GATE.json`, `..._GOVERNANCE_READINESS.json`, `CAIN42_L5_EVIDENCE_BUNDLE.json`, `cag-l5-conformance.json` | generated by `scripts/cain42_l5/build_l5_artifacts.py` |

## B. Verified (reproducible evidence)

| Claim | Evidence | Result |
|---|---|---|
| I01–I20 hold | `python3 -c "from cain45.l5 import check_all"` | 20/20 |
| L5 conformance tests | `tests/test_cain42_l5_constitution.py` | 49 pass |
| Wiring / restriction-only / caller auth | `tests/test_cain42_l5_wiring.py` | 11 pass |
| Soak + clean-room verifier | `tests/test_cain42_l5_soak_and_verifier.py` | 5 pass |
| Long-horizon governance persists | `scripts/cain42_l5/l5_soak.py --steps 3000` | 3,000 steps, 0 violations, 3,000-decision evidence chain |
| Signed bundle is independently checkable | `scripts/cain42_l5/verify_l5_bundle.py` (no CAIN imports) | VALID, 10/10 |
| No regression in hypervisor/MCPGate | 206 passed across the hypervisor/MCPGate/regression group | 206 passed, 4 xfailed |
| Kernel-level attacks blocked | `CAIN42_L5_ATTACK_MATRIX.json` | 24 executed PASS, 6 NOT_TESTED, 0 FAIL |

## C. Incomplete

- **L5 in the hosted path.** The boundary is a library the operator runs on the gateway host; the hosted
  gateway process does not yet construct an `L5Boundary`. `cag-l5-conformance.json` records
  `live_hosted_enforcement: NOT_APPLICABLE`.
- **Real LLM agent.** No production LLM agent is governed end-to-end; the evidence is library + scripted
  (`real_llm_agent: FAIL`).
- **Durable replay/nonce state.** The `CallerAuthenticator` nonce store and the L5 gate are in-process; they
  are not yet backed by the hypervisor's `used_nonces` table or replicated across restarts/replicas.
- **Live long-horizon.** The soak is in-process (SIMULATED). No ≥30-day live run exists; the 72-hour PBFT
  soak remains FAILED (seq 4094).
- **Three-site publication.** Deliberately not updated (owner-gated).

## D. Not Verified

- **Independent third-party review** (`C42-THIRD-PARTY-REVIEW` NOT_IMPLEMENTED).
- **Hardware root of trust** (`C42-HARDWARE-ATTESTATION` NOT_IMPLEMENTED).
- **Multi-provider / validator diversity** (`C42-MULTI-PROVIDER` NOT_IMPLEMENTED; one image digest).
- **Byzantine protection of L5 governance state.** The L5 certificate/lease/authority state is not itself
  consensus-replicated; it is bound to the existing quorum-certified authorizations but not independently
  agreed. This must not be read as an L5 Byzantine guarantee.
- **Repository-wide bypass coverage.** The exhaustive bypass audit is in progress (§J); until it completes,
  universal "no hidden execution path" cannot be claimed.

## E. Security Assumptions

- Honest majority on the Cauchy cluster (n=4, f=1, q=3) under the documented threat model
  (`CAIN42_L5_THREAT_MODEL.md`).
- The operator honestly supplies `cert_lookup` / `trust_lookup` / `quorum_lookup` to the L5 boundary; a
  wrong lookup can only make the boundary deny more, never less.
- Caller private keys are held by the caller and never shared with CAIN; CAIN stores only public keys.
- The host is not compromised. There is no hardware root of trust; host root defeats confinement by design.
- Once provider: replicas of a cluster are on one provider; host loss is a correlated fault.

## F. Known Limitations

- The **execution gate does not verify the certificate signature itself** — signature verification is done by
  the clean-room verifier and by callers; the gate checks presence, expiry, authority-root binding and
  policy-root binding. This is documented, not hidden.
- Enabling the L5 boundary **without issued certificates denies everything** (fail-closed). That is the
  intended default, not a bug.
- Unknown decisions/labels in `restrict()` are treated as DENY (fail-closed).
- The world model is tabular (not neural); governed memory is not a vector store; the predictor is a keyword
  classifier. None of them can authorize.
- Caller assertions are Ed25519 and short-lived; a stolen caller key is a compromise the signature cannot
  detect — revocation is the control.

## G. Performance (measured on this host, 2026-09-28)

| Operation | Measurement |
|---|---|
| L5 execution gate — ALLOW path | 53.6 µs/op · ~18,642 ops/s (20,000 evals in 1.073 s) |
| L5 execution gate — DENY path | 45.3 µs/op · ~22,051 ops/s (20,000 evals in 0.907 s) |
| Invariant matrix I01–I20 | 1.6 ms for all 20 |
| Long-horizon soak | 3,000 governed steps with 0 violations (in-process) |

Not measured here: end-to-end authorization latency through the live cluster (owned by Evolution #1's live
bundles, e6/e7), and L5 wiring overhead inside a running gateway.

## H. L5 Governance Coverage (CAG-L5 requirements)

| CAG-L5 requirement | Status | Where |
|---|---|---|
| CAG-L5 defined (not SAE) | Defined | `CAIN42_L5_AUTONOMY_SPEC.md` §1 |
| Governance control plane at the action-commit boundary | Implemented (library, opt-in) | `cain45/l5/boundary.py` + wiring |
| Canonical ActionIntent | Implemented + tested | `cain45/l5/intent.py` |
| Dynamic `MIN(...)` authority | Implemented + tested | `cain45/l5/authority.py` |
| Cryptographic delegation chains | Partial | `cain45/zod.py`, `cain45/swarm.py`, `cain45/economics.py`; L5 `delegation_chain` in `ActionIntent` |
| Trajectory-level governance | Partial | `cain45/trajectory.py`, hypervisor trajectory head; not wired to L5 gate |
| Predictive blast radius | Partial | `cain45/world_model.py` (tabular); gate consumes a blast-radius value |
| Governance state machine | Implemented (lifecycle) | `cain45/l5/governance.py` |
| Continuous trust governance | Partial | `cain45/hypervisor.py:_reauthorize`; trust feeds the gate |
| Human governance without bottleneck (Tiers 0–4) | Not implemented | — |
| Policy-as-code | Partial | `cain45/governance.py` (policy governor); L5 gate reasons only |
| Independent governance (plan ≠ govern ≠ execute) | Implemented | restriction-only boundary + registry |
| L5 safety contract | Implemented (as certificate + gate) | `cain45/l5/certificate.py` |
| L5 agent registry | Implemented | `cain45/l5/governance.py` |
| Automatic containment | Implemented (hypervisor) | `cain45/hypervisor.py` quarantine/cascade |
| Byzantine fabric extension | Existing, not extended to L5 state | `cain45/authoritative_state.py` |
| L5 evidence fabric | Partial | decision digests + hypervisor evidence log; no ActionIntent→Outcome binding yet |
| Adversarial L5 testing | Partial | 24 attacks executed; 6 need live infra |
| L5 benchmarks | Partial | §G measured; full metric suite not built |
| `cain l5 audit` / `verify` / conformance | Implemented | `scripts/cain42_l5/cain_l5_cli.py`, `bin/cain-l5` |
| Public L5 verification surface | Not implemented | verifier is local; not yet served |
| MCPGate execution enforcement plane | Implemented + wired | `cain/mcp_proxy.py` |
| Agent-to-agent governance | Partial | `cain45/swarm.py`; not wired to L5 gate |
| Governance memory | Partial | `cain45/memory.py` (authority NONE) |
| Self-evaluating governance | Partial | `run_self_verification`; not L5-aware |
| Governance simulation | Implemented | `cain l5 simulate` (in-process) |
| Governance observability | Partial | existing routers; no L5 view |
| Safe self-evolution | Partial | `clawx/control_plane/evolution.py` (no self-grant) |
| L5 threat model | Implemented | `CAIN42_L5_THREAT_MODEL.md` |
| Fail-closed design | Implemented + tested | gate, boundary, registry, auth |
| L5 governance APIs | Partial | CLI + library; HTTP endpoints not added |
| L5 developer SDK | Not implemented | — |
| Framework-agnostic governance | Implemented (model-agnostic) | governs execution authority, not vendor |
| Cross-agent policy consistency | Partial | `cain45/swarm.py` intersection |
| Emergency governance | Partial | hypervisor quarantine; L5 override restrict-only |
| L5 formal invariants | Implemented | I01–I20 |
| L5 chaos engineering | Partial | soak injects faults; live chaos not wired |
| Independent verifier | Implemented (clean-room, local) | `verify_l5_bundle.py` |
| L5 reference architecture | Implemented | `CAIN42_L5_REFERENCE_ARCHITECTURE.md` |
| Repository evolution audit | In progress | `CAIN42_L5_REPOSITORY_AUDIT.md` |
| L5 conformance campaign | Partial | CLI + recorded results; full campaign not run |
| Final readiness gate | This document | — |

## I. Independent Verification (what an external party can reproduce)

From a clean checkout with Python + `cryptography`, with no CAIN runtime trust required:

```bash
python3 scripts/cain42_l5/build_l5_artifacts.py
python3 scripts/cain42_l5/verify_l5_bundle.py CAIN42_L5_EVIDENCE_BUNDLE.json   # -> VALID
python3 -c "from cain45.l5 import check_all; assert check_all()['all_hold']"
python3 scripts/cain42_l5/cain_l5_cli.py simulate --steps 3000
python3 -m pytest tests/test_cain42_l5_constitution.py tests/test_cain42_l5_wiring.py \
                 tests/test_cain42_l5_soak_and_verifier.py -q
```

The clean-room verifier independently recomputes the authority root and verifies the certificate/lease
signatures; a tampered certificate or authority root is rejected (proven by tests). What an external party
**cannot** yet verify independently is the hosted live behaviour and any third-party attestation.

## J. Remaining Evolution (highest-value gaps, in order)

1. **Wire the L5 boundary into the hosted gateway** and supply `cert_lookup`/`trust_lookup`/`quorum_lookup`
   from the live cluster — closes `live_hosted_enforcement`.
2. **Durable, replica-safe nonce/replay + L5 certificate store** (replace in-process sets; back with the
   hypervisor's `used_nonces` and the cluster).
3. **Govern a real LLM agent end-to-end** with caller↔subject auth on the hosted API — closes
   `real_llm_agent` and the self-critique caller gap at the HTTP surface.
4. **Bind ActionIntent → GovernanceDecision → ExecutionReceipt → Outcome → EvidenceRecord** cryptographically
   (Part 17) and serve a public verification surface (Part 21).
5. **Extend Byzantine consensus to L5 governance-critical state** with a documented threat model and quorum
   assumptions (Part 16), only where it buys integrity/availability.
6. **Human governance tiers 0–4**, policy-as-code with version/rule attribution, the L5 SDK, and the HTTP
   governance APIs.
7. **Finish the repository bypass audit** and route every consequential path through the boundary.
8. **Real long-horizon live run** (≥30 days) and the full chaos/conformance campaign.
9. **Independent third-party review**; hardware root of trust; multi-provider diversity.
10. **Three-site publication** of the truthful readiness state (owner-gated).

---

*This report distinguishes what exists, what is evidenced, what is incomplete, and what cannot yet be proven.
The verifier — not this document — decides conformance. `cag-l5-conformance.json` is authoritative and reads
`overall: FAIL`.*
