Skip to content

実装: publish laneのauthorization code(policy/adapter)の信頼境界をhash pinningでcandidate worktree外に確立する #1450

Closed as not planned

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1408"
goal_ref: "PR #1442(Issue #1408の実装)への人間の敵対的セキュリティレビュー(https://github.com/squne121/loop-protocol/pull/1442#issuecomment-4941989903)で指摘されたP1 Blocker「authorization code自体が、認可対象の作業worktreeから読み込まれる(自己署名型authorization)」を解消する。Issue #1454(Phase A: external trust root)はPR #1457としてmerge済み(commit ce8e417b)。しかしIssue #1450自身への直近の敵対的レビュー(https://github.com/squne121/loop-protocol/issues/1450#issuecomment-4945979261)により、旧AC(candidate側adapterがtrusted launcherへevidenceを委譲する設計、`.codex/hooks.json`の二重entrypoint化、publisher実行のGit config逃脱耐性欠如)では信頼境界が成立しないと判定され、本Issueは『managed hookを唯一のentrypointとし、candidate codeをevidence発行・publish実行から除外する』契約へ全面的に再スコープする。nonce runtime state分離・trusted publisher wrapper・atomic rotation・worktree cwd解決・deployment attestationはIssue #1468へ切り出す"
change_kind: code

Parent Issue

#1408

Parent Goal Ref

Current Validated Scope

  • Issue 実装: publish lane authorization codeの信頼起点となるexternal trust root(trusted hook launcher・manifest・bootstrap/rotation手順)を確立する #1454(Phase A)はPR #1457としてmerge済みで、scripts/trust-root/配下にtrusted_hook_launcher.py・manifest_schema.py・install_trust_root.shが存在する
  • Codex PreToolUse hookはproject-local .codex/hooks.jsonとsystem-managed hookの両方を実行しうる構成であり、単純に.codex/hooks.jsonをtrusted launcherへ向けるだけでは、managed launcherとproject-local launcherの二重起動(同一evidence/nonceへの競合)が発生することが敵対的レビューで指摘された
  • session-recording compositeは同じcheckout内のscripts/session-recording/codex-hook-adapter.mjsを直接importし、codex-hook-adapter.mjsはscripts/agent-guards/git_mutation_command_policy.pyを実行する構成であり、この2ファイルはcandidate側で改変可能である
  • Issue #1450への直近の敵対的レビュー(OWNER, https://github.com/squne121/loop-protocol/issues/1450#issuecomment-4945979261)により、旧設計(candidate adapterがcommand payload・component実体をtrusted launcherへ「委譲」し、launcherがそれをtrusted evidenceとして扱う)は、candidate側が攻撃者管理下という前提と矛盾し信頼モデルとして成立しないと判定された
  • 同レビューにより、publish実行コマンド文字列(updatedInput)が通常shell環境で実行される限り、remote.origin.pushurl/url.*.pushInsteadOf/core.hooksPathによるGit config経由の迂回が可能であることも指摘された。この修正(trusted publisher wrapperの実装)はIssue #1468へ切り出した
  • nonce runtime stateの権限モデル不整合、installerのrelease rotation非atomic性、launcherのcwd/git-dir解決がnested/linked worktreeに対応していない点も同レビューで指摘され、Issue #1468の対象とした

Remaining Parent Gaps

  • Codex hooks.managed_dirへの実移行(admin-enforced領域へのhook配置)は本Issueでも扱わない。将来のfollow-upとする
  • privileged operatorによる実機へのtrust root install実行・deployment attestationの生成はIssue #1468の範囲であり、本Issueでは扱わない(本Issueは#1468のmerge済み成果物とdeployment attestationが存在する前提で着手する)
  • PR #1442のレビューで指摘された他のP1 Blocker(fetch_then_show_refとgithub_branch_apiの証跡真正性、新規branch初回publishのatomic create lane)は本Issueでは扱わない
  • privileged broker(trusted evidence issuer)自体の新規実装が必要と判明した場合は、本Issューの対象に含めず別途follow-up Issueを起票する
  • P2/P3指摘(originのpush先repository検証、main/master/trunk destination guard、実bare remoteを使うintegration test拡充)は本Issueの対象外で、必要なら別途follow-up Issueを起票する

Outcome

Issue #1454(Phase A、merge済み)およびIssue #1468(trust-root hardening、merge・deployment attestation生成済み)で確立されたexternal trust rootに対し、system-managed PreToolUse hook一つだけがpublish認可を担当する状態になっている。candidate repository内のscripts/session-recording/codex-hook-adapter.mjs・scripts/agent-guards/git_mutation_command_policy.py・.codex/hooks.jsonは、allow決定・evidence発行・publisher実行のいずれにも関与しない。trusted launcherは、candidate側から受け取ったevidenceではなく、launcher自身が保持するtrusted copyのpolicy/analyzerを実行して認可判定を行い、Allowed Paths契約・issue番号・base/head SHA・verified_head・tool-use bindingへ紐付いた one-shot grant(PUBLISH_AUTHORIZATION_GRANT_V1)を発行する。全component一致時は既存publish laneのpositive/negative regressionがtrusted launcher(および#1468のtrusted publisher wrapper)経由で動作し、未mergeのpolicy/adapter変更を使ったbootstrap publishはfail-closedでdenyされる。対応する実subprocess integration testが追加されPASSしている状態。

