Skip to content

実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1153"
goal_ref: "Child A0 (#1157) の containment / runtime inventory / Kill Switch 完了後、Latitude credential を保持した real pilot 例外を認めるかを人間 Decision として固定し、許可する場合のみ time-boxed activation / rollback / rotation / retention 境界を実装する"
change_kind: mixed

Parent Issue

#1153

Parent Goal Ref

  • Goal: Claude Code / Codex CLI / Google Antigravity の運用データを public-safe な agent_run_report/v1 / agent_retro_index/v1 に正規化し、ChatGPT が GitHub 経由で再現可能なレトロスペクティブを行える pilot 運用を確立する
  • Desired Destination: private observation plane の credential 境界を人間 Decision 付きで固定し、許可時のみ time-boxed な real pilot activation を行える状態

Current Validated Scope

  • docs/dev/secret-policy.md に Latitude real pilot 例外の credential category / storage boundary / rotation owner / revoke procedure を追記する
  • docs/dev/session-recording-policy.md に real session start gate と A1 decision 参照境界を追記する
  • .claude/scripts/check_session_recording_runtime_safety.py と関連 test/fixture に activation gate / blocked 判定を追加する
  • package.json に policy / host checker 実行経路を追加または調整する

Remaining Parent Gaps

  • Child B で Claude / Codex / Antigravity の capture capability verdict を authoritative evidence 付きで確定する
  • Child C0/C1 で private observation source を public-safe report schema と adapter に接続する
  • Child D で CHATGPT_RETRO_CONTEXT_V1 marker 境界を実装する
  • Child E で Cloud pilot metrics と adopt / withdraw decision を記録する

Outcome

docs/dev/secret-policy.md と docs/dev/session-recording-policy.md に LATITUDE_PILOT_EXCEPTION_V1 decision 契約が追加され、real pilot 可否が machine-readable に判定できる状態。

In Scope

  • LATITUDE_PILOT_EXCEPTION_V1 decision marker の定義
  • reject_and_uninstall | approve_synthetic_only | approve_timeboxed_real_pilot | defer の closed enum 化
  • approve_timeboxed_real_pilot 時の activation window / max eligible runs / allowed issue labels / rollback deadline / stop thresholds の必須化
  • API key storage boundary / rotation owner / revoke procedure / leakage response の明記
  • unpinned npx / unknown provenance / non-HTTPS / LATITUDE_DEBUG=1 を activation 拒否条件として固定
  • approve_timeboxed_real_pilot 時の distribution 必須フィールド(exact_version / lockfile_digest / npm_registry_signature_verified: true / tarball_sha256 / entrypoint_sha256 / preload_sha256 / hook_command_sha256)の明記
  • activation gate は Stop hook ではなく session 開始前の host verifier(check_session_recording_runtime_safety.py --json --execution-profile host)JSON を正本とし、hook は diagnostic layer と明記
  • security:session-recording:host の activation 前 deny または blocked_until_activation 判定
  • provider-side retention / delete verification が機械検証不能な場合の fail-closed / unknown 契約
  • parent 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 への prerequisite 参照面の明記

Out of Scope

  • real telemetry の即時実走
  • raw prompt / request body / tool result / local path の表示・hash 化・GitHub 投稿
  • Latitude adapter 実装
  • Cloud pilot 実行
  • self-host 構築

Acceptance Criteria

  • AC1: docs/dev/secret-policy.md に LATITUDE_PILOT_EXCEPTION_V1 decision ブロックが 1 件だけ存在し、decision が reject_and_uninstall | approve_synthetic_only | approve_timeboxed_real_pilot | defer のいずれかである(導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 comment は decision_ref として参照)
  • AC2: approve_timeboxed_real_pilot の場合、activation window / max eligible runs / allowed issue labels / rollback deadline / stop thresholds が必須である
  • AC3: API key の storage boundary、rotation owner、revoke procedure、leakage response が docs/dev/secret-policy.md に追記されている
  • AC4: docs/dev/session-recording-policy.md の real session start gate が A1 decision を参照し、decision 不在時は BLOCKED を維持する
  • AC5: unpinned npx、unknown provenance、unknown destination、non-HTTPS、LATITUDE_DEBUG=1 は real pilot activation を拒否する
  • AC6: security:session-recording:host が secret 非出力 JSON を返し、activation 前は deny または blocked_until_activation になる
  • AC7: provider-side remote trace state が machine-verifiable でない場合、remote_cleanup_state: unknown として PASS にしない
  • AC8: real API key を argv に渡す手順を禁止し、argv_exposure_state: absent_verified | possible | unknown を定義する。possible または unknown の場合は credential_rotation_state: required とし activation を blocked にする
  • AC9: decision が reject_and_uninstall の場合、quiescent two-stage postcondition と二回 scan の結果を記録する
  • AC10: 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の Child B / C1 / E が A1 decision marker を prerequisite として参照する

