{
  "schema_version": "security_approval_state_transition_v1",
  "status": "draft",
  "date": "2026-05-13",
  "mode": "approval_state_transition_only",
  "runtime_execution_authorized": false,
  "source_indexes": [
    "docs/security/security-approval-review-packet.snapshot.json",
    "docs/security/security-approval-gate.snapshot.json",
    "docs/security/security-approval-decision-record.snapshot.json",
    "docs/security/security-followup-runtime-gate.snapshot.json",
    "docs/security/security-mirror-status-rollup.snapshot.json",
    "docs/security/security-rollout-policy.snapshot.json"
  ],
  "summary": {
    "total_transition_rules": 5,
    "decision_options_covered": [
      "approve_scope",
      "reject",
      "defer",
      "request_more_evidence",
      "keep_blocked"
    ],
    "runtime_actions_authorized": false,
    "immediate_execution_allowed": false,
    "action_buttons_allowed": false,
    "raw_secret_storage_authorized": false
  },
  "transition_rules": [
    {
      "rule_id": "transition-approve-scope-waiting-runtime-gate",
      "decision": "approve_scope",
      "from_review_states": ["ready_for_human_review"],
      "next_state": "scope_approved_waiting_runtime_gate",
      "allowed_state_updates": [
        "將人工決策寫入 security_approval_decision_record_v1",
        "標示 approved_scope，但 execution_authorized 仍維持 false",
        "依 security_followup_runtime_gate_v1 顯示 follow-up runtime gate required 與前置條件",
        "更新 rollup 的 pending / approved scope 摘要"
      ],
      "allowed_next_artifacts": [
        "follow_up_runtime_gate_draft",
        "design_or_draft_pr",
        "read_only_inventory_request",
        "low_noise_scope_definition",
        "audit_evidence"
      ],
      "still_forbidden": [
        "批准後立即執行 scan、/execute、repo、refs、deploy 或 secret 類動作",
        "顯示高風險 action button",
        "跳過 follow-up runtime gate",
        "保存 raw secret/token/cookie/private key/exploit payload"
      ],
      "followup_runtime_gate_required": true,
      "execution_authorized": false
    },
    {
      "rule_id": "transition-reject-close-no-action",
      "decision": "reject",
      "from_review_states": ["ready_for_human_review"],
      "next_state": "closed_rejected_no_action",
      "allowed_state_updates": [
        "將拒絕原因寫入 security_approval_decision_record_v1",
        "標示該 packet 不再等待批准",
        "保留 evidence refs 與 reviewer",
        "顯示 no runtime action"
      ],
      "allowed_next_artifacts": [
        "audit_evidence",
        "operator_console_note"
      ],
      "still_forbidden": [
        "用 reject 觸發 rollback、cleanup、repo delete 或任何補救動作",
        "刪除原始 evidence refs",
        "自動重開新的執行 gate"
      ],
      "followup_runtime_gate_required": false,
      "execution_authorized": false
    },
    {
      "rule_id": "transition-defer-pending-owner-timing",
      "decision": "defer",
      "from_review_states": ["ready_for_human_review", "block_candidate"],
      "next_state": "deferred_pending_owner_timing",
      "allowed_state_updates": [
        "將延後原因與下一次 review 條件寫入 decision record",
        "保留原 packet 與 gate item",
        "顯示 deferred，不升級為阻擋",
        "必要時要求 owner 補時間窗或責任人"
      ],
      "allowed_next_artifacts": [
        "audit_evidence",
        "deferred_review_note",
        "future_review_candidate"
      ],
      "still_forbidden": [
        "因 defer 自動批准",
        "因 defer 自動執行任何掃描或遷移",
        "把 deferred item 轉成 runtime blocker"
      ],
      "followup_runtime_gate_required": false,
      "execution_authorized": false
    },
    {
      "rule_id": "transition-request-more-evidence-waiting-snapshot-update",
      "decision": "request_more_evidence",
      "from_review_states": ["ready_for_human_review", "block_candidate"],
      "next_state": "evidence_requested_waiting_snapshot_update",
      "allowed_state_updates": [
        "記錄缺少的 evidence 類型",
        "要求 Security Supply Chain Session 產生新的 redacted snapshot",
        "保留原 packet 不執行",
        "新 snapshot commit 後再回到 ready_for_human_review"
      ],
      "allowed_next_artifacts": [
        "redacted_snapshot_request",
        "evidence_gap_note",
        "audit_evidence"
      ],
      "still_forbidden": [
        "要求 raw secret、token、cookie、private key 或 exploit payload",
        "用未補齊 evidence 的 packet 進行批准",
        "猜測缺漏資料後繼續"
      ],
      "followup_runtime_gate_required": false,
      "execution_authorized": false
    },
    {
      "rule_id": "transition-keep-blocked-by-default",
      "decision": "keep_blocked",
      "from_review_states": ["block_candidate"],
      "next_state": "blocked_by_default",
      "allowed_state_updates": [
        "將 keep_blocked 決策寫入 security_approval_decision_record_v1",
        "維持 blocked reason 與 required reviewers",
        "顯示 block candidate 仍未解除",
        "只允許後續補 disable/allowlist/audit gate 設計"
      ],
      "allowed_next_artifacts": [
        "blocked_reason_audit",
        "disable_gate_design_note",
        "allowlist_design_note"
      ],
      "still_forbidden": [
        "啟用 Kali /execute",
        "把 /execute 當成一般 MCP action",
        "執行 shell command 自動修復",
        "保存 command output 中可能含有的敏感資訊"
      ],
      "followup_runtime_gate_required": true,
      "execution_authorized": false
    }
  ],
  "transition_rules_global": [
    "任何人工決策都必須先形成 security_approval_decision_record_v1。",
    "任何 next_state 都不代表 runtime execution authorization。",
    "approve_scope 只允許進入設計、草案、只讀 inventory、低噪音 scope 或人工 exception 的下一個文件階段。",
    "security_followup_runtime_gate_v1 只顯示未來 runtime gate 的 minimum evidence、preflight checks 與 rollback / disable requirement，不啟用 runtime gate。",
    "真正 scan、/execute、repo、refs、deploy、secret、RBAC、NetworkPolicy、firewall 變更仍需獨立 follow-up runtime gate。",
    "LOW / MEDIUM observation 不因狀態轉移而變成 blocking gate。"
  ],
  "forbidden_actions": [
    "execute_transition_rule",
    "auto_approve",
    "execute_after_approve_scope_without_runtime_gate",
    "start_kali_scan",
    "call_kali_execute_endpoint",
    "run_credentialed_scan",
    "create_github_repo",
    "change_repo_visibility",
    "sync_git_refs",
    "switch_github_primary",
    "auto_merge",
    "production_deploy",
    "store_secret_token_cookie_private_key_or_exploit_payload",
    "turn_low_medium_observations_into_blocking_gates"
  ]
}
