# CAIN-42 AGENT IDENTITY & AUTHORITY CONFORMANCE REPORT

**Prompt 2 of 42 — Autonomous Agent Identity & Dynamic Authority Fabric.**
Generated 2026-09-28. Every number is derived from the repository, a test run, a clean-room verifier run, or a
measured benchmark performed for this report. Statuses use only **PASS / FAIL / INCOMPLETE / NOT VERIFIED**.

> **No L5 claim is made.** This report and `cag-l5-conformance.json` (`overall: FAIL`) are the authoritative
> result. A green label in one row never upgrades another. No result is manufactured.

Reproduce:
```bash
python3 -m pytest tests/test_cain42_l5_constitution.py tests/test_cain42_l5_wiring.py \
  tests/test_cain42_l5_identity_authority.py tests/test_cain42_l5_gateway_wiring.py \
  tests/test_cain42_l5_soak_and_verifier.py -q                       # 90 passed
python3 scripts/cain42_l5/build_authority_bundle.py
python3 scripts/cain42_l5/verify_authority_bundle.py CAIN42_L5_AUTHORITY_BUNDLE.json   # VALID 22/22
python3 scripts/cain42_l5/verify_l5_bundle.py CAIN42_L5_EVIDENCE_BUNDLE.json           # VALID 10/10
python3 scripts/cain42_l5/l5_soak.py --steps 3000                                      # 0 violations
```

---

## IDENTITY

| Item | Status | Evidence |
|---|---|---|
| Identity architecture | **PASS** | `cain45/l5/agent_identity.py`: canonical signed `AgentIdentity`, versioned, hash + signature over a fixed field set |
| Cryptographic algorithms | **PASS** | Ed25519, domain-separated (`CAIN42/L5-AGENT-IDENTITY/v1`), canonical JSON via `cain45.canon` |
| Key lifecycle | **PASS** | CREATE / ROTATE / REVOKE / REISSUE / VERIFY; rotation immediately invalidates the old key (`KEY_NOT_CURRENT`), proven by tests |
| Attestation status | **PASS (software)** / **NOT VERIFIED (hardware)** | signed `IdentityStatement` (identity+runtime+capabilities+policy+timestamp+nonce) verified against the registry, not the agent's claim. No TPM/SEV/TDX — hardware attestation is `NOT_IMPLEMENTED` |
| Identity ≠ authority | **PASS** | INV-1: a valid identity with no grant returns DENY |

## AUTHORITY

| Item | Status | Evidence |
|---|---|---|
| Authority model | **PASS** | `AuthorityGrant`: scoped, time-bounded, policy-bound, revocable, auditable, signed |
| Capability model | **PASS** | 13 explicit capabilities (`Capability`), not boolean ALLOW/DENY |
| Scope model | **PASS** | resource + operation + capability; pattern subsumption; cross-tenant resource refused (`DENY_RESOURCE_SCOPE`) |
| Temporal model | **PASS** | `time_start`/`time_expiry`/`max_duration`/`renewal_policy`; expired and future grants denied |
| Budget model | **PASS** | per-dimension budget; exhaustion → DENY, or ESCALATE under `ESCALATE_ON_BUDGET` |
| Trust floor | **PASS** | trust below `trust_floor` → `DENY_TRUST_BELOW_FLOOR` (no manual refresh needed) |
| Context binding | **PASS** | environment constraints; `development` grant does not authorize `production` |
| Dynamic authority (MIN/INTERSECT) | **PASS** | deterministic intersection; INV-2: authority never exceeds the narrowest constraint |
| Explainability | **PASS** | machine-readable `ReasonCode`s + `explain()` with effective authority, policy, trust, delegation, action hash |
| Cryptographic binding to the action | **PASS** | decision binds action/parameters/resource/context/policy hashes; changing `action_hash` changes the decision digest |
| Single-use authorization | **PASS** | nonce consumed on ALLOW; reuse → `DENY_REPLAY` (a bug found by the suite and fixed) |
| Authority status states | **PASS** | `AuthorityStatus` ACTIVE/LIMITED/SUSPENDED/EXPIRED/REVOKED/QUARANTINED/PENDING_REVIEW |

## DELEGATION

| Item | Status | Evidence |
|---|---|---|
| Delegation model | **PASS** | `DelegationGrant` signed; parent/child linkage |
| Anti-escalation | **PASS** | capabilities/resources/time cannot expand; INV-3; a real escalation hole (delegation narrowing not applied to evaluation) was found and fixed |
| Maximum depth | **PASS** | `maximum_depth` from the parent's `delegation_limit`; depth violation → `DENY_DELEGATION_DEPTH` |
| Delegation budget | **PASS** | a parent cannot manufacture authority by spawning unlimited children (`delegation_limited`) |
| Revocation behavior | **PASS** | revocation registry + cascade to child delegations; revocation does not mutate the signed grant (a bug found and fixed) |

## ENFORCEMENT

| Item | Status | Evidence |
|---|---|---|
| CAIN enforcement points | **INCOMPLETE** | library-level: `AgentHypervisor._gate`, `L5Boundary`, `AuthorityEngine`. Not the hosted default path |
| MCPGate enforcement points | **PASS (opt-in)** | `cain/mcp_proxy.py` consults the L5 boundary restriction-only; `/fabric/mcp/enforce` gated by `CAIN_L5_GATEWAY=1` |
| Hosted gateway integration | **PASS (opt-in)** | `platform-gateway/cain_l5_gateway.py` + `/l5/*` API; fails closed when enabled without credentials |
| Caller↔subject authentication | **PASS** | signed `CallerAssertion` enforced on `authorize` and the MCPGate interceptor; spoofed/expired/replayed/revoked refused |
| Discovered bypasses | **FAIL (documented)** | `CAIN42_L5_REPOSITORY_AUDIT.md`: **57 ungoverned** consequential paths (23 governed, 4 partial); `cain/guard.py` falls back to local evaluation; `cain/mcp_proxy.py:297` swallows trajectory-gate exceptions; `cain_frontier/gate.py` defaults to shadow; self-signed A2A passports accepted; ungoverned products (talos-coder shell daemon, swarm-orchestrator k8s, docker controllers). Not remediated in this evolution |

## SECURITY

| Item | Status | Evidence |
|---|---|---|
| Attack tests | **PASS** | identity attack suite + authority attack suite (`tests/test_cain42_l5_identity_authority.py`, 20 tests) covering forged/altered/replayed/expired/revoked identity, key substitution, privilege escalation, scope expansion, delegation laundering, confused deputy, token replay, cross-tenant, budget bypass, temporal bypass, trust-floor bypass, policy downgrade, self-authorization |
| Invariant tests | **PASS** | 10 identity/authority invariants + 20 L5 safety invariants all hold (`check_all`, `check_authority_invariants`) |
| Replay tests | **PASS** | single-use nonce replay and caller-assertion replay both denied |
| Revocation tests | **PASS** | revoked grant/agent denied (CONTAIN/DENY); cascade to delegates |
| Byzantine tests | **INCOMPLETE** | existing PBFT suites pass, but the L5 identity/authority state is **not** consensus-replicated; a dedicated Byzantine test of governance state is not built |

## PERFORMANCE

| Metric | Value | Status |
|---|---|---|
| Identity verification latency | measured in test suite (sub-millisecond); not formally benchmarked with p50/p95/p99 | **INCOMPLETE** |
| Authority evaluation latency | ~tens of µs (gate path); full p50/p95/p99 not collected | **INCOMPLETE** |
| L5 execution gate | **53.6 µs/op ALLOW**, **45.3 µs/op DENY** (20,000 evals each, this host) | **PASS (measured)** |
| Delegation validation latency | not separately benchmarked | **NOT VERIFIED** |
| Revocation propagation latency | not measured across processes/nodes | **NOT VERIFIED** |
| Authorization latency p50/p95/p99 | not collected | **NOT VERIFIED** |
| Quorum latency | owned by the live PBFT bundles (e6/e7), not re-measured here | **NOT VERIFIED** |
| Throughput | gate ~18.6k ops/s ALLOW (single-process) | **PASS (measured, single process)** |

## EVIDENCE

| Item | Status | Evidence |
|---|---|---|
| Evidence coverage | **PARTIAL** | identity/authority objects are signed and self-describing; the full ActionIntent → Decision → ExecutionReceipt → Outcome → EvidenceRecord chain is not yet cryptographically bound end-to-end |
| Signature verification | **PASS** | every object signed and independently verified |
| Independent verifier (identity/authority) | **PASS (local)** | `scripts/cain42_l5/verify_authority_bundle.py` — no CAIN imports, **VALID 22/22**; tampered bundle → INVALID |
| Independent verifier (L5 gate bundle) | **PASS (local)** | `scripts/cain42_l5/verify_l5_bundle.py` — **VALID 10/10** |
| Third-party verification | **FAIL** | no external party has reproduced any of this (`C42-THIRD-PARTY-REVIEW` NOT_IMPLEMENTED) |
| Site changelogs | **PASS** | the runtime evidence is published on all three sites' changelogs (`platform-gateway/frontend/changelog.html` → cainstudio/mcpgate, `clawx-site/changelog.html` → clawx, plus `CHANGELOG.md` and `platform-gateway/docs/changelog.md`) |

## STATUS

| Area | Status |
|---|---|
| Identity | **PASS** (software), hardware attestation **NOT VERIFIED** |
| Authority | **PASS** |
| Delegation | **PASS** |
| Enforcement | **INCOMPLETE** — library + opt-in hosted path; 57 ungoverned paths remain |
| Security | **PASS** (identity/authority attacks + invariants), Byzantine governance **INCOMPLETE** |
| Performance | **INCOMPLETE** — gate measured; full latency profile NOT VERIFIED |
| Evidence | **PASS** (local independent verifiers), third-party **FAIL** |
| **Overall** | **INCOMPLETE — not CAG-L5 compliant.** Foundational identity + dynamic authority substrate is implemented, wired restriction-only, and independently verifiable; it is not the hosted default path, no real LLM agent is governed, no Byzantine protection covers the new governance state, and there is no third-party verification. |

## Highest-value next steps

1. Make the L5 boundary + caller auth the **hosted default** and route the 57 ungoverned paths through it.
2. **Durable, replica-safe** nonce/revocation/identity state (currently in-process).
3. Extend **Byzantine consensus** to identity/authority issuance and revocation (documented threat model + quorum assumptions only where it buys integrity).
4. **Full cryptographic binding** ActionIntent → Decision → Execution → Outcome → Evidence.
5. **Latency profiling** (p50/p95/p99) and cross-process revocation propagation.
6. Govern a **real LLM agent** end-to-end; then pursue **third-party** verification.