Verification Commands

# AC1
$ rg -c "LATITUDE_PILOT_EXCEPTION_V1" docs/dev/secret-policy.md

# AC2
$ rg -n -e "activation_window" -e "max_eligible_runs" -e "allowed_issue_labels" -e "rollback_deadline" -e "stop_thresholds" docs/dev/secret-policy.md

# AC3
$ rg -n -e "rotation_owner" -e "revoke_procedure" -e "leakage_response" docs/dev/secret-policy.md

# AC4
$ rg -n -e "LATITUDE_PILOT_EXCEPTION_V1" -e "a1_decision_ref" docs/dev/session-recording-policy.md

# AC5
$ rg -n -e "distribution_exact_version" -e "npm_audit_signatures_verified" -e "lockfile_digest" -e "tarball_sha256" docs/dev/secret-policy.md

# AC6
$ rg -n -e "blocked_until_activation" -e "deny" docs/dev/session-recording-policy.md

# AC7
$ rg -n -e "remote_cleanup_state.*unknown" -e "machine_verified" -e "human_attested" docs/dev/secret-policy.md

# AC8
$ rg -n -e "argv_exposure_state" -e "credential_rotation_state" docs/dev/secret-policy.md

# AC9
$ rg -n -e "reject_and_uninstall.*postcondition" -e "quiescent" -e "two.stage" docs/dev/secret-policy.md

# AC10
$ rg -n "LATITUDE_PILOT_EXCEPTION_V1" docs/dev/session-recording-policy.md