In Scope

  • .codex/hooks.jsonから、candidate worktree内のcomposite/adapterによるpublish allow経路を削除する(project-local hookはrecording/advisory用途に限定し、publish allowを返さない設定へ変更する)
  • system-managed hookとして登録されたtrusted launcherが、同一Bash invocationに対し一度だけ起動されることを保証する(project-local側との二重起動を排除する)
  • scripts/session-recording/codex-hook-adapter.mjsとscripts/agent-guards/git_mutation_command_policy.pyを、authorization判定・evidence発行のいずれも行わないtelemetry/advisory専用のintegration点として再構成する
  • trusted launcher(scripts/trust-root/)が、candidateから受け取ったevidenceに依存せず、launcher自身が保持するtrusted copyのpolicy/analyzerロジックを実行して認可判定を行うよう変更する
  • trusted launcherが発行するgrantを、Allowed Paths gate status・対象issue番号・base/head SHA・verified_head・declared_publish_head・tool_use binding(session_id/turn_id/tool_use_id/command_sha256)へ紐付け、改変・再利用・expiry超過・別tool callへの転用をdenyする
  • publish実行を、Issue #1468で実装されたtrusted publisher wrapperへ委譲するよう変更する
  • 全component一致時、既存publish laneのpositive/negative regressionが、trusted launcher(および#1468のtrusted publisher wrapper)経由の実行経路で動作することを実subprocess integration testで検証する
  • 未mergeのpolicy/adapter変更を使った「同じPR自身のbootstrap publish」が、trusted launcher経由でdenyされることを検証するテストを追加する
  • docsに「publish lane trust boundary」という語句で、Phase A(実装: publish lane authorization codeの信頼起点となるexternal trust root(trusted hook launcher・manifest・bootstrap/rotation手順)を確立する #1454)・trust-root hardening(実装: publish lane trust root(#1454 Phase A)にnonce runtime state分離・trusted publisher wrapper・atomic rotation・worktree cwd解決・deployment attestationを追加する #1468)・Phase B(本Issue)の関係、および単一managed entrypoint設計を明記する

Out of Scope

Runtime Verification Applicability

decision: immediate
applicable_acs:
  - AC1
  - AC2
  - AC3
  - AC4
  - AC5
  - AC6
execution_environment:
  cli_tools:
    - python3
    - uv
    - node
    - git
  auth_required: false
  network_required: false
skip_conditions:
  - "Issue #1468(trust-root hardening follow-up)がmainへmergeされていない場合はSKIPではなくenvironment blockedとして扱う"
  - "対象環境でdeployment attestation(#1468 AC5)が生成されていない場合はSKIPではなくenvironment blockedとして扱う"
fallback_policy:
  fallback_success_is_pass: false
  notes: "fallback経由の成功をPASSに変換しない。trusted launcherおよびtrusted publisherを経由しないfixtureのみの検証はAC4/AC5/AC6のPASS判定に使わない"
artifact_requirements:
  - "temporary candidate worktree + temporary external trusted directoryを用いたpytest実subprocess integration testのoutput"
  - ".codex/hooks.jsonの切替設定を反映したテスト実行ログ"

本Issueの検証は、project-local hookを削除・改変してもmanaged hookのdeny判定が変わらないこと、candidate側component改変時にtrusted launcher経由でもfail-closedでdenyされること、既存publish laneのregressionがtrusted launcher・trusted publisher経由の実プロセス実行で動作することを含む。関数へfixtureを渡すunit testだけでは「候補側の改変がtrusted launcher経由の実行経路で実際にdenyされる」ことを証明できないため、temporary candidate worktree + Issue #1454/#1468で確立されたtrusted launcher・trusted publisher実体(テスト用configurationでinstallしたもの)+ 実subprocess実行を用いた統合テストで検証する。

Acceptance Criteria

  • AC1: project-local .codex/hooks.jsonを削除・改変しても、managed hookによるpublish authorizationのdeny判定が変わらないことをテストで確認できる
  • AC2: 同一Bash invocationに対し、security-critical launcherの起動回数が1回であり、project-local launcherとの二重起動が発生しないことをテストで確認できる
  • AC3: candidate側のscripts/session-recording/codex-hook-adapter.mjsとscripts/agent-guards/git_mutation_command_policy.pyを削除・改変しても、trusted launcher側のtrusted copyによる判定結果が変わらず、allowにならないことをテストで確認できる
  • AC4: trusted launcherが発行するgrant(PUBLISH_AUTHORIZATION_GRANT_V1)が、Allowed Paths gate status・issue番号・base/head SHA・verified_head・tool_use bindingに紐付いており、改変・再利用・expiry超過・別tool callへの転用がdenyされることをテストで確認できる
  • AC5: 全component一致時、既存publish laneのpositive/negative regressionが、trusted launcherおよびIssue #1468のtrusted publisher wrapper経由の実行経路で実subprocess integration testとしてPASSすることを確認できる
  • AC6: 未mergeのpolicy/adapter変更を使ったbootstrap publish(policy/adapter自身の未merge変更を使った自己publish)が、trusted launcher経由でdenyされることをテストで確認できる
  • AC7: docsに「publish lane trust boundary」という語句で、Phase A(実装: publish lane authorization codeの信頼起点となるexternal trust root(trusted hook launcher・manifest・bootstrap/rotation手順)を確立する #1454)・trust-root hardening(実装: publish lane trust root(#1454 Phase A)にnonce runtime state分離・trusted publisher wrapper・atomic rotation・worktree cwd解決・deployment attestationを追加する #1468)・Phase B(本Issue)の関係および単一managed entrypoint設計が明記されている

Verification Commands

# baseline-expect: fail
$ uv run --locked python3 -m pytest scripts/agent-guards/tests/test_publish_lane_trust_root_integration.py -k local_hooks_json_removal_does_not_change_managed_deny # AC1
# baseline-expect: fail
$ uv run --locked python3 -m pytest scripts/agent-guards/tests/test_publish_lane_trust_root_integration.py -k single_launcher_invocation_per_bash_call # AC2
# baseline-expect: fail
$ uv run --locked python3 -m pytest scripts/agent-guards/tests/test_publish_lane_trust_root_integration.py -k candidate_adapter_deletion_does_not_flip_to_allow # AC3
# baseline-expect: fail
$ uv run --locked python3 -m pytest scripts/agent-guards/tests/test_publish_lane_trust_root_integration.py -k grant_bound_to_allowed_paths_issue_base_head_tool_use # AC4
# baseline-expect: fail
$ uv run --locked python3 -m pytest scripts/agent-guards/tests/test_publish_lane_trust_root_integration.py -k publish_lane_regression_via_trusted_launcher_and_publisher # AC5
# baseline-expect: fail
$ uv run --locked python3 -m pytest scripts/agent-guards/tests/test_publish_lane_trust_root_integration.py -k bootstrap_publish_denied_via_trusted_launcher # AC6
# baseline-expect: fail
$ rg -n "publish lane trust boundary" docs/dev/session-recording-policy.md docs/dev/hook-boundaries.md docs/dev/agent-runtime-ops.md # AC7

Allowed Paths

  • .codex/hooks.json
  • scripts/agent-guards/git_mutation_command_policy.py
  • scripts/agent-guards/tests/test_git_mutation_command_policy.py
  • scripts/agent-guards/tests/test_publish_lane_trust_root_integration.py
  • scripts/session-recording/codex-hook-adapter.mjs
  • tests/session_recording/codex/test_hook_adapter.py
  • scripts/trust-root/trusted_hook_launcher.py
  • scripts/trust-root/tests/test_trust_root_hardening.py
  • docs/dev/session-recording-policy.md
  • docs/dev/hook-boundaries.md
  • docs/dev/agent-runtime-ops.md

Stop Conditions

Required Skills

  • Python / pytest
  • JavaScript / Node.js hook adapter
  • Git、SHA検証、trust boundary設計

Required Design References

Delivery Rule

Scope Delta(任意)

scope_delta:
  source: "https://github.com/squne121/loop-protocol/issues/1450#issuecomment-4945979261"
  author_association: OWNER
  summary: "OWNERによる敵対的レビューで、旧設計(candidate側evidence委譲・.codex/hooks.json二重entrypoint・publisher実行のGit config逃脱耐性欠如)が信頼モデルとして成立しないと判定された。nonce runtime state分離・trusted publisher wrapper・atomic rotation・cwd解決・deployment attestationをIssue #1468へ切り出し、本Issueは単一managed entrypoint + trusted-copy判定 + grant bindingへ全面的に再スコープした"
  allowed_paths_change: replace
  new_dependency: "#1468"

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Jul 11, 2026
  2. squne121 commented on Jul 11, 2026

    @squne121
    OwnerAuthor

    相互参照: Issue #1449(新規branch初回publishのatomic create lane実装)が、本Issue(#1450)に blocked_by として依存します(OWNER裁定 https://github.com/squne121/loop-protocol/issues/1449#issuecomment-4942998354)。

    #1449 の実装開始条件は以下の通りで、本Issue #1450 のスコープ・Allowed Paths・Acceptance Criteriaを変更するものではありません。

    本コメントは情報共有のみを目的とし、#1450 本文のスコープ変更は行いません。

  3. squne121 commented on Jul 11, 2026

    @squne121
    OwnerAuthor

    以下が敵対的レビュー結果です。GitHubへのコメント投稿や Issue 更新は行っていません。

    Issue #1450 敵対的レビュー

    判定

    REQUEST_CHANGES — 現在の契約では、ACをすべて満たしても「candidate worktree 外の信頼境界」は成立しません。

    Issue は、PR #1442 の authorization code が自分自身の publish を許可できる「自己署名型 authorization」を正しく問題化しています。また、未マージの policy 変更では同じ PR を bootstrap publish できず、別の privileged executor が必要になる点も認識しています。

    しかし、現在の In Scope と Allowed Paths では、hash を検証する処理も candidate worktree 内の adapter または policy に置くしかありません。改変対象自身に「自分が改変されていないこと」を判定させても、信頼の起点にはなりません。


    P1 Blocker 1: hash verifier 自体が candidate-controlled になる

    現在の実行経路は次です。

    .codex/hooks.json
      └─ $(git rev-parse --show-toplevel)/.codex/hooks/session-recording-composite.mjs
           └─ candidate worktree の codex-hook-adapter.mjs
                └─ candidate worktree の git_mutation_command_policy.py
    

    .codex/hooks.json は現在の checkout 配下の composite を実行し、composite は同じ checkout の adapter を直接 importします。adapter も repoRoot 配下の policy を実行します。

    したがって、次のような実装は防御になりません。

    # candidate policy 内
    if sha256(candidate_policy) != trusted_hash:
        deny()

    agent はこの if 自体を削除できます。同様に adapter 側で検証しても、adapter 自身を no-op にできます。

    必須修正

    hash verification を行う entrypoint は、candidate repository の外に置かなければなりません。

    推奨構成は、管理者所有ディレクトリの managed hook が直接 payload を受け取り、外部 manifest と candidate の digest を照合する方式です。Codex の hooks.managed_dir は、管理者が強制する lifecycle hook 用で、macOS/Linuxでは存在する絶対パスを指定する契約です。([OpenAI開発者]1)

    hooks.managed_dir 移行を Out of Scope に維持するなら、少なくとも以下の小さな外部コンポーネントは In Scope に戻す必要があります。

    agent書込み不可:
      trusted publish hook launcher
      trust manifest
      trusted policy/analyzer
    
    candidate worktree:
      command payload
      repository state
      candidate版 authorization files
    

    外部 verifier または managed entrypoint を追加しない限り、Issue の Outcome は技術的に達成不能です。


    P1 Blocker 2: pinning 対象が実際の TCB を網羅していない

    Issue が照合対象としているのは、主に次の2ファイルです。

    scripts/session-recording/codex-hook-adapter.mjs
    scripts/agent-guards/git_mutation_command_policy.py
    

    しかし、実際の authorization path には少なくとも以下も含まれます。

    .codex/hooks/session-recording-composite.mjs
    scripts/agent-guards/shell_command_analysis.py
    Node.js / Python interpreter resolution
    hook launcher
    

    特に adapter は、最初に candidate worktree の shell_command_analysis.py を呼び、そこで push が検出された場合にだけ policy を実行します。analyzer が「push なし」を返せば、policy は呼ばれません。

    具体的には、agent が analyzer を次のように改変できます。

    {
      "schema": "SHELL_COMMAND_ANALYSIS_V1",
      "status": "ok",
      "commands": [],
      "reason_code": "parsed"
    }

    adapter/policy の hash が正しくても、remote write 判定そのものを迂回できます。

    composite を空実装にするだけでも adapter まで到達しません。

    必須修正

    次のどちらかが必要です。

    1. external launcher が candidate の composite・adapter・analyzerを一切実行せず、trusted copy の analyzer/policyを直接実行する。
    2. 実行に関与する全ファイルを、単一の TCB manifest へ原子的に bindする。

    前者を推奨します。個別ファイルを後追いで pinning すると、依存ファイルが増えるたびに新しい迂回路が発生します。


    P1 Blocker 3: origin/main は trusted reference ではない

    Issue は trusted 参照の例として、環境変数の hash と git show origin/main:<path> を同列に扱っています。

    しかし、origin/main は candidate repository 内の可変な remote-tracking refです。ローカル ref、object database、Git 設定、環境変数を candidate 側で操作できるなら、これは外部の信頼点ではありません。

    Git は replacement ref を多くのコマンドで既定利用し、--no-replace-objects または GIT_NO_REPLACE_OBJECTS で無効化する必要があります。([Git]2) また、GIT_DIR、GIT_COMMON_DIR、GIT_OBJECT_DIRECTORY、GIT_ALTERNATE_OBJECT_DIRECTORIES は参照する repository や object store を変更できます。([Git]3) GIT_CONFIG_COUNT 等も runtime の設定値を注入できます。(Git)

    必須修正

    trusted source は一つに固定してください。推奨は次です。

    AUTHORIZATION_TCB_MANIFEST_V1:
      manifest_version: 1
      repository: squne121/loop-protocol
      trusted_commit_oid: "<full 40-hex commit>"
      components:
        - path: scripts/session-recording/codex-hook-adapter.mjs
          sha256: "<64-hex>"
        - path: scripts/agent-guards/shell_command_analysis.py
          sha256: "<64-hex>"
        - path: scripts/agent-guards/git_mutation_command_policy.py
          sha256: "<64-hex>"
      issued_by: privileged_operator

    この manifest は repository 外に置き、agent が書き込めない ownership/mode にします。

    Git object を参照する方式を採用する場合でも、少なくとも以下が必要です。

    moving refではなくfull commit OID
    外部read-only bare repository
    git --no-replace-objects
    明示的な --git-dir
    [Git](https://git-scm.com/docs/git-rev-parse)関連環境変数の除去
    ^{commit} によるcommit型確認
    

    git rev-parse --verify <oid>^{commit} --end-of-options により、full OIDが commit として解決できることを検査できます。(Git)


    P1 Blocker 4: check-then-execute の TOCTOU が未考慮

    仮に外部 verifier が candidate ファイルを hash 化しても、その後 candidate path を実行すると次の競合が残ります。

    1. verifierがcandidate policyをhash
    2. hash一致
    3. agent/別プロセスがpolicyを差し替える
    4. candidate policyを実行
    

    symlink の付け替えや rename でも同様です。

    必須修正

    照合後に candidate の実体を実行してはいけません。

    安全な流れは次です。

    1. external launcher がcandidate filesをlstat
    2. regular file・symlink不可を確認
    3. raw bytesをSHA-256照合
    4. 一致確認後も、実行するのはexternal trusted copy
    5. candidate repositoryはcwd・Git state・evidenceの入力としてのみ扱う
    

    candidate file の一致は「承認済み policy version と repository 宣言が一致していること」の確認に使用し、authorization decision は trusted copy が行うべきです。


    P1 Blocker 5: Runtime Verification を not_applicable にできない

    Issue は pytest の unit test と docs grep だけで検証可能として、runtime verification を対象外にしています。

    しかし今回扱うのは、以下を含む runtime trust boundary です。

    hook entrypoint のロード元
    subprocess の実行対象
    PATH / interpreter
    filesystem ownership・symlink・race
    Git ref / object / config resolution
    candidate と trusted directory の分離
    

    関数へ fixture を渡す unit testだけでは、「candidate verifierを消してもdenyされる」ことを証明できません。

    必須修正

    runtime_verification:
      decision: immediate
      environment:
        - temporary candidate worktree
        - temporary external trusted directory
        - actual Node/Python subprocess
        - local temporary bare Git repository
      network_required: false
      auth_required: false

    最低限、実 entrypoint から次の改変試験を行う必要があります。

    candidate adapterをallow固定に改変 → deny
    candidate policyをallow固定に改変 → deny
    candidate analyzerをcommands=[]固定に改変 → deny
    candidate compositeをno-op化 → deny
    candidate fileをsymlink化 → deny
    origin/mainを別commitへ書換え → trusted manifestは不変
    refs/replaceを追加 → trusted resolutionへ影響なし
    偽python3/gitをPATH先頭へ置く → 使用されない
    全component一致 → 既存publish判定へ進む
    

    P1 Blocker 6: Allowed Paths が安全な実装を禁止している

    現在の Allowed Paths は repository 内の policy、adapter、tests、docs に限定されています。

    外部 launcher、managed hook 設定、installer、trust manifest のいずれも変更対象にありません。そのため、実装者は必然的に candidate-controlled ファイルの中へ verifier を置くことになります。

    必須修正

    Issue を少なくとも次の2段階に分けるべきです。

    Phase A: external trust root
      - managed hook / trusted launcher
      - manifest schema
      - privileged installation・rotation手順
      - feature disabled / fail-closed until installed
    
    Phase B: candidate integrity binding
      - candidate TCB digest確認
      - trusted policy実行
      - publish lane regression
    

    repository PR だけで外部配置まで自動化できない場合、repository側では installer/template を配布し、OWNER が privileged step を実行する契約にしてください。


    P2 High: bootstrap と manifest rotation の手順が未定義

    #1450 は、未mergeの policy/adapter を使った自己publishを禁止します。一方、その policy/adapter の実装元である PR #1442 はまだ candidate branch 上にあります。

    さらに #1449 は #1450 を明示的な blocked_by とし、#1450 の trust boundary 上で atomic create lane を実装する前提です。

    この状態では、以下の順序を明文化しないと運用が停止します。

    1. privileged operator が最初のtrusted implementationをpublish
    2. merge後のfull commit OIDからmanifestを生成
    3. external trusted directoryへatomic install
    4. managed hookを有効化
    5. candidate worktree publish laneを再有効化
    6. 次回policy更新時も同じrotation手順を使う
    

    必要な契約は以下です。

    bootstrap_executor: privileged_operator
    manifest_update_authority: privileged_operator
    rollback_policy: explicit_operator_approval
    activation_order:
      - merge_trusted_code
      - install_trusted_runtime
      - install_manifest
      - enable_publish_lane

    bootstrap executor を Out of Scope にすること自体は可能ですが、その手順と責任主体まで未定義にしてはいけません。


    P2 High: digest 契約が曖昧

    「内容またはSHA256を比較する」だけでは実装間で意味がずれます。

    最低限、次を固定してください。

    digest_algorithm: sha256
    digest_input: exact_raw_file_bytes
    hex_encoding: lowercase
    expected_length: 64
    path_type: regular_file_only
    symlinks: denied
    path_canonicalization: repository_relative_posix
    line_ending_normalization: none
    unicode_normalization: none
    manifest_unknown_keys: denied
    missing_component: denied
    duplicate_component: denied

    failure reason も区別すべきです。

    authorization_trust_root_missing
    authorization_manifest_invalid
    authorization_component_missing
    authorization_component_type_invalid
    authorization_component_digest_mismatch
    authorization_reference_untrusted
    authorization_runtime_untrusted
    

    すべて generic allow ではなく、remote_write_requires_approval 相当へ fail-closed させます。


    修正版 Outcome

    candidate worktree外の、agentが書込み不能なtrusted hook launcherが
    PreToolUse payloadを直接受け取る。
    
    launcherは外部manifestを検証し、candidate authorization componentの
    raw-byte SHA-256、file type、canonical pathを照合する。
    
    一致時もcandidate componentは実行せず、外部trusted copyの
    analyzer/policyを絶対パス・sanitized environmentで実行する。
    
    manifest欠落、component改変、symlink、runtime不一致、検証失敗は
    authorization_code_integrity_* reasonでfail-closedにdenyされる。
    
    policy/adapter自身の更新は通常publish laneではbootstrapできず、
    privileged operatorによるmanifest rotation手順を必要とする。

    修正版 Acceptance Criteria

    • AC1: PreToolUse の authorization entrypoint が candidate repository 外の絶対パスにあり、candidate user/agentから書込み不能である。
    • AC2: trusted manifest が単一の schema/version/full commit OID と全 TCB component の SHA-256 を原子的に bindする。
    • AC3: candidate adapter、policy、analyzer、compositeのいずれかを改変すると、実 hook entrypointが authorization_component_digest_mismatch でdenyする。
    • AC4: integrity check 自体を candidate policy/adapterから削除しても、external launcherがdenyを維持する。
    • AC5: matching 時も candidate policy/analyzerを実行せず、trusted copyだけを絶対パスで実行する。
    • AC6: symlink、non-regular file、missing file、duplicate manifest entryをfail-closedにする。
    • AC7: origin/main や candidate repository内のremote-tracking refを単独のtrusted sourceとして受理しない。
    • AC8: Gitを使用する場合、replace refsとGit repository/object/config redirect用環境変数を無効化する。
    • AC9: PATH上の偽 python3 / git / node がauthorization runtimeへ影響しない。
    • AC10: 全component一致時のみ、既存publish lane positive/negative regressionがtrusted policy経由で動作する。
    • AC11: policy/adapter自身を変更した未merge branchのbootstrap publishがdenyされる。
    • AC12: privileged bootstrapとmanifest rotationの担当者、順序、failure/rollback動作がdocsに記載される。
    • AC13: temporary trusted directoryとcandidate worktreeを分離した実 subprocess integration testがPASSする。

    最小 merge 条件

    1. candidate 外の verifier/launcher を設計に追加する。
    2. adapter/policy 以外の transitive TCB を解消または manifestへ含める。
    3. origin/main を trusted source の例から削除するか、外部read-only object storeとfull OID方式へ限定する。
    4. check後にcandidate codeを実行しない。
    5. Runtime Verificationを immediate に変更する。
    6. privileged bootstrap・manifest rotation手順を固定する。
    7. Allowed Pathsを上記実装が可能な範囲へ変更する。

    最終判断

    #1450 は問題設定自体は正しいものの、現在の設計は hash pinning の対象を定義しているだけで、hash pinning を信用できる主体を定義していません。

    このまま実装すると、テスト上は authorization_code_integrity_mismatch を返せても、攻撃者はその検査へ到達する前の composite、adapter、analyzer、または verifier 自体を変更できます。

    したがって、現契約のままの実装・mergeは推奨しません。#1449 が依存するセキュリティ境界として使用するには、external trust root を先に契約へ組み込む必要があります。

    中心的な修正点は、「candidate codeをhashする」から「candidate外のtrusted launcherがhashし、trusted codeだけを実行する」へ変更することです。

  4. squne121 commented on Jul 11, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Human Escalation Required

    The loop has terminated and requires human review. Cause: human judgment required

    Blockers

    "issue-refinement-loop Step 1 (Investigation) は planner (plan_refinement_loop.py) により investigation_policy.required=true (reason_code: target_paths_present) と判定されたが、codebase-investigator SubAgent が必須とする gemini-cli-headless-delegation 経由の調査が、GEMINI_API_KEY 未設定/OAuth未認証による auth_failed (exit code 41) で2回連続失敗した(setup_check.py: auth.ok=false, status=auth_failed)。既知のtransientパターン(メモリ記録: gemini delegation retry)に基づき明示的にリトライ指示付きで再実行したが、同一エラーが再現し、環境固有の非transient failureであることが確認された。"
    
    "codebase-investigator SubAgentの役割定義は「実調査は必ず gemini-cli-headless-delegation 経由で Gemini に委譲する。本 SubAgent 自身は Read / Grep / Glob を直接実行しない」と明記されており、fail-closedポリシー上、認証失敗時に自力代替調査へフォールバックすることを拒否している(SubAgent自身がそう報告し、read-only制約からIssueへの直接報告も行っていない)。"
    
    "web-researcher (Step 1b) は正常に完了し、Issue #1450 の technical premise(trusted参照としての origin/main remote-tracking ref の利用)について、git公式仕様上の重要なギャップ(TOCTOU race condition、stale fetch前提、shared .git内でのref書き換え可能性)を裏付け付きで検出した。この情報はStep 2 reviewへの入力として保持しているが、Step 1の投入が完了していないためStep 2 (issue-reviewer) をまだ起動していない。"
    
    "既知のfollow-up: gemini auth環境不備は #104 (agy/Antigravity CLI移行) で追跡されているリポジトリレベルの既知問題であり、本 worktree/セッション固有の設定不備の可能性が高い。人間による GEMINI_API_KEY 設定または `gemini auth login` の実行、あるいは codebase-investigator の fallback policy 見直しが必要。"
    
  5. squne121 commented on Jul 11, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Human Escalation Required

    The loop has terminated and requires human review. Cause: human judgment required

    Blockers

    "anchor_comment_final_classification: human_escalation(anchor: https://github.com/squne121/loop-protocol/issues/1450#issuecomment-4943281788、投稿者: squne121, author_association: OWNER)"
    
    "OWNER の敵対的レビュー最終判断は「現契約のままの実装・mergeは推奨しません」であり、P1 Blocker 1-6・修正版Outcome・修正版AC(13件)・Allowed Paths拡張を含む再設計を要求している"
    
    "Step 1 codebase-investigator(gemini-cli-headless-delegation経由)の独立調査により、P1 Blocker 1の前提(repository外のcandidate-controlledでない trust entrypointがリポジトリ内に存在しない)が事実として裏付けられた"
    
    "Step 1b web-researcher(direct_web fallback)の fact-check により、OWNER コメント中の critical external claim(Codex hooks.managed_dir の存在、origin/main が共有 mutable remote-tracking ref であること、TOCTOU race conditionの一般的存在、immutable trusted referenceのベストプラクティス)はいずれも一次情報で verified/supported であり、contradicted は無し"
    
    "OWNER要求の是正(Phase A: external trust root の新規In Scope追加、managed hook/manifest等の新Allowed Pathsレイヤー追加、Runtime Verification Applicabilityをnot_applicableからimmediateへ変更、TCB manifest等の低検証可能AC追加)は、issue-refinement-loopのScope Change Stop Conditions(新規In Scope機能領域・新規Allowed Pathsディレクトリ/別アーキテクチャ層・新規低検証可能ACの追加)に該当するため、issue-authorによるin-place rewriteで自動対応することはできない"
    
    "review-issue(Step 2, issue-reviewer)はVERDICT: approveを返したが、これはC1-C13の決定論的contract構造チェックのみであり、OWNER anchor commentの content/architecture判断(信頼境界がScope内実装では成立しない、という技術的指摘)を評価するものではない"
    
    "対処案: (A) 新規Issueとして Phase A(external trust root: managed hook launcher, trust manifest, privileged bootstrap/rotation手順)を起票し、#1450 はそれに依存する Phase B(candidate integrity binding)へ再スコープする、または (B) OWNER が現在の限定scopeでの妥当性(defense-in-depthとしての位置づけ、Outcomeの表現弱化)を明示的に許容するかを判断する。いずれもOWNERの明示的判断が必要"
    
  6. squne121 commented on Jul 11, 2026

    @squne121
    OwnerAuthor

    GitHubへのコメント投稿・Issue更新は行っていません。現行Issueと、マージ済みのPhase A実装を前提に再評価しました。

    Issue #1450 敵対的レビュー

    判定:REQUEST_CHANGES — 現契約のまま実装着手不可

    #1450 は、前回指摘した「candidate-controlled verifierでは信頼境界にならない」という問題を受け、#1454をPhase A、#1450をPhase Bへ分離した点は妥当です。#1454/PR #1457では、外部trust root、manifest、local_oidのblob照合、managed hook、updatedInputによるコマンド置換まで実装されました。

    しかし、マージされたPhase A実装を読むと、#1450には以下の問題が残っています。

    trusted evidenceの生成経路が存在せず、publisherも実行時にはcandidate-controlledであり、正常系は権限モデル上動作しない。

    現在のAC1〜AC4がすべてPASSしても、end-to-endの認可特性は証明できません。


    P0 Blocker 1:trusted evidenceのproducer・配送経路が未定義

    trusted_hook_launcher.py は、managed hookのstdinとは別に、--evidence-fileで PUBLISH_EVIDENCE_V1 を必須入力とします。そこにはtool_use_id、command digest、local_oid、remote_oid、ref、nonce、expiryなどが必要です。Phase Aのコードと文書は、そのファイルをtrusted verifierが生成することだけを規定し、具体的な生成・受け渡し方法を#1450へ明示的に先送りしています。

    一方、#1450のAC2はcandidate側adapter/policyを「command payloadとcomponent実体をlauncherへ渡すintegration点」としています。これは信頼モデルとして成立しません。candidate側コードは攻撃者管理下と仮定しているため、trusted evidenceのissuerにもtransportにもできません。

    さらに、既存publish lane policyが確認していた以下の事実が、現在のlauncher入力には含まれていません。

    • allowed_paths_gate_status
    • gateが対象としたIssue、base SHA、head SHA
    • verified_head
    • declared_publish_head
    • remote readback sourceとその真正性

    既存policyはこれらを認可条件にしていますが、Phase A launcherはissue_numberをparseするだけで、branch・Allowed Paths契約・review evidenceとの対応を評価していません。

    必須修正

    candidate adapterからlauncherへ「委譲」する設計を削除し、次のいずれかへ変更してください。

    1. managed launcher自身が、trusted copyのpolicy/analyzerを直接実行し、認可入力を収集する。
    2. candidate外のprivileged brokerが、一回限りの署名済みgrantを生成し、launcherがtool_use_idをキーに取得する。

    推奨契約は次です。

    PUBLISH_AUTHORIZATION_GRANT_V1:
      issuer_generation: <int>
      repository: squne121/loop-protocol
      issue_number: <int>
      target_ref: refs/heads/<branch>
      local_oid: <40hex>
      expected_remote_oid: <40hex-or-absent>
      verified_head: <40hex>
      declared_publish_head: <40hex>
      allowed_paths_gate:
        status: ok
        issue_number: <int>
        base_sha: <40hex>
        head_sha: <40hex>
        contract_body_sha256: <64hex>
      tool_binding:
        session_id: <string>
        turn_id: <string>
        tool_use_id: <string>
        cwd_realpath: <string>
        command_sha256: <64hex>
      nonce: <string>
      expires_at: <UTC timestamp>
      authenticator: <MAC or broker-issued opaque handle>

    issued_byのような自己申告metadataではなく、candidateが生成できないMAC、privileged broker、またはroot-owned one-shot storeが必要です。


    P0 Blocker 2:Phase Aは「マージ済み」だが「実機で稼働済み」ではない

    PR #1457は、installerと登録手順を配布しただけで、privileged operatorによる実機installや/etc/codex/requirements.toml登録を実行していません。PR本文でも明示されています。

    対して#1450は、「merge済みtrust rootが既に稼働している」ことを前提とし、実機installをOut of Scopeにしています。

    この二つの間に、実行環境の状態を証明するゲートがありません。リポジトリ内のintegration testがPASSしても、実機ではmanaged hookが未登録、古いgeneration、誤owner、誤modeという可能性があります。

    OpenAIの公式仕様上、project-local hookは未信頼ならskip可能ですが、requirements.toml由来のmanaged hookはpolicy-trustedでユーザーから無効化できません。したがって、実際のmanaged registrationがセキュリティ特性の前提です。([OpenAI Developers]1)

    必須修正

    #1450に着手前ゲートを追加してください。

    deployment_precondition:
      required: true
      evidence_schema: TRUST_ROOT_DEPLOYMENT_ATTESTATION_V1
      required_observations:
        - trust_root_owner_uid
        - trust_root_mode_and_ancestor_modes
        - active_generation
        - manifest_sha256
        - launcher_sha256
        - requirements_toml_sha256
        - managed_hook_source
        - managed_hook_command
        - live_fail_closed_probe

    temporary directory上のpytestだけでなく、対象WSL環境でoperatorが生成した証跡を必須にすべきです。


    P0 Blocker 3:AC1の.codex/hooks.json切替は二重起動を作る

    #1450 AC1は、project-local .codex/hooks.jsonをtrusted launcherへ向けることを要求しています。

    しかしPhase Aは既に、system-managed PreToolUseとして同launcherを登録する設計です。Codexは複数hook sourceについて、上位設定で下位設定を置換せず、一致した全hookを並列起動します。([OpenAI Developers]1)

    したがってAC1を実装すると、少なくとも以下が発生します。

    • managed launcherとproject-local launcherの二重起動
    • 同じevidence/nonceに対する競合
    • 一方がnonceをconsumeし、他方がreplay扱いになる可能性
    • 複数のupdatedInputが返る場合の統合契約が未定義
    • candidate-controlledなlocal hookを再び認可経路へ入れる

    現在の.codex/hooks.jsonにも既存composite、branch guard、worktree guardなど複数のBash PreToolUse hookがあります。

    必須修正

    AC1を反転してください。

    security-critical publish authorization entrypointはmanaged hook一つのみ。
    .codex/hooks.jsonにはtrusted launcherを登録しない。
    project-local adapterはrecording/advisory用途に限定し、publish allowを返さない。
    .codex/hooks.jsonを削除・改変してもmanaged authorization結果が変わらない。
    

    OpenAI公式仕様でも、managed hookを強制しつつ他sourceを無効化する場合はallow_managed_hooks_onlyが用意されています。少なくともsecurity-critical matcherについて、単一entrypointを保証する必要があります。([OpenAI Developers]1)


    P0 Blocker 4:rewritten commandはtrusted publisherではない

    launcherはrepository identityをremote.origin.urlで確認した後、次のコマンドを返します。

    /usr/bin/git push \
      --force-with-lease=<ref>:<remote_oid> \
      origin \
      <local_oid>:<ref>
    

    問題は、認可時のrestricted Git環境ではなく、後からCodexの通常shell環境でこの文字列が実行されることです。updatedInputは置換後のcommand文字列を実行する仕組みであり、launcherのenvやopen済みdescriptorは引き継ぎません。([OpenAI Developers]1)

    Gitでは以下が有効です。

    • remote.origin.pushurlがある場合、pushにはremote.origin.urlではなくpushurlが使われる。
    • push URLを複数設定すると、すべてへpushされる。
    • url.*.pushInsteadOfでpush先URLを書き換えられる。
    • core.hooksPathでcandidate-controlledなpre-push hookを起動できる。
    • git pushは既定でpre-push hookを実行する。([Git]2)

    つまり、remote.origin.urlが正規GitHub URLでも、実際には別repositoryへ送信したり、push直前に任意処理を実行したりできます。検査後に.git/configを変更するTOCTOUも残ります。

    必須修正

    updatedInput.commandはGitそのものではなく、外部trust root内のpublisher wrapperを指す必要があります。

    /opt/loop-protocol/trust-root/trusted_publish \
      --grant-id <opaque-one-shot-id>
    

    publisher内部で次を固定します。

    env allowlist
    absolute /usr/bin/git
    explicit --git-dir
    explicit canonical repository URL(origin名を使わない)
    GIT_CONFIG_GLOBAL=/dev/null
    GIT_CONFIG_SYSTEM=/dev/null
    GIT_CONFIG_NOSYSTEM=1
    -c core.hooksPath=/dev/null
    --no-verify
    protocol allowlist
    <local_oid>:<validated-ref>
    --force-with-lease=<ref>:<expected-oid>
    

    Gitの明示的な--force-with-lease=<ref>:<expect>は、remote refが期待値と一致しない限り失敗するため、この形自体は維持して構いません。([Git]3)

    必須negative test:

    remote.origin.pushurl = attacker repository
    url.<attacker>.pushInsteadOf = canonical URL
    core.hooksPath = candidate-controlled path
    GIT_CONFIG_COUNT injection
    authorization後・execution前の.git/config変更
    複数pushurl
    pre-push hookによる副作用
    

    P0 Blocker 5:nonce storeが権限契約上書き込めない

    launcherは「runtime UIDとtrust root owner UIDが異なること」を必須にしています。その一方で、nonce消費時には次を行います。

    nonces_dir = trust_root_dir / "nonces"
    nonces_dir.mkdir(mode=0o700, exist_ok=True)
    os.open(marker_path, O_CREAT | O_EXCL | O_WRONLY, 0o600)

    installerはtrust rootをowner-controlledにし、release filesを0444、release directoryを0555にしますが、runtime UID向けのwritable nonce directoryやACLを作成していません。

    したがって既定のproduction permission modelでは、runtime userはnonces/を作れず、正常なpublishもauthorization_runtime_untrustedで停止します。

    PR #1457のテストでも、異なる実UIDを使ったprivileged正常系は環境制約によりSKIPされています。

    必須修正

    immutable trust rootとmutable runtime stateを分離してください。

    /opt/loop-protocol/trust-root/     root-owned, immutable
    /run/loop-protocol/publish-auth/   broker-owned mutable state
    

    より安全なのは、unprivileged launcher自身にmarkerを書かせず、privileged brokerへone-shot consumeを依頼する方式です。

    少なくとも次の検証が必要です。

    • 実際に異なるowner UID/runtime UIDを使うpositive test
    • runtime UIDがtrust rootを書き換えられないこと
    • nonce replayの並列テスト
    • symlink/hardlink/directory replacement対策
    • state cleanup、容量上限、expiry後のGC

    この問題は#1450だけでは修正できず、#1454のfollow-upまたはreopenが必要です。


    P1 Blocker 6:session cwdをrepository rootと誤認している

    OpenAI公式仕様ではhook commandはsessionのcwdで実行され、Codexはrepositoryのsubdirectoryから開始される場合があります。([OpenAI Developers]1)

    launcherはevidenceのcandidate_repo_dirをそのまま使い、Git directoryを次のように構築します。

    git_dir = Path(candidate_repo_dir) / ".git"

    cwdがsrc/やdocs/の場合は.gitが存在せず、正当なpublishがfail-closedになります。

    必須修正

    固定Git binaryとsanitized envで、次を実行してrepository root/common dirを確定してください。

    git -C <cwd> rev-parse --show-toplevel
    git -C <cwd> rev-parse --absolute-git-dir
    git -C <cwd> rev-parse --git-common-dir
    

    そのうえで、

    • cwdがroot配下である
    • linked worktreeのgitdir/common dirが期待repositoryに属する
    • symlink escapeがない

    ことを検証します。

    必須テスト:

    repo root cwd
    nested src/ cwd
    linked worktree root
    linked worktree subdirectory
    cwd outside repository
    symlinked cwd
    

    P1 Blocker 7:rotationがrelease単位で原子的ではない

    installerは次の順に別々のrenameを行います。

    1. active.json
    2. top-level trusted_hook_launcher.py
    3. top-level manifest_schema.py

    各renameは個別にはatomicですが、3ファイルの組としてはatomicではありません。rotation中のhookは、例えば「新manifest+旧launcher+旧schema」という混成状態を観測できます。

    必須修正

    固定パスには小さなimmutable dispatcherだけを置き、dispatcherがactive.jsonを一度だけ読み、同じrelease directory内のlauncher/schema/manifestを使用する構成にしてください。

    trust-root/
      dispatcher.py               # 変更しない、または別のprivileged upgrade手順
      active.json                 # release IDだけを原子的に切替
      releases/
        12-<digest>/
          launcher.py
          manifest_schema.py
          manifest.json
    

    rotation中に多数のhook subprocessを並列起動するテストも必要です。


    P2 High:Issue契約とタイトルが実装実態に合っていない

    現在のタイトルは「policy/adapterのhash pinning」ですが、必要なセキュリティ特性はhash pinningではありません。

    必要なのは次の一連のend-to-end propertyです。

    admin-managed hookが必ず一度だけ起動し、trusted verifierがapproval evidenceを検証し、同じOID・ref・remote leaseを、config隔離されたtrusted publisherが送信する。

    candidate component digestはその一部にすぎません。

    推奨タイトル

    実装: managed publish authorization brokerとtrusted publisherを統合し、
    candidate codeをpublish認可経路から除外する
    

    修正版Issue契約の最小要件

    Outcome

    system-managed PreToolUse hook一つだけがpublish認可を担当する。
    candidate repository内のadapter/policy/analyzer/.codex/hooks.jsonは、
    allow decision・evidence発行・publisher実行のいずれにも関与しない。
    
    trusted verifierはAllowed Paths契約・reviewed head・remote lease・
    repository identity・command/tool-use bindingを検証したone-shot grantを発行する。
    
    trusted publisherは同一grantに含まれるlocal_oid/ref/remote_oidを、
    isolated Git environmentと明示的なcanonical repository URLを使ってpublishする。
    

    必須AC

    1. project-local hookを削除・改変してもmanaged hookがdenyを維持する。
    2. 同じBash invocationに対するsecurity-critical launcherの起動回数が1回である。
    3. candidate adapter/policy/analyzerを削除・改変してもallowにならない。
    4. trusted grantがAllowed Paths contract、issue、base/head、verified headへbindされる。
    5. grantの改変、再利用、expiry超過、別tool callへの転用をdenyする。
    6. pushurl、insteadOf、pushInsteadOf、core.hooksPath、ambient Git envの影響を受けない。
    7. publisherが明示的URL、明示的OID、明示的leaseで実pushする。
    8. 異なるtrust-root owner UID/runtime UIDによるpositive runtime testがPASSする。
    9. nested cwdとlinked worktreeから正常動作する。
    10. rotation中に旧/新releaseが混在しない。
    11. 実機managed hook registration証跡が存在しない場合、publish laneをenableしない。
    12. #1408の既存positive/negative laneを、candidate policyではなくtrusted verifier経由で再現する。

    Allowed Paths

    現在のAllowed Pathsでは修正不能です。少なくとも次への拡張が必要です。

    scripts/trust-root/**
    scripts/trust-root/tests/**
    .codex/hooks.json
    scripts/session-recording/codex-hook-adapter.mjs
    tests/session_recording/codex/**
    scripts/agent-guards/git_mutation_command_policy.py
    scripts/agent-guards/tests/**
    docs/dev/hook-boundaries.md
    docs/dev/session-recording-policy.md
    docs/dev/agent-runtime-ops.md
    

    ただし、.codex/hooks.jsonの変更目的はlauncher追加ではなく、candidate側publish allow経路の削除またはtelemetry限定化です。


    推奨実施順序

    1. 実装: publish lane authorization codeの信頼起点となるexternal trust root(trusted hook launcher・manifest・bootstrap/rotation手順)を確立する #1454 follow-upを作成し、nonce state、trusted publisher、atomic rotation、実UID正常系を修正する。
    2. privileged operatorが実機へtrust rootとmanaged hookをinstallし、deployment attestationを保存する。
    3. #1450を上記契約へ全面更新する。
    4. #1450を実装し、managed hook単一entrypointでend-to-endテストする。
    5. #1450に依存する#1449のatomic create laneへ進む。

    現状の#1450を先に実装すると、テスト上はgreenでも、実機では全denyになるか、Git config経由で別destinationへpushできる構成になります。

    この判定では、#1450の実装を止め、#1454の修正follow-upを先行させるのが妥当です。

  7. squne121 commented on Jul 11, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

    LOOP_HANDOFF_RESULT_V1:
      status: blocked
      routing_action: blocked
      contract_review:
        status: blocked
        gate_result: blocked
        latest_comment_url: https://github.com/squne121/loop-protocol/issues/1450#issuecomment-4945979261
        generated_at: '2026-07-11T13:03:56Z'
        body_sha256: sha256:2d73409154f4dcbbf21dad0f88744e57933a88972bd32915d295cc67bcc8081d
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: blocked
        required: []
        skipped: []
      blockers:
      - kind: dependency_unmerged
        description: 'Issue #1468(trust-root hardening follow-up: nonce runtime state分離・trusted
          publisher wrapper・atomic rotation・worktree cwd解決・deployment attestation)が未mergeのため、本Issue(#1450)の実装着手はブロックされている'
      permissions:
        unavailable: []
      generated_at: '2026-07-11T13:03:56Z'
  8. squne121 commented on Jul 11, 2026

    @squne121
    OwnerAuthor

    クローズ判断: not planned

    本Issueは #1468(trust-root hardening follow-up: privileged broker・nonce runtime state分離・trusted publisher wrapper・atomic rotation・deployment attestation)のmergeを前提として着手する設計でした。#1468 は以下の理由でnot plannedとしてクローズしました。

    • privileged broker等の実装が本質的に権限昇格・別UIDプロセス起動を要求し、実行環境(単一UID)で安全に実装・検証できない
    • そもそもの脅威モデル(candidate側コードが自分自身のpush authorization判定を偽造できるリスクへの防御)が、単一ユーザー・単一PCの個人開発リポジトリに対して過剰であり、費用対効果が見合わない

    本Issueが対策しようとしていた「self-signed authorization」問題(publishしようとしている差分自身が、そのpublishを許可するpolicyも同時に変更できる)についても、以下の理由で追加対策は不要と判断しました。

    今後の方針

    scripts/trust-root/(#1454で導入済み)は本Issueのクローズにより実質的に利用されないコードとして残ります。将来的なcleanup対象として認識しておきます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions