{
  "spec_id": "cain-38.0-delegation-spec",
  "generated_at": "2026-09-18T00:43:00Z",
  "note": "Token field schema is in CAIN_38_CAPABILITY_SPEC.json -- this file covers delegation CHAIN semantics specifically.",
  "authority_child_le_authority_parent": {
    "enforced_by": "cain_intent_action_fabric.DelegationSecurityValidator.validate_delegation() -- action-scope bounding (check 5), resource bounding (check 6), and (as of this session) spend-cap bounding (check 7, NEW)",
    "tested_by": "cain_invariants.TrustInvariantsRegistry.verify_child_authority_cannot_exceed_delegated() -- extended this session to cover BOTH action-scope amplification and spend-cap amplification (previously only the former)",
    "wired_live_at": ["cain_intent_action_fabric.py:~1094 (Canonical16StageTrustPipeline)", "cain_canonical_pipeline.py:~566 (equivalent 15-stage pipeline)"]
  },
  "single_hop_only_this_session": "Every delegation test this session (unit tests, invariant, economic simulation) exercises current_depth=1, single parent->child. Multi-hop chains (HUMAN -> PRIMARY AGENT -> SPECIALIST AGENT -> TOOL AGENT from the mission's Phase 6 example) are NOT exercised this session -- max_depth/current_depth fields exist and are checked for the depth-exceeded case (test_delegation_security.py, pre-existing), but no live multi-hop economic scenario was run.",
  "attacks_tested": {
    "privilege_amplification (action outside granted_actions)": "PASS (pre-existing)",
    "spend_cap_amplification (amount over max_spend_cents)": "REAL BUG FOUND, FIXED THIS SESSION",
    "cross_tenant_delegation": "PASS (pre-existing)",
    "expired_delegation": "PASS (pre-existing)",
    "circular_delegation (parent==child)": "PASS (pre-existing, not independently re-tested this session beyond reading the code)",
    "delegation_forgery (a token not actually issued by the claimed parent)": "NOT TESTABLE against this token class as a PASS/FAIL security test -- confirmed by grep across cain_intent_action_fabric.py and cain_canonical_pipeline.py that CryptographicDelegationToken.compute_hash()/token_hash is never called or checked by validate_delegation() or either pipeline, and parent_signature is never populated by any call site in this repo. In its current wiring, ANY caller can construct a CryptographicDelegationToken object in-process with arbitrary field values and it will validate identically to one legitimately issued by an authorized parent -- the class name 'Cryptographic' currently describes only its hash METHOD existing, not any hash or signature actually being enforced on the validation path. This is a real, unresolved gap, not a passed test. NOT FIXED this session (would require establishing where/how tokens cross a trust boundary -- e.g. serialized and sent over HTTP -- which no call site in this repo currently does; today it is always an in-process object).",
    "delegation_replay": "NOT TESTED -- no nonce/single-use marker on this token class"
  }
}
