# Sovereign Evolution 1 — Security invariants I1–I15 on the real CAIN paths

Scope: the decision paths that can actually let a tool call execute:
(a) **MCPGate proxy**: `cain/mcp_proxy.py` (customer-run HTTP/stdio proxy);
(b) **hosted pipeline**: `cain/continuum/hosted_pipeline.py` (middleware on the gateway's `/mcp` server).
`platform-gateway/cain_proof_carrying_action.py` and `cain/formal/z3_solver_gate.py` have **no production caller**,
so they are covered as libraries only.
`ihvrk/` (session -98) has its own invariant set and Z3 run; this file does not replace it.

Legend for **Status**: IMPLEMENTED_AND_TESTED · IMPLEMENTED_BUT_NOT_FULLY_TESTED · FORMALLY_CHECKED_WITH_STATED_ASSUMPTIONS ·
NOT_IMPLEMENTED · OPEN (confirmed gap, owner decision) · BLOCKED.
"Model" refers to `formal/authorization_model.py` (assumptions A1–A7 are stated there). UNSAT holds only inside that model.

| # | Formal statement (forbidden state must be unreachable) | Enforcement point | Regression test | Model | Status |
|---|---|---|---|---|---|
| I1 | ¬∃ call: EXECUTED ∧ ¬ALLOW | proxy: `process_incoming_request` → `consume_jit_capability` → forward; hosted: `HostedPipelineMiddleware.__call__` | `test_sovereign_e1_mcpgate_capability_boundary.py::test_d10_*`, `test_cain_mcp_proxy_jit.py` | `any_stage_deny_is_executed` UNSAT; `mcpgate_token_forwards_contained_agent` UNSAT (BEFORE: SAT) | IMPLEMENTED_AND_TESTED for these two paths; FORMALLY_CHECKED_WITH_STATED_ASSUMPTIONS |
| I2 | ¬∃ ALLOW with an invalid required signature | `ActionCapabilityToken.verify`, `ProofCarryingAction.verify_signature` | `test_mcp_proxy_capability_forgery.py`, `test_d06_*` | `proof_stage_allows_unpinned_signer` UNSAT | IMPLEMENTED_AND_TESTED |
| I3 | ¬∃ ALLOW from an issuer other than the configured trust anchor | proxy: `_verify_capability_principal` (registered identity key); hosted: pinned signer (now mandatory) | `test_d06_unpinned_stage_refuses_even_a_valid_signature` | UNSAT (needs A2: pinned key not stolen; dropping A2 gives SAT) | IMPLEMENTED_AND_TESTED; library verifiers with optional pins = OPEN (no prod caller) |
| I4 | ¬∃ ALLOW with a missing/revoked/expired mandatory credential | identity `status == active`, token `expires_at`, proof `valid_until` (now mandatory) | `test_d05_unbounded_validity_refused`, `test_identity_trust_decay.py` | `proof_stage_allows_expired_or_unbounded` UNSAT | IMPLEMENTED_AND_TESTED |
| I5 | ¬∃ ALLOW where the bound action digest ≠ digest of the executed call | proxy: `_verify_action_parameter_binding`; hosted: `arguments_digest` (now mandatory) | `test_d03_*`, `test_mcp_proxy_parameter_binding.py` | UNSAT both paths | IMPLEMENTED_AND_TESTED |
| I6 | ¬∃ ALLOW outside the bound tool/resource/principal/tenant | tool/resource equality; agent+tenant mandatory (hosted) | `test_d04_*` | `proof_stage_allows_other_principal` UNSAT | IMPLEMENTED_AND_TESTED, but the hosted caller identity is **self-asserted** (`_cain_agent`), see T-S46-05 |
| I7 | ¬∃ ALLOW under an obsolete mandatory policy version | proxy cache key includes policy fingerprint; hosted proof stage does **not** check `policy_epoch` / `policy_ir_digest` | — | not modelled | NOT_IMPLEMENTED on the hosted proof stage (Evo-2) |
| I8 | ¬∃ ALLOW when the required solver status ∉ {PROVED} | hosted proof stage: `proof.status == "PROVED"`; `z3_solver_gate` maps UNKNOWN/timeout to non-PROVED | `test_unproved_status_refused[UNKNOWN,TIMEOUT,REFUTED,INVALID_PROOF,""]` | `strict_mode_executes_with_unproved_status` UNSAT | IMPLEMENTED_AND_TESTED. PROVED is a **signed claim**: Z3 is not re-run at the boundary |
| I9 | ¬∃ ALLOW on mandatory policy-service failure without an authorised offline policy | stage error → DENY; proxy exceptions → DENIED | existing suites | — | IMPLEMENTED_AND_TESTED for (a)/(b); SDK guard offline fallback now fails closed (-17, 9672bdc1, deployed; installed SDKs need the next wheel) |
| I10 | ¬∃ two ALLOWs for one single-use permit | proxy `_consume_capability_nonce` + JIT `verify_and_consume`; hosted `NonceLedger` (now mandatory, consumed last) | `test_d01_*`, `test_d07_concurrent_use_of_one_proof_allows_exactly_once` (16 threads → 1 ALLOW) | `same_proof_allowed_twice` UNSAT (A3: one shared ledger) | IMPLEMENTED_AND_TESTED **per process**; cross-instance / persistence-failure replay OPEN (T-S46-06) |
| I11 | ¬∃ mandatory approval satisfied by an agent-created claim | baseline `REQUIRE_APPROVAL` | `test_d11_*` (strict xfail) | `mcpgate_token_overrides_operator_allowlist` **SAT** | **OPEN D-S46-11**: an identity grant turns REQUIRE_APPROVAL into ALLOW on the token path |
| I12 | ¬∃ required check skipped because another layer passed | strict mode now requires the proof stage's own ALLOW; token path now checks containment | `test_d08_*`, `test_d10_*` | `strict_mode_executes_without_valid_proof` UNSAT (BEFORE: SAT) | IMPLEMENTED_AND_TESTED (except I11 above) |
| I13 | ¬∃ execution of a call modified after its decision | proxy forwards `downstream_message(msg)` of the evaluated message; digest bound | `test_d03_changed_arguments_refused`, `test_legitimate_token_allowed_once_and_tool_called_once` | `mcpgate_token_executes_with_changed_parameters` UNSAT | IMPLEMENTED_AND_TESTED (application level only; no OS-level TOCTOU guarantee) |
| I14 | ¬∃ conflicting terminal outcomes for one single-use request | nonce claim is atomic under one lock | `test_d07_concurrent_*` | covered by I10 | IMPLEMENTED_BUT_NOT_FULLY_TESTED (no durable terminal-state record per request, T-S17-06) |
| I15 | ¬∃ "release ready" while a mandatory gate fails | `release_gate.json` (this evolution) | — | — | IMPLEMENTED for this evolution's gate only (not wired into CI) |