Allowed Paths

  • docs/dev/secret-policy.md
  • docs/dev/session-recording-policy.md
  • .claude/scripts/check_session_recording_runtime_safety.py
  • .claude/scripts/lib/latitude_telemetry_safety.py
  • tests/session_recording_runtime_safety.test.ts
  • tests/fixtures/session-recording-runtime-safety/**
  • package.json

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • credential value を読む、表示する、hash 化する必要が生じた場合
  • request spool / remote trace body を読む必要が生じた場合

Required Skills

  • Secret Inventory / Kill Switch policy
  • Claude Code hook configuration
  • npm provenance verification
  • fail-closed runtime verification

Scope Delta(任意)

N/A

Runtime Verification Applicability

decision: not_applicable
rationale: 本 Issue は decision gate と checker contract の admission が主目的であり、real pilot 実走は scope 外

Delivery Rule

  • 1 Issue = 1 PR
  • Draft PR を既定とする
  • real telemetry 実走は許可しない

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    workflow
    process
    on Jun 28, 2026
  2. squne121 commented on Jun 28, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES。現時点の approve_timeboxed_real_pilot は不可。defer または approve_synthetic_only を既定にして、activation gate の検証契約を修正してから実装着手すべきです。

    #1220 は「A0 #1157 完了後に、Latitude credential を保持した real pilot 例外を人間 Decision として固定する」Issueで、方向性自体は妥当です。対象Issueのコメントは0件なので、追加議論はまだありません。

    既存ポリシー上、Latitude API key は agent_local_secret であり、存在時は secrets_mode: app_secret。session recording は不許可、real development session も false のままです。session-recording-policy.md も pilot_state: BLOCKED、real_development_session_allowed: false、別Child Issueの人間Decisionまで blocked と定義しています。

    Blocker

    1. AC1 が pnpm policy:check では証明不能

    #1220 は「#1153 に LATITUDE_PILOT_EXCEPTION_V1 marker が1件だけ存在する」ことを AC1 にしていますが、現行 policy:check はローカルの secret-policy.md と session-recording-policy.md の構造検査だけです。GitHub Issue comment を読まず、marker の一意性も検査しません。

    修正案: decision marker の正本をどちらかに固定してください。GitHub comment を正本にするなら、gh api 等で #1153 comments を取得し、marker が1件だけで enum / required fields / digest が妥当なことを検査する専用 checker が必要です。ローカルdocsを正本にするなら、docs/dev/session-recording-policy.md に marker YAML を置き、#1153 comment は decision_ref に落とすべきです。

    2. runtime gate が package script に正しく配線されていない

    現行 security:session-recording は policy / manifest / smoke / secret scan で、check_session_recording_runtime_safety.py --json を呼びません。別scriptとして security:session-recording:fixture と :host はありますが、fixture側は --fixture-root tests/fixtures/session-recording-runtime-safety を渡していません。

    checker 側も --fixture-root がある場合だけ fixture root と home root を明示的に分離します。現状の security:session-recording:fixture は deterministic fixture check ではなく、repo root 寄りの曖昧な実行になります。

    修正案:

    "security:session-recording:fixture": "uv run python3 .claude/scripts/check_session_recording_runtime_safety.py --json --execution-profile fixture --fixture-root tests/fixtures/session-recording-runtime-safety",
    "security:session-recording:runtime": "pnpm run security:session-recording:fixture",
    "security:session-recording": "pnpm run policy:check && pnpm run manifest:check && pnpm run security:session-recording:runtime && pnpm run session-recording:smoke && pnpm run secret-exposure:scan:clean && pnpm run secret-exposure:scan:production"

    security:session-recording:host はローカルpreflight専用に残し、CI required gate には入れない方が安全です。host mode は SRRS_* override を reject する設計なので、実環境の activation 前確認に使うべきです。

    3. Latitude 配布物の pin / integrity / provenance gate が現実装では不足

    Latitude 公式手順は npx -y @latitude-data/claude-code-telemetry install と unpinned npx を案内し、manual Stop hook でも npx -y @latitude-data/claude-code-telemetry を使います。さらに manual hook は async: true です。([docs.latitude.so]1)

    npm の npx は、指定packageがlocal project dependenciesに無ければ npm cache にinstallして実行し、version指定なしのpackage名はlocal dependencyのversionに一致させる仕様です。つまり unpinned npx は再現性・実行物同一性の証明に不向きです。([npmドキュメント]2)

    現行 checker の host distribution check は global npm list -g を見るだけで、npx がその場で解決した実行物、npm cache、lockfile、tarball digest、entrypoint digest、preload digest を証明しません。dist_integrity / provenance_verified も実証ではなく None / unknown へ落ちます。

    修正案: approve_timeboxed_real_pilot では、最低限以下が全部揃わない限り blocked_until_activation にしてください。

    distribution:
      package_spec: "@latitude-data/claude-code-telemetry@<exact-version>"
      lockfile_digest: "sha256:..."
      npm_registry_signature_verified: true
      npm_provenance_verified: true
      tarball_sha256: "sha256:..."
      installed_entrypoint_sha256: "sha256:..."
      preload_sha256: "sha256:..."
      hook_command_sha256: "sha256:..."
      resolution_source: local_lockfile

    npm audit signatures は npm provenance / registry signature の検証コマンドとして公式に案内されていますが、provenance は「どこで・どうbuildされたか」の検証リンクであり、悪意あるコードが無いこと自体の保証ではありません。したがって provenance verified だけで allow にしてはいけません。([npmドキュメント]3) ([npmドキュメント]3)

    4. --api-key argv 利用の過去可能性を現行checkerでは証明できない

    Latitude 公式docsは installer argument として --api-key=lat_xxx を例示しています。これは shell history / process argv / audit log に残る可能性があります。([docs.latitude.so]1)

    現行 check_argv_credential は /proc/self/cmdline、つまり checker自身の argv だけを見ています。過去に installer へ real key を渡したか、別processに残ったか、shell historyに残ったかは証明できません。

    修正案: #1220 AC8 は「argv key 不使用を機械証明する」ではなく、次に分けるべきです。

    argv_exposure_state: absent_verified | possible | unknown
    credential_rotation_state: not_required | required | completed_attested

    possible または unknown なら real pilot activation は拒否し、rotation 完了まで blocked にする。shell history の自動scanは禁止のままでよいです。

    5. async hook を activation gate にしてはいけない

    Claude Code hooks は matching した全hookが並列実行されます。plugin / skill / agent frontmatter / managed settings など複数surfaceもあります。([Claude]4) ([Claude]4)

    また Claude Code の async hook は block / approve / deny できず、操作完了後に非同期で走るだけです。hook command はユーザー権限で実行されるため、hook exit 0 を安全境界や trace 到達証明として扱うのは不適切です。([Claude]4)

    修正案: #1220 の activation gate は Stop hook ではなく、session開始前の host verifier を正本にするべきです。hook は evidence producer ではなく diagnostic layer と明記してください。

    High

    LATITUDE_BASE_URL / LATITUDE_DEBUG の検査surfaceが弱いです。現行 check_destination_transport は host mode で current shell environment の LATITUDE_BASE_URL と LATITUDE_DEBUG を見る設計ですが、Claude settings / managed policy / systemd user environment / environment.d / shell startup file に設定された値まで同じ粒度で検査していません。

    #1220 は non-HTTPS / unknown destination / LATITUDE_DEBUG=1 を拒否条件にしています。ならば BUN_OPTIONS と同様に、LATITUDE_BASE_URL、LATITUDE_DEBUG、LATITUDE_API_KEY、LATITUDE_PROJECT を全 logical surface で presence scan する必要があります。Latitude docsでも full-fidelity telemetry は prompts / responses / tool input/output / system context を含み、sensitive material 前は無効化が必要と説明されています。([docs.latitude.so]1)

    実装前に #1220 へ追記すべき要点

    LATITUDE_PILOT_EXCEPTION_V1:
      decision: reject_and_uninstall | approve_synthetic_only | approve_timeboxed_real_pilot | defer
      decision_source:
        canonical_surface: github_issue_comment | repo_policy_yaml
        parent_issue: "#1153"
        comment_id: required_if_github_issue_comment
        source_digest: required
    
      activation_gate:
        pre_activation_command: "pnpm security:session-recording:host"
        fixture_command: "pnpm security:session-recording:fixture"
        pre_activation_expected: deny | blocked_until_activation
        activation_expected: allow
        host_json_required: true
        raw_values_emitted_required: false
    
      real_pilot_required_if_approved:
        activation_window: required
        max_eligible_runs: required
        allowed_issue_labels: required
        rollback_deadline: required
        stop_thresholds: required
        distribution_exact_version: required
        npm_audit_signatures_verified: required
        argv_exposure_state: absent_verified
        credential_rotation_state: not_required | completed_attested
        remote_cleanup_state: machine_verified | human_attested | unknown_blocking

    特に remote_trace_state は現行実装でも default unknown です。provider-side retention / delete verification が機械検証不能なら PASS にせず、risk acceptance を明示するか、activation を拒否すべきです。

    貼り付け用レビューコメント案

    ## 判定
    
    REQUEST_CHANGES。#1220 の方向性は妥当だが、現契約のまま `approve_timeboxed_real_pilot` を実装すると false green になる。
    
    ### Blockers
    
    1. AC1 の `LATITUDE_PILOT_EXCEPTION_V1` marker 一意性は `pnpm policy:check` では証明できない。現行 checker は local docs の構造検査だけで、#1153 comments を読まない。GitHub comment を正本にするなら専用 marker verifier が必要。repo docs を正本にするなら marker YAML を docs 側へ置き、#1153 comment は decision_ref にすること。
    
    2. `security:session-recording` が runtime checker を呼んでいない。`security:session-recording:fixture` も `--fixture-root tests/fixtures/session-recording-runtime-safety` を渡していないため deterministic fixture gate になっていない。
    
    3. Latitude 公式手順は unpinned `npx -y @latitude-data/claude-code-telemetry` と `--api-key=...` を含む。real pilot 承認時は exact package version、lockfile digest、npm audit signatures、tarball / entrypoint / preload / hook command digest が必須。現行 host distribution check は global npm list 程度で、npx 実行物を証明できない。
    
    4. argv exposure の過去可能性を `/proc/self/cmdline` だけでは証明できない。`argv_exposure_state: possible | unknown` は rotation required とし、完了まで activation blocked にすること。
    
    5. Latitude Stop hook は async であり、Claude hooks は parallel 実行される。hook exit 0 を activation gate や trace 到達証明にしてはならない。session開始前の host verifier JSON を正本にすること。
    
    結論: 現時点の安全な decision は `defer` または `approve_synthetic_only`。`approve_timeboxed_real_pilot` は上記 blocker 解消後に限定する。

    手元で pnpm 実行はしていません。上記は GitHub connector で取得した Issue / PR / repo assets と、Latitude / Claude Code / npm 公式docsに基づくレビューです。

  3. squne121 commented on Jun 28, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  4. added a commit that references this issue on Jun 28, 2026
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/implementationprocessworkflow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions