# CAIN-42 L5 Threat Model (Part 29)

**Document:** `CAIN42_L5_THREAT_MODEL.md`
**Subject:** The CAIN-42 / CAIN-45 L5 Autonomous Agent Governance Fabric
**Status of this document:** Working threat model, 2026-09-28. This document describes what the repository
actually contains. It upgrades no status because code exists.
**Companion documents:** `CAIN42_L5_REFERENCE_ARCHITECTURE.md` (Part 39), `CAIN45_THREAT_MODEL.md`,
`docs/architecture/CAIN-7-MOATS.md`, `docs/strategy/CAIN42_L5_AUTONOMY_SPEC.md`.

> **SUPERSEDING ADDENDUM (same session, after the Evolution-2 wiring landed).** Parts of the body below were
> written before the wiring and are superseded by this block. `cain45/l5/boundary.py`, `caller_auth.py` and
> `intent.py` are **no longer untested/unwired**: `tests/test_cain42_l5_wiring.py` (11 tests, passing)
> exercises them, and `cain45/hypervisor.py` and `cain/mcp_proxy.py` now consult the L5 boundary
> (restriction-only) and enforce caller↔subject authentication **in the hypervisor library and the MCPGate
> interceptor**. What remains TRUE: the L5 kernel is still **NOT wired into the hosted gateway process**;
> caller-supplied strings are still trusted on the hosted HTTP surface (`/frontier/authorize`); the whole
> stack is still one host/provider; and no real (non-scripted) LLM agent is governed. So the **library** gap
> is closed and tested; the **live hosted** gap is still open. Every "untested/unwired" statement below
> should be read as "not wired into the hosted path".

> **Reading rule.** Every control below carries a status. `LIVE` means the thing runs and was observed.
> `TESTED` means executed against the real code path on this host, with a named test or bundle. `SIMULATED`
> means an in-process model, not production. `NOT_IMPLEMENTED` / `OPEN` means it is not there, and this
> document says so. A green label in one row never upgrades another row.

## Status vocabulary

Taken from `CAIN42_L5_BASELINE.json` (`status_vocabulary`): `LIVE_PRODUCTION_VERIFIED`,
`LIVE_PRODUCTION_OBSERVED`, `VERIFIED`, `TESTED`, `IMPLEMENTED`, `PARTIAL`, `SIMULATED`, `SHADOW`,
`PRE_PRODUCTION`, `UNVERIFIED`, `SUPERSEDED`, `NOT_IMPLEMENTED`.

---

## 1. What is being protected

| Asset | Why it matters |
|---|---|
| Real-world side effects (tool calls, shell processes, network egress, data writes, money movement) | The thing an agent must not do without authority. |
| Authority: capability grants, L5 certificates, autonomy leases, PBFT quorum certificates | If forged, replayed or stale, every downstream decision is wrong. |
| Trust state: dimensions, decay, recovery, trust graph | If writable by an attacker, the next decision is poisoned. |
| Policy: tenant capability ceilings, risk/blast-radius budgets, activation chain | If changed without governance, the bounds disappear. |
| Evidence: hash-chained event log, state roots, signed bundles, claims registry | If rewritable, nothing can be audited or proven. |
| Identity: agent / instance / human / tool / MCP-server identities and keys | Whoever controls a key can sign as that principal. |
| Keys: replica Ed25519 keys, decision-signing key, evidence-root key, controller key, operator credential | Whoever holds them can sign; there is no hardware root (see §7). |

## 2. System under analysis (as built, not as advertised)

CAIN-42 is a trust and control runtime that sits between autonomous agents and consequential actions. Its
canonical definition is recorded verbatim in `CAIN42_TRUTH_REGISTRY.json`:

> "CAIN-42 is a trust and control runtime for autonomous AI systems. It sits between AI agents and
> consequential actions. Agents propose; proposals do not create authority. CAIN-42 evaluates identity,
> policy, trust, risk and authorization before an action can cross the enforcement boundary, and records
> signed evidence of what was decided and what happened."

The doctrine is `AGENT PROPOSES → CAIN DECIDES → MCPGATE ENFORCES → SYSTEM EXECUTES → EVIDENCE REMEMBERS`,
with the hard invariant `NO AUTHORIZATION → NO EXECUTION`.

What is actually live versus library is fixed by the forensic baseline and the truth registry, not by this
document:

- **Hosted path.** `/fabric` runs in `mode=enforce`. Its *blocking* stages are `authorization`, `consensus`,
  `execution`, `identity`, `mcpgate`. Its *recorded-not-blocking* stages are `actionproof`, `approval`,
  `evidence`, `intent`, `policy`, `risk`, `verification` (`CAIN42_TRUTH_REGISTRY.json:hosted_enforcement`,
  source `https://cainstudio.online/fabric/status`). There is **no customer traffic** (`BASE-002`).
- **Consensus.** Two operator-run PBFT clusters, `cain-mr-01` and `cain-mr-02`, each `n=4, f=1, q=3`
  (`CAIN42_FORENSIC_BASELINE.json:clusters`).
- **Agent Hypervisor.** `cain45/hypervisor.py` (802 lines) is a library the operator runs, not a hosted
  service (`BASE-008`, `PRE_PRODUCTION`).
- **L5 kernel.** `cain45/l5/` is a `TESTED` library (`BASE-039`). It is **not wired into the hosted gateway
  or the hypervisor**: no module outside `cain45/l5/` imports it (verified by search across `cain45/`,
  `cain/`, `platform-gateway/`, `scripts/`). Its conformance matrix sets `l5_admitted: false`
  (`CAIN42_L5_CONFORMANCE_MATRIX.json`). **CAIN-42 does not claim to be L5.**
- **MCPGate.** `cain/mcp_proxy.py` (`MCPTransparentInterceptor`, 1037 lines). Tool-call interception is
  `VERIFIED` against a live cluster in an operator-run test (`mcpgate-live-2026-09-27`), not on customer
  calls (`BASE-015`).

**Repository-honesty note (found while writing this document).** The entire `cain45/l5/` package and its
artifacts (`CAIN42_L5_*.json`, `docs/strategy/CAIN42_L5_AUTONOMY_SPEC.md`,
`tests/test_cain42_l5_constitution.py`, `tests/test_cain42_l5_soak_and_verifier.py`) are **untracked in git**
(`git ls-files cain45/l5/` is empty; `git status` shows them as `??`). Additionally, three Evolution-2 L5
modules — `cain45/l5/boundary.py`, `cain45/l5/caller_auth.py`, `cain45/l5/intent.py` (timestamped 06:19–06:20)
— are **newer than the published L5 baseline/evidence bundle** (`generated 2026-09-28T06:16:17Z`), so those
artifacts do not cover them, and **no test in the repository imports any of them** (`CallerAuthenticator`,
`ActionIntent`, `L5Boundary` have zero test references). They are library code with no published evidence
yet. This document treats them as such.

---

## 3. Adversary and fault assumptions, one at a time

Each subsection states (a) the assumption, (b) precisely what CAIN guarantees under it, and (c) precisely
what CAIN does **not** guarantee. "Guarantees" here means *enforced by code on a named path*, not
aspirational text.

### 3.1 Honest nodes

**Assumption.** A replica is *honest* if it follows the PBFT protocol: it signs at most one value per
`(phase, view, sequence)`, never equivocates, verifies certificates before acting, and only commits a value
backed by a valid quorum certificate over the exact operation digest.

**What CAIN guarantees.**
- Quorum intersection: for `N=4, f=1, q=3` any two quorums intersect in ≥2 members, and subtracting any
  Byzantine set of size ≤1 leaves a non-empty honest intersection, so two conflicting values cannot both be
  final. This is exhaustively machine-checked over the documented deployment in
  `scripts/cain42_bft/formal_quorum_model.py` (as a model of the *rules*, not a proof of the
  implementation).
- Certificate acceptance requires ≥ `min_quorum=3` **distinct valid Ed25519 signatures** over exactly that
  certificate body, from the **pinned membership**, with no duplicate signers, no unknown members, no stale
  epoch, no lineage break, and no cross-ZoD reuse (`cain45/authoritative_state.py:verify_authoritative_certificate`,
  lines 239–336).
- A host verifies the quorum certificate itself with `platform-gateway/cain_mr_client.py`; it never takes a
  replica's word (`cain45/consensus.py`, `CAIN45_THREAT_MODEL.md` §2.3, fd429e2).

**What CAIN does NOT guarantee.**
- Honest-node *correctness*: an honest-but-buggy replica is still trusted. The model checker proves a
  property of the rules, not of the Python.
- Honest *deployment diversity*: in the live topology all "honest" nodes run the **same image digest** and
  the **same operator** on **one provider** (`CAIN42_SELF_CRITIQUE.json`), so a single code/provider fault
  can make every honest node fail identically (see §7).
- Liveness if more than `f=1` node is down or partitioned; the cluster is expected to fail closed rather
  than continue (see §3.8).

### 3.2 Byzantine nodes (the `f=1` assumption)

**Assumption.** At most `f=1` of `N=4` replicas is Byzantine (arbitrary, colluding-with-nothing behaviour).

**What CAIN guarantees.**
- With `q=3` and `f=1`, one lying replica cannot force a false `COMMITTED`: `verify_authoritative_certificate`
  rejects an insufficient/forged/duplicated/unknown/stale signer set, and the commitment is bound to the
  exact operation digest.
- Equivocation, forged/stale certificates and view-change abuse are checked by the PBFT engine
  (`scripts/cain42_bft/`, `cain45/authoritative_state.py`; epoch-9 Byzantine results in
  `CAIN42_EPOCH9_BYZANTINE_RESULTS.json` show 4+ named attacks blocked, e.g. unregistered issuer, an
  evidence-mismatched signed envelope, stale evidence, replay).

**What CAIN does NOT guarantee.**
- `f ≥ 2` colluding replicas: with `N=4, f=1` the safety proof stops at one; two colluding nodes can lie
  about what the other two said. No test or proof covers `f ≥ 2`.
- A provider-level or host-level compromise: if the provider or the one host that holds 2 of 4 replicas is
  compromised, the "Byzantine" assumption is silently violated for multiple nodes at once. The forensic
  baseline records `provider_level_byzantine_resilience: false` for both clusters.
- A compromised *operator* key or *signing* key: signature verification is only as strong as key custody,
  and keys are software files (see §7).

### 3.3 Compromised agents

**Assumption.** A governed agent (or the process running it) is fully attacker-controlled and will ignore
the SDK, call tools directly, exfiltrate data, fork, or act after suspension.

**What CAIN guarantees.**
- The Agent Hypervisor confines an agent inside a Zone of Decision: bubblewrap namespaces with **no network
  interface** but loopback, read-only root, `uid 65534`, all capabilities dropped, cgroup v2 limits
  (`memory.max`, `pids.max`, `cpu.max`), a wall clock, and a classic-BPF seccomp filter that refuses escape
  syscalls with `EPERM` (`cain45/confine.py`, tested by `tests/test_cain45_escape.py`, 43 tests, with real
  namespaces/cgroups; live seccomp evidence `e7-seccomp-2026-09-28`, 8/8).
- `suspend` freezes the whole process tree (`cgroup.freeze`); `terminate` uses `cgroup.kill` plus a persisted
  tombstone so double-forked daemons do not resurrect (`cain45/hypervisor.py`, `CAIN45_THREAT_MODEL.md` §3.1).
- Every consequential action is re-authorized on each use; a trust collapse, context substitution or
  trajectory fork mid-run suspends and blocks (`cain45/hypervisor.py:_reauthorize`,
  `tests/test_cain45_escape.py`).
- MCPGate is **default-deny** since 2026-09-27: an unmapped tool is held for approval, never silently
  allowed; the fabric gate can only tighten a legacy `DENY`, never loosen it; a gate error is a `DENY`
  (`cain/mcp_proxy.py`, `platform-gateway/cain_fabric_gate_42.py`).

**What CAIN does NOT guarantee.**
- Against a host-root or kernel-exploit adversary: "the ZoD boundary is only as strong as the host kernel
  and whoever holds root" (`CAIN45_THREAT_MODEL.md` §3.8, `OPEN`).
- Against an agent that is not confined at all: the bypass audit records `raw-process: GAP` for unconfined
  agents (`CAIN45_BYPASS_AUDIT.json`).
- Egress filtering: the network namespace is deny-all, **not** an allowlist; there is no
  `GAP_EGRESS_ALLOWLIST` closure (`CAIN45_THREAT_MODEL.md` §3.1).
- Context-substitution detection runs **only when a context is presented** (`GAP_CONTEXT_OPTIONAL`).
- Seccomp is classic BPF, not eBPF; the loaded filter is **operator-asserted**, not externally attested.

### 3.4 Compromised tools

**Assumption.** A downstream tool or MCP server is malicious: it poisons its own schema (rug-pull), returns
a substituted result, impersonates another server, or lies about having executed.

**What CAIN guarantees.**
- A tool-metadata guard exists for `tools/list` replies, and a tool schema change after authorization trips
  revalidation and invalidates the certificate (`cain/tool_metadata_guard.py`, `cain45/hypervisor.py`,
  `CAIN42_L5_ATTACK_MATRIX.json` "Tool substitution → REVALIDATE").
- Postcondition status is a tri-state `VERIFIED / FAILED / UNKNOWN`; **without a registered domain checker
  the result is reported `UNVERIFIED`, never fabricated positive**. A downstream failure after dispatch is
  recorded as `UNKNOWN`, never assumed absent (`cain/mcp_proxy.py:register_postcondition_checker`,
  `record_downstream_failure`; `test_fake_decision_and_postcondition.py`).
- Cross-ZoD/agent/resource grant transfer is refused; a grant is bound to `zod_id`, `instance_id`, tenant,
  capability and resource (`tests/test_cain45_escape.py`).

**What CAIN does NOT guarantee.**
- Tool poisoning is only **partially** implemented and was **not re-verified** in the latest session —
  recorded `OPEN` (`CAIN45_THREAT_MODEL.md` §3.3).
- **MCP server identity binding / impersonation is `OPEN`** (`CAIN45_THREAT_MODEL.md` §3.3).
- Semantic correctness of a tool's output: an honest-looking but wrong result passes unless a
  postcondition checker is registered for that tool.

### 3.5 Malicious users

**Assumption.** An authenticated or anonymous external caller tries to write trust/recovery state, read
another tenant's evidence, or act as a principal it is not.

**What CAIN guarantees.**
- Tenants are resolved server-side from the API key, and a declared tenant must match; cross-tenant
  evidence reads and writes are gated (`fabric_control_plane.py`, `CAIN45_THREAT_MODEL.md` §3.5, §3.6).
- Anonymous writes to operator/tenant state are refused; a live probe set of 72/72 anonymous boundary
  probes was refused, and `authority_boundary_audit.py --check` fails on any *new* unreviewed anonymous
  write route (`security-boundary-2026-09-27`, `CAIN45_THREAT_MODEL.md` §3.6).
- Path traversal when writing is blocked (session id restricted and path confined).

**What CAIN does NOT guarantee.**
- **Caller-to-subject authentication is `NOT_IMPLEMENTED` on the hosted path.** `/frontier/authorize`
  trusts caller-supplied `agent` / `session` / `tenant` strings; only the capability chain is
  cryptographically bound (`CAIN42_SELF_CRITIQUE.json`, `BASE-013`). An Evolution-2 library
  (`cain45/l5/caller_auth.py`, a signed `CallerAssertion` binding caller→subject) claims to close this
  **but is untracked, unwired, and untested** (see §2 repository-honesty note). **The live gap is open.**
- Operator-privileged misuse: operator actions are gated but not governed (no four-eyes, no consensus);
  recorded `OPEN` (`CAIN45_THREAT_MODEL.md` §3.8).

### 3.6 Malicious delegated agents

**Assumption.** A child agent spawned by a parent is malicious and tries to escalate authority, exceed its
parent's scope, launder authority through an intermediary, or exfiltrate a tiny amount at a time.

**What CAIN guarantees.**
- Authority attenuation is enforced at delegation/spawn time: `CHILD_AUTHORITY ≤ PARENT_AUTHORITY` and
  `CHILD_SCOPE ≤ PARENT_SCOPE`; a child's key, grants and evidence name the instance, so compromise of one
  instance authorizes nothing for another (`cain45/zod.py:child_within_parent`, `cain45/l5/governance.py`,
  `cain45/identity.py`, `tests/test_cain45_escape.py`).
- Quarantining a delegating parent cascades: children keep nothing (`cain45/hypervisor.py:_cascade`,
  evidence `e6-live-lease-2026-09-28`).
- Sub-threshold exfiltration is bounded by cumulative sliding-window aggregation (salami defense) plus spend,
  risk and blast-radius budgets (`platform-gateway/cain_trust_kernel.py:CausalTrajectorySecurityEngine`,
  budgets in `cain45/economics.py` / hypervisor `_charge`).
- Authority escalation, unexpected delegation, trust laundering and identity/resource substitution are
  programmatically detected by the causal authority graph (`CausalAuthorityGraphEngine`, 8 anomaly checks).

**What CAIN does NOT guarantee.**
- Against `f ≥ 2` **colluding** agents coordinating below each individual budget where the aggregate is also
  below the configured window/budget — the salami bound is only as tight as its configured thresholds.
- Against delegation drift across many hops where each hop attenuates correctly but the *composition*
  achieves an unintended effect: CAIN bounds authority, not emergent strategy.
- The L5 delegation checks and the swarm fabric are `TESTED` libraries, **not hosted** (`BASE-022`,
  `BASE-039`).

### 3.7 Compromised credentials

**Assumption.** An attacker holds a valid capability grant, autonomy lease, caller assertion, API key or
signing key.

**What CAIN guarantees.**
- Grants and leases are signed, expiring, non-self-renewing, and bound to subject/scope; expiry and
  revocation are checked on **every** use (`cain45/hypervisor.py:_check_grant`, `cain45/l5/certificate.py`,
  live evidence `e6`/`e7`).
- Single-use action-capability tokens carry a nonce and a replay cache; a consumed nonce is rejected
  (`cain/jit_capability.py:JITCapabilityIssuer`, `platform-gateway/cain_trust_kernel.py:ActionCapabilityToken`).
- Explicit revocation (terminate/quarantine) is fail-closed: an error reading containment state is a
  **revocation**, never a pass (`cain/mcp_proxy.py:check_still_authorized`).

**What CAIN does NOT guarantee.**
- **Key compromise is not recoverable by CAIN.** A stolen signing/operator key can mint valid authority
  until the key is rotated or the principal is revoked; there is no hardware-bound key (see §7).
- **Replay caches are in-memory / process-local.** The L5 baseline records "anti-replay sets are in-memory"
  (`BASE-019`), and `cain/jit_capability.py` states a shared replay store (e.g. Redis) is required for
  multi-process single-use enforcement. A process restart can therefore re-admit a token within its TTL.
- **One operator credential controls cluster and state-changing kernel primitives**; CAIN does not defend
  against the holder of that credential.

### 3.8 Network partition

**Assumption.** The network splits; some replicas cannot reach others or the gateway; messages are delayed,
dropped or reordered.

**What CAIN guarantees.**
- Safety is prioritized over liveness: if a valid quorum certificate cannot be obtained, authority is
  refused. `authorize()` with no authority configured, an unreachable cluster, a non-committing order, or a
  membership that cannot be established all `_deny` (`cain45/hypervisor.py:authorize`).
- Membership is recomputed from the replicas' reported configuration body, recomputed locally, and requires
  ≥ quorum replicas to report exactly that hash; "cannot establish membership" is treated as no authority
  (`cain45/consensus.py:configuration`).
- Quarantine decrements eligible voters; if `N_eligible < Q` the cluster transitions to `DEGRADED_HALT`
  fail-closed, override not allowed (`CAIN42_QUORUM_MODEL.json:adaptation_rules`).

**What CAIN does NOT guarantee.**
- Liveness: a partition that removes ≥2 of 4 replicas stops authorization. This is intended (fail-closed),
  but it means availability is not guaranteed under `f+1` simultaneous faults.
- Byzantine tolerance during an *asymmetric* partition: tests exist
  (`scripts/cain42_bft/cain_mr_asymmetric_partition_test.py`, `multi_region_partition_test.py`) but they run
  on the operator's own clusters on one provider; a partition that isolates a whole provider is not covered.

### 3.9 Replay

**Assumption.** An attacker replays a previously valid authorization, certificate, grant, evidence entry or
policy activation.

**What CAIN guarantees.**
- Authoritative commands carry a monotonic nonce; certificates are bound to `(epoch, view, sequence,
  previous_state_root, command_digest)`; a cross-ZoD or wrong-sequence reuse is rejected
  (`cain45/authoritative_state.py`).
- Capability tokens/JIT tokens carry nonces with a replay cache; the second use of the same nonce is
  rejected (`cain/jit_capability.py`).
- Policy activations are hash-chained per tenant and re-verified on every read; a broken chain is "no policy
  at all" (`cain45/governance.py`).
- Evidence is append-only with a high-water mark; a log that has fallen below the mark (truncated or rolled
  back) fails verification (`cain45/evidence.py:EvidenceLog.verify`, `EvidenceIntegrityError`).

**What CAIN does NOT guarantee.**
- Cross-process single-use: with the in-memory replay store, a restart can re-admit a token inside its TTL
  (§3.7).
- Evidence replay *within* the trust boundary: an independent replay of every published ZoD bundle
  (`e7-replay-2026-09-28`) matched **21 of 22** and reported **1 divergence** (a delegation-parent case
  recorded `RUNNING` where replay expected `QUARANTINED`). That divergence is disclosed, not hidden.
- The earlier governed-memory lab (`CAIN42_MEMORY_POISONING_RESULTS.json`) recorded the
  `deleted_revocation_unpinned_head` family as **0/4 contained, 0/4 detected, 4/4 false authority** — i.e.
  when the head is not pinned, a delete/re-rollback of memory can be replayed and granted false authority.
  `cain45/memory.py:verify_integrity` detects content tampering of sealed items but the file contains **no
  head-pinning or rollback detection**.

### 3.10 Stale state

**Assumption.** The decision is made against old identity, policy, trust, membership, epoch, risk, budget or
context state.

**What CAIN guarantees.**
- Leases have microsecond-to-second TTLs; policy-root, trust, risk, membership and epoch are re-read and
  compared on each action; any change yields `REVALIDATE` or `DENY` (`cain45/hypervisor.py`,
  `cain45/l5/governance.py`).
- Freshness windows and decay make an idle trust state stale by construction
  (`platform-gateway/cain_trust_kernel.py:TemporalTrustEvaluator`, 300 s freshness window, 24 h half-life).
- Clock rollback is a named denial reason (`Reason.CLOCK_ROLLBACK`) and a gate constraint.
- Evidence high-water marks catch a rolled-back log (§3.9).

**What CAIN does NOT guarantee.**
- Epoch/membership invalidation was exercised with an **injected** membership/epoch change, not by re-keying
  the live cluster (`CAIN42_TRUTH_REGISTRY.json:known_limitations`). A real reconfiguration path is not
  proven end-to-end on the live cluster.
- The hosted policy/risk/intent/verification/approval stages **record but do not block**, so stale state in
  those stages is observed, not prevented (`CAIN42_TRUTH_REGISTRY.json:hosted_enforcement`).

### 3.11 Malicious policy

**Assumption.** The policy itself is authored with hostile intent — it silently widens authority, hides an
unknown capability, or is activated without governance.

**What CAIN guarantees.**
- Policy is a governed state machine: `PROPOSED → APPROVED → ACTIVE`, where an **expanding** policy needs a
  signed approval from a registered human **who is not the proposer**, and activation is ordered by the live
  cluster (no quorum certificate, no activation). A restriction-only change needs no human (authority may
  always go down). Unknown fields and unknown capabilities are refused at compile time
  (`cain45/governance.py:validate/diff/PolicyGovernor`).
- Activations are hash-chained per tenant and re-verified on read; the hypervisor reads the active policy
  root only from the certified activation chain and refuses a ZoD whose spec exceeds the ceiling
  (`cain45/hypervisor.py:_policy_problem_for`).
- Live evidence: `e8-governance-2026-09-28` (8 recorded cases, all PASS; human-approved activation committed
  by the live cluster `cain-mr-01` at sequence 16148, `BASE-021`).

**What CAIN does NOT guarantee.**
- A **malicious but well-formed** policy that stays inside the compile checks can still be wrong; CAIN
  enforces the governance *process*, not the policy author's intent.
- In the **hosted path the policy stage records but does not block** (§2); the governed-policy enforcement
  above is the operator-run hypervisor/library path, not customer traffic.
- An operator who controls approval keys and the cluster can approve and activate a hostile policy through
  the correct process. Same-operator verification is a real limit (§7).

### 3.12 Malicious model output

**Assumption.** The LLM/model itself is adversarial or simply wrong: prompt-injected goals, hallucinated
plans, confident-but-incorrect actions, wrapped in plausible text.

**What CAIN guarantees.**
- Model output is **not an authority input**. Intent text and plans are refused as authority; `SIMULATED`,
  `PREDICTION`, `COUNTERFACTUAL`, `AGENT_VOTE`, `MEMORY`, `WORLD_MODEL` and `NONE` are refused as certified
  decisions (`cain45/l5/governance.py:_NON_AUTHORITY_KINDS`, invariants I16–I18). The attack matrix records
  "Prompt injection" and "Goal hijacking" as `ALLOW` **precisely because intent is not an authority input**
  (`CAIN42_L5_ATTACK_MATRIX.json`).
- A model change trips revalidation (`MODEL_CHANGED`) and invalidates the certificate
  (`model_change_control`).
- Capability ≠ authority: a model that *knows* an action does not thereby get to do it.

**What CAIN does NOT guarantee.**
- **CAIN governs authority, not semantic correctness.** A coherent malicious plan can execute if it fits
  inside authorized scope, budget, risk and blast-radius limits; CAIN will not know it is a bad idea.
- There is **no content-level prompt-injection firewall** on the hosted path; prompt injection is neutralized
  as an *authority* input, not as an *influence* on what the agent requests.
- No live LLM agent is governed yet: the conformance matrix records "Real LLM agent governed (not scripted)"
  as a mandatory **FAIL** (`CAIN42_L5_CONFORMANCE_MATRIX.json`).

### 3.13 Poisoned memory

**Assumption.** An attacker writes, deletes, re-rolls or indirectly injects into the agent's memory so that a
future decision is based on a poisoned past.

**What CAIN guarantees.**
- Governed memory carries a class (`OBSERVED`/`VERIFIED`/`DERIVED`/`UNVERIFIED`/`COUNTERFACTUAL`), a sealed
  integrity hash, and a memory-integrity check; a memory-integrity failure yields `REVALIDATE`
  (`cain45/memory.py:verify_integrity`, `cain45/l5/governance.py:memory_change_control`, invariant I12).
- Memory is explicitly **not authority**: `CAIN42_SELF_CRITIQUE.json` records
  `memory_grants_authority: false`, and `MEMORY` is in `_NON_AUTHORITY_KINDS`.
- The memory-poisoning lab recorded most families fully contained: e.g. `cross_agent_memory` 20/20 detected
  and contained, `fake_historical_event` 4/4, `forged_approval` 4/4, `hidden_memory_injection` 84/84.

**What CAIN does NOT guarantee.**
- The same lab recorded `deleted_revocation_unpinned_head` as **0/4 contained and 4/4 false authority** when
  the head is not pinned (§3.9). `cain45/memory.py` has **no head-pinning / rollback detection** in its
  `verify_integrity`; it only checks that a sealed item's content still hashes.
- Governed memory is a `TESTED` library and is **not a vector store and not wired into the hosted path**
  (`BASE-023`); indirect prompt injection through a retrieval layer is not addressed by this library.
- No defense is demonstrated against an attacker who controls the *writer* of memory and produces a
  self-consistent (correctly sealed) false item.

### 3.14 Poisoned context

**Assumption.** The security/environment context an action presents is substituted, forged, replayed or
omitted so that the decision is made under a false context.

**What CAIN guarantees.**
- The context is canonicalized and hashed into the authorization certificate (`context_hash`) and into the
  ZoD's re-authorization check; presenting a different context is detected and suspends the run
  (`cain45/hypervisor.py:_reauthorize`, `_certificate_body`; evidence
  `e6-live-lease-2026-09-28` "security context changes").
- Context substitution across instances/tenants is caught by identity/resource substitution checks
  (`CausalAuthorityGraphEngine`).

**What CAIN does NOT guarantee.**
- The context check runs **only when a context is presented** (`GAP_CONTEXT_OPTIONAL`,
  `CAIN45_THREAT_MODEL.md` §3.2). An action that presents no context is not held to a context.
- Runtime attestation is a **declared hash**, not a hardware measurement
  (`mcpgate-live-2026-09-27/manifest.json:not_claimed`: "the context's attestation field is a declared
  hash"), so a compromised runtime can declare the right context.

---

## 4. Quorum assumptions (`n=4, f=1, q=3`) and where consensus is (and is not) used

**Parameters** (`CAIN42_QUORUM_MODEL.json`, `CAIN42_TRUTH_REGISTRY.json:clusters`):

| Parameter | Value |
|---|---|
| Cluster size `n` | 4 |
| Byzantine faults tolerated `f` | 1 |
| Quorum `q` | 3 (`q = 2f+1`) |
| Fault-tolerance bound | `n ≥ 3f+1` |
| Intersection invariant | any two quorums share ≥ `f+1` = 2 members |
| Live clusters | `cain-mr-01`, `cain-mr-02` (both `n=4, f=1, q=3`) |

**Where consensus IS used (ordering + quorum certificate verification):**

| Use | Path | Certificate requirement | Status |
|---|---|---|---|
| ZoD authorization | `cain45/hypervisor.py:authorize` → `authority.order_zod` | ≥3 distinct pinned Ed25519 sigs over the exact operation digest | `TESTED` (library) with fake authority; live QC path `VERIFIED` |
| Policy activation | `cain45/governance.py` → `order_policy`; hypervisor refuses without it | same client/verifier as ZoD ordering | `VERIFIED` (e8, live cluster) |
| Hosted fabric decision | `cain45/consensus.py:verify_decision`; `verify_hosted_decision.py` | recomputes the pre-verdict; commit QC verified | `VERIFIED` |
| PBFT engine checks | `scripts/cain42_bft/`, `cain45/authoritative_state.py` | quorum, epoch, view, lineage, duplicate/unknown signer rejection | `VERIFIED`, operator-run |
| MCPGate consensus gate | operator-run test against a live cluster (`mcpgate-live-2026-09-27`) | live QC verified | `VERIFIED` for the test; **not customer calls** |

**Where consensus is NOT used:**

- **The L5 execution gate itself.** `L5ExecutionGate.evaluate` takes a boolean `quorum` + a
  `quorum_certificate` string as *inputs* (`cain45/l5/governance.py`); it does not itself contact a cluster.
  The L5 kernel is `TESTED` and **not wired to the hosted path**; its bundle's signing key is explicitly
  **ephemeral** (`CAIN42_L5_EVIDENCE_BUNDLE.json:warning`).
- **Local trust scoring and decay** (`cain_trust_kernel.py`) — deterministic computation, no consensus.
- **Evidence append** (`cain45/evidence.py`) — hash chain + local signature, no consensus.
- **The kill-switch / quarantine fabric** (`cain/quarantine.py`) — SQLite WAL cross-process state, not
  consensus.
- **Per-action authorization on customer tool calls** — no customer traffic exists; the hosted
  policy/risk/intent/verification/approval stages record but do not block.
- **The L5 Evolution-2 boundary/caller-auth/intent adapters** — library code, no consensus, no tests, no
  wiring (§2).

> **Hard rule.** `NEVER ALLOW HIGH TRUST TO SUBSTITUTE FOR A VALID QUORUM. NO VALID QUORUM → NO CONSENSUS
> DECISION.` (`CAIN42_QUORUM_MODEL.json:doctrine`). A high trust score can never replace a valid quorum
> certificate on the paths that check for one.

---

## 5. Trust boundaries

1. **Agent process ↔ host.** The boundary CAIN-42 did not have; CAIN-45 E1 moves the agent into a ZoD
   (network namespace with no interfaces, read-only root, cgroup limits, one channel out = the broker).
2. **Broker ↔ MCPGate ↔ tool.** The broker checks ZoD state and capability; MCPGate evaluates the tool call;
   only then is the tool reached.
3. **ZoD authority ↔ PBFT cluster.** A ZoD certificate is valid only with a commit QC from ≥3 of the 4 pinned
   members, verified by the host itself, never on a replica's word.
4. **Public internet ↔ gateway.** Anonymous callers may only compute, verify or use isolated demo twins.
5. **Tenant ↔ tenant.** Tenant resolved server-side from the API key; declared tenant must match.
6. **Operator ↔ system.** The operator credential opens cluster control and state-changing primitives. The
   operator is trusted, and that trust is itself a threat (§7).

---

## 6. Known structural limits

### 6.1 Single failure domain

- **Historic (self-critique, measured):** all 4 cluster-node containers, the gateway, the reverse proxy and
  the sites ran on **one host** (`45.76.60.231`) — "one failure domain, so the 'N=4, f=1 Byzantine' topology
  gives no protection against host/network/provider loss or compromise" (`CAIN42_SELF_CRITIQUE.json`).
- **Current (forensic baseline):** `cain-mr-01` has 4 replicas on 3 independent hosts with **2 of 4
  co-located on one Los Angeles host** (`vultr-lax-1`); `cain-mr-02` has 4 replicas on 4 hosts. Both are on
  **one provider (Vultr)** and both run **one image digest each**, so there is **zero implementation
  diversity** across validators (`CAIN42_SELF_CRITIQUE.json`; `CAIN42_FORENSIC_BASELINE.json` records
  `independent_providers: 1`, `provider_level_byzantine_resilience: false`).
- Consequence: `n=4, f=1, q=3` protects against **one replica** diverging, but **not** against one host, one
  provider, one image, or one operator failing/being compromised. The quorum count is not a
  provider-diversity guarantee.

### 6.2 No hardware root of trust

- `BASE-035` = `NOT_IMPLEMENTED`: no TPM, no Intel SGX/TDX, no AMD SEV-SNP. The Vultr VC2 hosts make them
  unavailable ("hardware-blocked; attestation stays software measurement only", `CAIN45_THREAT_MODEL.md`
  §3.8).
- Runtime/attestation values are **declared hashes**, not hardware measurements
  (`mcpgate-live-2026-09-27/manifest.json:not_claimed`).
- Consequence: a compromised host or runtime can present a correct-looking attestation; CAIN cannot prove
  the code it is running is the code it published.

### 6.3 Same-operator verification

- Every published artifact is generated **and verified by the same operator's tooling**. Clean-room
  verifiers (`scripts/cain42_bft/clean_room_verifier.py`, `independent_verifier_2.py`,
  `scripts/cain42_l5/verify_l5_bundle.py`) remove *CAIN imports* from the verifier, but they are still run by
  the operator. `CAIN42_SELF_CRITIQUE.json` records the provenance manifest as signed by a **local** key:
  "self-attested".
- `BASE-037` = `NOT_IMPLEMENTED` (`C42-THIRD-PARTY-REVIEW`): **no independent third party has reproduced
  anything.**
- The L5 conformance matrix lists "Independent third-party verification" among the mandatory failures
  (`CAIN42_L5_CONFORMANCE_MATRIX.json`).
- Consequence: "independently verified" in any CAIN artifact means *independently re-computable by the same
  operator*, not third-party reviewed. This document uses "clean-room local" for that.

---

## 7. What is NOT guaranteed

This is the consolidated, explicit list. None of the following is claimed anywhere in this document.

1. **No production L5 governance.** `cain45/l5/` is a `TESTED` library, not wired to the gateway or the
   hypervisor; `l5_admitted: false`; CAIN-42 does not claim to be L5.
2. **No third-party review or certification.** All verification is same-operator; `C42-THIRD-PARTY-REVIEW`
   is `NOT_IMPLEMENTED`.
3. **No provider-level or host-level fault tolerance.** One provider (Vultr); `cain-mr-01` co-locates 2 of 4
   replicas; historic deployment was one host. `provider_level_byzantine_resilience: false`.
4. **No implementation diversity.** All validators run one image digest; identical code fails identically.
5. **No hardware root of trust.** No TPM/TEE/SGX/TDX/SEV; attestation is a declared hash.
6. **No caller-to-subject authentication on the hosted path.** Caller-supplied agent/session/tenant strings
   are trusted (`BASE-013`). The untracked, unwired, untested `caller_auth.py` does not change the live
   posture.
7. **No defense against `f ≥ 2` Byzantine replicas or a compromised operator key.**
8. **No defense against host root / kernel exploit** inside a ZoD.
9. **No prompt-injection content firewall.** CAIN neutralizes injection as an authority input, not as an
   influence on what the agent requests.
10. **No semantic correctness.** CAIN bounds authority; it cannot tell a coherent bad action from a good one.
11. **No live LLM agent governed** ("Real LLM agent governed (not scripted)" is a mandatory FAIL).
12. **No long-horizon live test.** Long-horizon autonomy is `SIMULATED` (`BASE-034`, 1000 scripted sessions in
    seconds).
13. **No multi-process single-use guarantee.** Anti-replay/JIT caches are in-memory; a restart can re-admit a
    token within TTL.
14. **No head-pinned memory rollback defense.** `cain45/memory.py` has no head pinning; an unpinned-head
    delete/rollback family was 0% contained in the lab.
15. **No guarantee of availability under ≥2 simultaneous replica faults** (fail-closed is the intended
    behavior, but availability is not promised).
16. **No live epoch re-keying proof.** Epoch/membership invalidation was tested with an **injected** change.
17. **No reliable hosted blocking for policy/risk/intent/verification/approval** — those stages record but do
    not block.
18. **No MCP-server identity binding / tool-poisoning closure.** Server impersonation is `OPEN`; the
    tool-metadata guard is partially implemented and not re-verified.
19. **No certainty that evidence replay is exact.** 21/22 matched; 1 divergence is disclosed.
20. **No published signed claims for the L5 Evolution-2 modules.** `boundary.py`, `caller_auth.py`,
    `intent.py` have no tests and are not covered by the 06:16 evidence bundle.

---

## 8. Evidence index (real paths)

| Claim area | Evidence |
|---|---|
| Hosted enforcement mode and stages | `CAIN42_TRUTH_REGISTRY.json` (`hosted_enforcement`) |
| L5 capability/status inventory (48 items) | `CAIN42_L5_BASELINE.json` |
| L5 conformance (l5_admitted=false, 8 mandatory failures) | `CAIN42_L5_CONFORMANCE_MATRIX.json` |
| L5 acceptance gate (21 PASS / 3 partial) | `CAIN42_L5_ACCEPTANCE_GATE.json` |
| L5 attack matrix (30 attacks, 24 PASS, 6 NOT_TESTED) | `CAIN42_L5_ATTACK_MATRIX.json` |
| L5 executable invariants I01–I20 | `cain45/l5/invariants.py`; `CAIN42_L5_EVIDENCE_BUNDLE.json` |
| Live authority-lease lapses | `clawx-site/evidence/e6-live-lease-2026-09-28/` (9/9 PASS), `e7-lease-2026-09-28/` (8/8 PASS) |
| Governed policy activation | `clawx-site/evidence/e8-governance-2026-09-28/` |
| Confined execution / seccomp | `clawx-site/evidence/cain45-zod-live-2026-09-27/`, `e7-seccomp-2026-09-28/` |
| MCPGate boundary | `clawx-site/evidence/mcpgate-live-2026-09-27/` |
| Evidence replay (21/22, 1 divergence) | `clawx-site/evidence/e7-replay-2026-09-28/` |
| Cluster topology / failure domains | `CAIN42_FORENSIC_BASELINE.json` (`clusters`), `CAIN42_SELF_CRITIQUE.json` |
| Quorum model | `CAIN42_QUORUM_MODEL.json`, `scripts/cain42_bft/formal_quorum_model.py` |
| Quorum certificate verification | `cain45/authoritative_state.py:verify_authoritative_certificate` |
| Memory poisoning results | `CAIN42_MEMORY_POISONING_RESULTS.json` |
| Byzantine epoch results | `CAIN42_EPOCH9_BYZANTINE_RESULTS.json` |
| L5 test suite (54 collected) | `tests/test_cain42_l5_constitution.py`, `tests/test_cain42_l5_soak_and_verifier.py` |
| Agent escape suite (43 tests) | `tests/test_cain45_escape.py` |
