Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1153"
goal_ref: "Latitude Claude Code telemetry の credential・export・preload capture・local payload・active process・uninstall state を既存 Secret Inventory / session recording Kill Switch に接続し、実開発 session 可否をsecret非出力でfail-closed判定する"
change_kind: mixedParent Issue
Parent Goal Ref
EntireCLI / Latitude のprivate observationをpublic-safeなagent_run_reportへ接続する前に、現在導入済みとされるLatitude credential・Stop hook・BUN_OPTIONS preload・systemd user environmentを安全境界へ収容する。
Dependencies
- docs: Secret Inventory と no-secret 運用境界の SSOT 化 (secret-policy.md) #241 — Secret Inventory SSOT
- docs: session 記録 Kill Switch policy と検証コマンド整備 (session-recording-policy.md) #242 — session recording Kill Switch policy
- 実装: session recording no-push / private checkpoint / local-only verifier を追加する #379 — no-push / private checkpoint runtime verifier
- 実装: session recording Kill Switch runtime smoke test と secret exposure scanner を追加する #380 — Kill Switch smoke / secret exposure scanner
本Issueは次をblockする。
- 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 Child Bのreal runtime capture
- 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 Child CのLatitude source acceptance
- 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 Child EのCloud pilot
- #246を利用したreal session pilot
Background
#1153は以下を導入済み状態として記載している。
- Latitude API keyをローカルClaude Code設定へ追加済み
- Latitude Stop hook導入済み
- preload導入済み
- systemd user environmentへBUN_OPTIONS導入済み
- trace到達、hook共存、uninstall postconditionは未検証
既存Secret Inventoryではagent_local_secretはapp_secretへmappingされる。
既存session recording policyではapp_secret時のsession recordingは不許可である。
また、LATITUDE_CLAUDE_CODE_ENABLED=0 はexport hookを停止するが、preload capture停止の証明にはならない。
本Issue完了までは実開発sessionを実行しない。
Immediate Safety State
pilot_state: BLOCKED
real_development_session_allowed: false
runtime_inventory_status: pending
policy_consistent: false
synthetic_fixture_test_allowed: true
read_only_host_inventory_allowed: true
real_prompt_allowed: false
real_trace_export_allowed: falseDecision Boundary
本IssueはLatitude telemetryを許可するpolicy exceptionを導入しない。
Latitude credentialを保持したままreal pilotを行う場合は、本Issue完了後に別Child Issueを起票し、人間Decisionを経て以下を定義する。
- credential category
- storage boundary
- captured processからのcredential分離方法
- rotation owner
- revoke手順
- provider-side retention/delete手順
- time-bounded pilot activation
- automatic rollback
- risk acceptance
承認Issueが存在しない場合、既存policyを維持し、real captureはBLOCKEDのままとする。
Outcome
以下が成立している状態。
- Secret Inventoryの記述とruntime stateが矛盾しない
- Latitudeのexport停止とcapture停止が別stateとして定義されている
- 既存runtime safety checkerがLatitude surfaceをsecret非出力で検査する
- partial uninstall、backup残留、active processへのpreload継承をfail closed検出する
- unpinned package/hook commandをblocked判定する
- Kill Switch後のpostconditionを機械検証できる
- unrelatedなClaude settings / hooksを破壊しない手順になっている
- 実API key、prompt、request body、local absolute pathをIssue・stdout・artifactへ出さない
Runtime Safety Result Contract
既存 .claude/scripts/check_session_recording_runtime_safety.py をcanonical entrypointとし、独立した第三のruntime checkerを増設しない。
--json 時は以下のschemaに従う。
schema: session_recording_runtime_safety/v2
decision: allow | deny
verdict: safe | blocked | fail_closed | not_applicable
inspection_complete: true | false
exit_code: 0 | 1 | 2
execution_profile: host | fixture
runtime_locus: linux | wsl | macos | windows_host | unknown
policy:
source: docs/dev/secret-policy.md
source_digest: sha256:<digest>
current_secrets_mode: none | publish_secret | app_secret | unknown
components:
entire:
applicability: applicable | not_applicable | unknown
verdict: safe | blocked | fail_closed | not_applicable
reason_codes: []
latitude:
applicability: applicable | not_applicable | unknown
verdict: safe | blocked | fail_closed | not_applicable
containment_state: never_observed | active | contained | unknown
credential_state: present | absent | unknown
export_state: enabled | disabled | unknown
capture_state: active | inactive | unknown
local_storage_state: absent | present | unsafe_metadata | unknown
active_process_state: preload_present | preload_absent | unknown
destination_state: approved_cloud | approved_self_host | unapproved | unknown
transport_state: https | plaintext | unknown
diagnostic_logging_state: disabled | enabled | unknown
exposure_state: none_observed | possible | confirmed | unknown
uninstall_state: complete | incomplete | not_attempted | unknown
remote_trace_state: absent_human_attested | present | unknown
distribution:
package_spec: string | null
dist_integrity: string | null
registry_signature_verified: true | false | null
provenance_verified: true | false | null
provenance_source_ref: string | null
tarball_sha256: string | null
installed_entrypoint_sha256: string | null
preload_sha256: string | null
resolution_source: local_lockfile | npm_cache | remote_fetch | unknown
reason_codes: []
checked_surfaces: []
raw_values_emitted: false
checked_at: ISO8601
checked_at: ISO8601Execution Profile
execution_profile: host:
SRRS_*環境変数による外部状態 override を拒否するdocs/dev/secret-policy.mdを canonical YAML として直接読み、source_digestを出力する- policy が読めない、複数 block がある、schema 不一致の場合は
fail_closed
execution_profile: fixture:
- 明示的な
--fixture-rootまたは--test-modeフラグがある場合にのみ許可する SRRS_*override は fixture mode でのみ有効
Sensitive Value Handling
credential value や environment 値の取り扱いを以下で固定する。
sensitive_value_handling:
human_visible: forbidden
stdout_or_stderr: forbidden
artifact_or_snapshot: forbidden
logging_or_hashing: forbidden
equality_comparison_against_known_secret: forbidden
bounded_in_memory_presence_scan: allowed
persistence_after_scan: forbiddensubprocess の raw stderr をそのまま転送しない。--json 時は stdout を単一 JSON object のみとする。
Global Aggregation Truth Table
コンポーネント verdict から top-level verdict を次の優先順位で決定する。
1. 既知 blocker ≥ 1 → verdict=blocked, exit=1
2. unknown ≥ 1, 既知 blocker=0 → verdict=fail_closed, exit=2
3. 全 applicable コンポーネント safe → verdict=safe, exit=0
4. 全コンポーネント not_applicable → verdict=not_applicable, exit=0
blocked と fail_closed が同時の場合は blocked を優先し、inspection_complete=false を残す。
Verdict Rules
not_applicable:
- Latitude credential、hook、preload、state、backup、active process indicator がすべて存在しない
- unknown surface がない
safe:
- 現行 policy 上
current_secrets_mode == none - credential field が存在しない
- Latitude Stop hook が存在しない
- BUN_OPTIONS preload が settings / systemd / environment.d / launchctl / active process に存在しない
- local_storage_state が absent
- settings backup に Latitude credential field が存在しない
- unknown surface がない
containment_stateがnever_observedかつexposure_state: none_observedかつ rotation/delete が不要
blocked:
- 危険な既知状態を 1 件以上検出した
- credential present
- hook present
- preload configured
- active process が preload を継承
- export disabled かつ capture active
- local_storage_state が present または unsafe_metadata
- backup に credential field present
- distribution unpinned または integrity/provenance 不明
- uninstall incomplete
- policy mode mismatch
- destination_state が unapproved
- transport_state が plaintext または unknown
- diagnostic_logging_state が enabled
- exposure_state が possible または confirmed
- containment_state が active
fail_closed:
- 対象 surface を安全に検査できない
- settings parse error / permission error
- process environment inspection unavailable
- systemd / launchctl state が判定不能
- package version/integrity 不明
- runtime_locus: unknown(WSL2 から Windows host が検査不能な場合)
- policy YAML が読めない / schema 不一致
- runtime state と policy state の対応が不明
Reason Codes
最低限、以下を固定する。
reason_codes:
- latitude_credential_present
- latitude_policy_mode_mismatch
- latitude_stop_hook_present
- latitude_preload_configured
- latitude_preload_active_process
- latitude_export_disabled_capture_active
- latitude_local_storage_present
- latitude_local_storage_unsafe_metadata
- latitude_settings_backup_contains_credential_field
- latitude_uninstall_incomplete
- latitude_runtime_state_unknown
- latitude_distribution_unpinned
- latitude_distribution_provenance_unknown
- latitude_remote_trace_state_unknown
- latitude_destination_unapproved
- latitude_transport_plaintext_or_unknown
- latitude_diagnostic_logging_enabled
- latitude_exposure_possible_or_confirmed
- latitude_windows_host_not_inspected
- latitude_srrs_override_rejectedChecked Surfaces
値や絶対 path ではなく、以下の logical surface 名だけを出力する。
checked_surfaces:
- claude_user_settings
- claude_project_settings
- claude_local_settings
- managed_claude_settings
- enabled_plugin_hooks
- active_skill_agent_hooks
- latitude_settings_backup
- latitude_stop_hook
- settings_bun_options
- shell_startup_environment
- systemd_user_environment
- systemd_environment_generators
- environment_d_dropin
- launchctl_environment
- launch_agent_plist
- current_shell_environment
- process_parent_environment
- latitude_intercept_preload
- latitude_request_spool
- latitude_state
- active_claude_processes
- package_distributionWSL2 から Windows host(Desktop / IDE extension host / Windows process environment)が検査不能な場合は runtime_locus: unknown として fail_closed にする。
In Scope
-
docs/dev/secret-policy.md- 現在の credential state との整合
- Latitude API key の agent_local_secret 分類
- storage / rotation owner / revoke 条件
- false
current_secrets_mode: noneの禁止
-
docs/dev/session-recording-policy.md- export pause / capture pause / uninstall / credential revoke の分離
- preload active 時の Kill Switch 判定
- real session start gate
- partial uninstall 時の fail-closed
-
runtime checker
execution_profile: hostでSRRS_*override を拒否するdocs/dev/secret-policy.mdを canonical YAML として直接読みsource_digestを出力するsensitive_value_handling規則を適用し credential value / full environment を emit しない- request spool / state は存在判定のみ行い本文を読まない
- process environment は対象 key の存在判定のみ行い全 env を出力しない
- WSL2/Linux の systemd user environment / environment.d を検査する
- macOS launchctl / plist は fixture で検査する
- active Claude process に継承された BUN_OPTIONS を検査する
- managed policy / plugin hook / skill / agent frontmatter で定義された Latitude hook を検査する
- shell startup file(
.bashrc/.profile/.zshrc等)の BUN_OPTIONS 設定を検査する - systemd environment generator の BUN_OPTIONS 設定を検査する
-
uninstall verification
-
official uninstall 実行結果を信用せず postcondition を再検査する
-
quiescent な二段階 postcondition を必須にする:
- 新規起動経路の BUN_OPTIONS / hook を停止
- Claude CLI / Desktop / IDE extension host / 関連 Bun process を停止
- active process inheritance を再検査
- settings / backup / state / spool / preload を検査・除去
- 静止後に 2 回目の read-only scan
- 2 回の結果が同一かつ対象 process が存在しない場合のみ
contained
-
latitude_state/ request spool の lstat(owner / mode / symlink / non-regular file)を検査する -
settings backup の credential field 残留を検査する
-
unrelated hook / setting を保持する
-
file deletion を secure erase と表現しない
-
漏洩可能性がある場合は revoke / rotate を優先する
-
-
distribution verification
- exact version / integrity / preload digest
- unpinned
npxcommand 検出 - npm registry signature / provenance 検証(
npm audit signatures) provenance_source_refを distribution evidence へ記録するLATITUDE_BASE_URLが未承認 origin / 非 HTTPS / parse 不能の場合はblockedLATITUDE_DEBUG=1は real session ではblocked対象
-
credential argv policy
- real key を argv へ渡すことを禁止
- 過去に argv 利用の可能性がある場合は
exposure_state: possible - shell history を自動収集しない
- rotation 完了まで real session を再開しない
-
fixtures / negative controls
-
package script / composite security gate 統合
security:session-recording:fixture— deterministic fixture checkssecurity:session-recording:host—--execution-profile host --jsonによる live checksecurity:session-recording— fixture checks only(generic CI 向け)
-
parent 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 への BLOCKED 状態と closure evidence 記録
Out of Scope
- 実 API key を使用した test
- 実開発 prompt の実行
- Latitude Cloud への trace 送信
- provider-side trace 削除操作
- API key の revoke / rotate 操作そのもの
- Latitude 利用を許可する policy exception
- EntireCLI checker の仕様変更
- private source から agent_run_report への adapter
- ChatGPT marker
- self-host 構築
- Latitude package の fork
- Windows host からの直接検査(WSL2 からは不可;
runtime_locus: unknown→fail_closedとする)
Current Validated Scope
本 Issue 着手時点で確認済みの前提状態:
docs/dev/secret-policy.mdが存在し、current_secrets_mode: none、agent_local_secret_present: falseを記載しているdocs/dev/session-recording-policy.mdが存在する(Latitude 固有 state は未定義).claude/scripts/check_session_recording_runtime_safety.pyが存在する(Latitude component は未実装)- Latitude API key がローカル Claude Code 設定へ追加済みという 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の記述を採用する
- Latitude Stop hook・preload・systemd user environment は導入済みとされるが、runtime state は未検証
Remaining Parent Gaps
(本 Issue 完了後、以下は #1153 の責務に戻す)
- Latitude real pilot 可否の人間 Decision(Child A1 の責務)
- 3 agent surface の capability 確定(Child B の責務)
- private source → public-safe adapter(Child C0/C1 の責務)
Acceptance Criteria
- AC0: 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 に
pilot_state: BLOCKED、real_development_session_allowed: falseが記録されている - AC1: Secret Inventory の
current_secrets_mode、agent_local_secret_present、本文の Latitude credential 記述が機械的に矛盾しない - AC2: session recording policy が export 停止と capture 停止を別 state として定義している
- AC3:
session_recording_runtime_safety/v2が Latitude component を出力する - AC4: settings / hook / BUN_OPTIONS / systemd / environment.d / launchctl / preload / request spool / backup / active process の各 surface を検査する
- AC5:
LATITUDE_CLAUDE_CODE_ENABLED=0かつ preload active fixture がlatitude_export_disabled_capture_activeで blocked になる - AC6: Stop hook 削除済みでも active process が preload を継承している fixture が blocked になる
- AC7: official uninstall 後に backup へ credential field が残る fixture が blocked になる
- AC8: uninstall 途中失敗 fixture が
latitude_uninstall_incompleteになる - AC9: unversioned / integrity 不明の hook command が
latitude_distribution_unpinnedになる - AC10: credential value、request body、prompt、tool I/O、full environment、local absolute path を stdout / JSON / test snapshot へ出さない
- AC11: UUID 形式等、prefix を仮定できない credential value でも、
LATITUDE_API_KEYfield の存在を構造的に検出する - AC12: unrelated な Claude hooks / env / permissions を fixture 上で保持する
- AC13: checker を 2 回実行して同一結果となり、host state を変更しない
- AC14:
security:session-recordingが Latitude runtime check を含む - AC15: WSL2/Linux 上で read-only live inventory を実行し、secret 非出力の machine-readable verdict を取得する
- AC16: remote trace state が確認不能な場合、PASS でなく
unknownと人間 escalation を記録する - AC17: real pilot 再開には別 Issue の人間 Decision が必要であることが parent へ記録されている
- AC18: top-level verdict が global aggregation truth table に従い、
entirecomponent が blocked でもlatitudecomponent がsafe/not_applicableであることを個別に記録する - AC19:
execution_profile: hostでSRRS_*環境変数 override を渡した場合に rejected としてfail_closedを返す - AC20:
sensitive_value_handling規則を適用し、subprocess raw stderr を転送せず stdout が単一 JSON object である - AC21: managed policy / plugin hook / skill / agent frontmatter の Latitude hook 有無を検査し、不明な場合は
fail_closedを返す - AC22:
latitude_state/ request spool の lstat(owner / mode / symlink / non-regular file)を検査し、unsafe metadata で blocked になる - AC23:
LATITUDE_BASE_URLが未承認 origin または非 HTTPS の fixture がlatitude_destination_unapprovedで blocked になる - AC24:
LATITUDE_DEBUG=1fixture がlatitude_diagnostic_logging_enabledで blocked になる - AC25: quiescent 二段階 postcondition を fixture で検証し、1 回目と 2 回目の scan 結果が同一で対象 process が存在しないことを確認する
- AC26: npm registry signature / provenance が検証できない fixture が
latitude_distribution_provenance_unknownで blocked になる - AC27:
containment_stateがnever_observed以外の場合、safeを返さずblockedまたはfail_closedを返す - AC28: real API key を argv で渡すことを禁止し、argv に credential が含まれる fixture が
exposure_state: possibleで blocked になる - AC29: fixture path
tests/fixtures/session-recording-runtime-safety/**が利用可能で、security:session-recording:fixture/:hostスクリプトが分離されている
Verification Commands
$ pnpm typecheck
# AC1
$ pnpm lint
# AC10
# preflight-scope: pr_review_only
$ pnpm test
# AC3
# AC4
# AC5
# AC6
# AC7
# AC8
# AC9
# AC11
# AC12
# AC13
# AC14
# AC18
# AC19
# AC20
# AC21
# AC22
# AC23
# AC24
# AC25
# AC26
# AC27
# AC28
# AC29
$ pnpm build
# AC14
# baseline-expect: pass
$ test -f .claude/scripts/check_session_recording_runtime_safety.py
# AC3
# baseline-expect: pass
$ test -f tests/session_recording_runtime_safety.test.ts
# AC29
# preflight-scope: runtime_only
$ uv run python3 .claude/scripts/check_session_recording_runtime_safety.py --json --execution-profile fixture --fixture-root tests/fixtures/session-recording-runtime-safety
# AC15
# AC16
# AC17
# preflight-scope: pr_review_only
$ pnpm policy:check
# AC0
# AC1
# AC2
# preflight-scope: pr_review_only
$ pnpm secret-exposure:scan:clean
# AC10
# preflight-scope: pr_review_only
$ pnpm session-recording:smoke
# AC14
# preflight-scope: pr_review_only
$ pnpm security:session-recording:fixture
# AC29
# preflight-scope: pr_review_only
$ pnpm security:session-recording:host
# AC15live runtime では secret 値や full environment を表示するコマンドを使用しない。
Allowed Paths
docs/dev/secret-policy.mddocs/dev/session-recording-policy.mddocs/dev/onboarding/session-recording-tool.md.claude/scripts/check_secret_policy.py.claude/scripts/check_session_recording_policy.py.claude/scripts/check_session_recording_runtime_safety.py.claude/scripts/secret_exposure_scanner.pytests/session_recording_runtime_safety.test.tstests/fixtures/session-recording/**tests/fixtures/session-recording-runtime-safety/**package.json
新規 module が必要な場合は以下だけを Scope Delta 候補とする。
.claude/scripts/lib/latitude_telemetry_safety.py.claude/scripts/lib/__init__.py
Runtime Verification Applicability
decision: immediate
applicable_acs:
- AC3
- AC4
- AC5
- AC6
- AC7
- AC8
- AC9
- AC13
- AC15
- AC18
- AC19
- AC20
- AC21
- AC22
- AC23
- AC24
- AC25
- AC26
- AC27
execution_environment: WSL2/Linux
skip_conditions:
- runtime_locus is not linux or wsl
- execution_profile is fixture
fallback_policy: fail_closed
artifact_requirements:
- runtime_safety_checker_output_json
primary_environment: WSL2/Linux
allowed_live_operations:
- read_only_settings_structure_check
- exact_environment_key_presence_check
- process_preload_presence_check
- local_state_presence_check
- package_version_and_integrity_check
forbidden_live_operations:
- real_prompt_execution
- trace_upload
- credential_value_output
- request_body_read
- full_environment_dump
- automatic_settings_mutation
macos:
decision: fixture_required
reason: "primary runtime が WSL2/Linux のため、launchctl/plist は fixture 検証する"
windows_host:
decision: not_applicable
reason: "WSL2 から Windows host を直接検査できないため fail_closed とし、Out of Scope に含める"Stop Conditions
- credential value を読む、表示する、hash 化する必要が生じた場合
- request spool 本文を読む必要が生じた場合
- full environment dump が必要になった場合
- unrelated な Claude 設定を置換する必要が生じた場合
- active process の preload 有無を安全に検証できない場合
- unpinned package しか実行できない場合
- runtime checker 間で verdict または reason semantics が競合した場合
- policy exception なしに real telemetry を有効化しようとした場合
- remote trace 存在が疑われる場合は削除完了を自己判定せず、人間へ escalate する
- raw payload または credential が public surface へ出た場合は即時停止し、revoke / rotate を優先する
- Allowed Paths 外の変更が必要になった場合
Required Skills
- Python
- fail-closed runtime verification
- Secret Inventory / Kill Switch policy
- Claude Code hook configuration
- systemd user environment
- npm registry / provenance verification
- secure fixture design
Open Questions
remote_trace_stateの確認は人間 attestation のみとするか、または機械的な確認手順を定義するか(absent_human_attestedの扱いはcontainment_stateで代替可能か)
Next Action
- issue-contract-review を実施し go を取得する
- impl-review-loop を起動する
Artifact Refs
- OWNER REQUEST_CHANGES: 実装: security(latitude): telemetry credential / preload capture を封じ込め、Secret Inventory / Kill Switch を fail-closed 化する #1157 (comment)
Handoff Prompt Draft
#1157 を実装してください。
Latitude telemetry の credential / export / capture / preload / uninstall state を
既存 check_session_recording_runtime_safety.py に latitude component として追加し、
secret 非出力・fail-closed の runtime safety checker を構築します。
execution_profile: host/fixture、global aggregation truth table、
sensitive_value_handling、quiescent 二段階 postcondition、
npm provenance 検証を含む v2 contract に従ってください。
Issue contract を正本として扱い、Allowed Paths 内のみ変更してください。
Delivery Rule
- 1 Issue = 1 PR
- Draft PR を既定とする
- 実開発 session は実行しない
- worker 自己申告を authoritative runtime evidence にしない
- live verification 結果は checker 出力と validation exit code で記録する
Closure Evidence
本 Issue コメントへ、次の public-safe marker を 1 件記録する。
{
"schema": "latitude_telemetry_safety/v1",
"verdict": "blocked",
"reason_codes": [],
"raw_values_emitted": false,
"checked_surfaces": [],
"runtime_environment": "wsl2_linux",
"policy_consistent": true,
"real_development_session_allowed": false,
"follow_up_decision_required": true
}marker は credential value、project slug、local path、request count、request body を含めない。
Activity
squne121 commentedon Jun 25, 2026
判定
REQUEST_CHANGES。Issue契約を修正してから実装着手すべきです。
#1157は、親Issue #1153のレビューで指摘された「export停止とcapture停止の分離」「backup・active process・partial uninstallの検査」「未固定配布物の拒否」を適切に引き継いでいます。一方、現状の契約では、checkerが正常に実装されても偽陽性、偽陰性、または永続的な
fail_closedになり得ます。特に、既存checkerとの統合規則、検査不能なsurface、local payloadの定義、送信先検証が不足しています。Blocker 1: top-level verdictの集約規則が定義されていない
既存checkerは全EntireCLI系checkを無条件実行し、公開originをcheckpoint remoteのfallbackとして扱います。このため、EntireCLIを使用していなくても公開repoではFAILになります。PR #474の実runtime evidenceでも、公開originを理由に
public_push_remote_detectedとpublic_checkpoint_branch_presentが発生しています。現行実装は、既知のFAILが1件でもあればFAIL-CLOSEDよりFAILを優先します。したがって、Latitude componentが
safeまたはnot_applicableでも、top-levelは常にEntire component由来でblockedになり得ます。#1157は「EntireCLI checker仕様変更」をOut of Scopeにしていますが、同じcanonical checkerへcomponentを追加する以上、少なくとも次が必要です。applicability: applicable | not_applicable | unknownblockedとfail_closedが同時発生した場合の優先順位inspection_complete: boolean--jsonへ全面移行するか推奨集約は次です。
既知blockerとunknownが併存する場合は、
verdict=blockedにしつつinspection_complete=falseを残すのが、既存exit contractとの後方互換性を保ちやすい設計です。Blocker 2: live checkerをfixture用環境変数で偽装できる
現行checkerでは
SRRS_SECRETS_MODEが未設定ならPASSです。また既存testは、SRRS_GH_VISIBILITY、SRRS_GIT_CONFIG_OUTPUT、SRRS_CHECKPOINT_TOKENなどの環境変数で外部状態を全面的にmockしています。これらのoverrideはlive実行経路にも存在するため、誤設定または意図的な環境変数注入で安全判定を偽装できます。#1157では次を固定すべきです。
execution_profile: host | fixturehostでは全SRRS_*overrideを拒否するfixtureは明示的な--fixture-rootまたは--test-modeがある場合だけ許可するdocs/dev/secret-policy.mdのcanonical YAMLを直接読み、source digestを出力するfail_closed特に「ローカルにLatitude keyが存在する」という親Issueの前提と、Secret Inventoryの
current_secrets_mode: noneが矛盾する状態は、環境変数次第でPASSしてはなりません。Blocker 3: 「値を読まない」と「検査する」が技術的に矛盾している
#1157はcredential valueやfull environmentを読まないことを要求しつつ、JSON settingsのfield存在、systemd user environment、active process environmentを検査対象にしています。
systemdの公式interfaceである
systemctl show-environmentは、特定keyだけを取得するcommandではなく、managerのenvironment block全体をdumpします。したがって「systemd managerにBUN_OPTIONSが存在するかを検査するが、full environmentは読み込まない」という契約は、そのままでは実装不能です。 ([man7.org]1)禁止事項は次のように再定義すべきです。
また、subprocessのraw stderrをそのまま転送しないこと、stdoutは
--json時に単一JSON objectだけとすることをAcceptance Criteriaへ追加すべきです。Blocker 4: Claude CodeとBUN_OPTIONSの実surfaceを網羅していない
Claude Codeのhookは、user/project/local settingsだけでなく、managed policy、plugin、skill、agent frontmatterにも定義できます。さらに、全matching hookは並列実行され、Latitudeの
async: truehookはClaudeの動作をblockできません。 ([Claude Code]2) ([Claude Code]2) ([Claude Code]2)Latitude側も、Linuxではsystemd user environmentを利用し、手動構成ではshell startup fileへ
BUN_OPTIONSを設定する運用を案内しています。現在の#1157のchecked surfacesだけでは、shell rc、environment generator、managed/plugin hookなどの残留を見逃します。追加が必要なlogical surfaceは少なくとも次です。
WSL2からWindows側Claude Desktop、VS Code extension host、Windows側process environmentを検査できない場合は、
runtime_locus: unknownとしてfail_closedにすべきです。単に「primary environmentがWSL2/Linux」でWindows hostを検査対象外にすると、最も重要なDesktop/IDE surfaceがblind spotになります。Blocker 5:
latitude_stateをmetadataとみなせないpreloadのrequest spoolには、system prompt、messages、tool definitionsなどを含むrequest bodyが保存されます。さらに
state.jsonはoffsetやturn countだけでなく、buffer: stringを永続化します。したがって、latitude_stateにもpartial transcript contentが含まれ得ます。A0のcontainment checkerでは、内容を解析して「無害なstateか」を判定すべきではありません。次の保守的規則が適切です。
blockedstate.jsonが存在すればblockedlstatを用い、owner、mode、symlink、非regular fileを検査するblockedまたはfail_closed上流実装はstate/request directoryとfileの作成時に明示的なrestrictive modeを指定していないため、実際のpermissionをumask任せとせず検査対象に含めるべきです。
Blocker 6: export先とtransportの検証が欠落している
Latitudeの
LATITUDE_BASE_URLは任意文字列を受け入れ、hookはそのURLへBearer API keyとOTLP payloadを送信します。現在の#1157は「export enabled/disabled」は扱いますが、「どこへ送るか」を扱っていません。以下を追加すべきです。
LATITUDE_BASE_URLが未承認origin、非HTTPS、parse不能の場合はblockedです。LATITUDE_DEBUG=1も、上流実装がsession ID、transcript path、project、送信URL等をstderrへ出力し得るため、実sessionではblocked対象にすべきです。またLatitudeのcustom redactionは「content gateの後、OTLP exportの前」に行われます。preloadが保存するraw request spoolの安全性を証明するものではないため、redaction有効を
capture_state: inactiveの根拠にしてはなりません。 ([Latitude Docs]3)Blocker 7: uninstall検証にquiescence条件がない
上流uninstallは、個別stepの失敗をcatchして後続処理を継続し、最終的に完了表示し得ます。設定backupは保持され、既存processに継承済みの
BUN_OPTIONSはClaudeやterminalを再起動するまで残り得ます。この状態でsettingsとspoolを1回確認するだけではTOCTOUがあります。preload済みprocessが検査後にrequest fileを再作成できるためです。
postconditionは次の順序を固定すべきです。
containeduninstall_stateは「uninstall commandを実行したか」ではなく、このpostconditionだけから導出すべきです。Blocker 8: 配布物検証がversion/integrityだけでは不足する
公式手順と上流default hookはいずれもversionなしの
npx -y @latitude-data/claude-code-telemetryです。現在の上流manifestは0.0.9ですが、unversioned commandはlocal dependency、npm cache、remote fetchのいずれも実行し得ます。 ([npmドキュメント]4) ([Latitude Docs]3)上流publish workflowはnpm provenance付きでpublishしています。これは利用すべきですが、npm自身もprovenanceはsource/buildとのlinkを証明するだけで、悪意あるcodeがないことまでは保証しないと明記しています。検証commandとして
npm audit signaturesも案内されています。 ([npmドキュメント]5)distribution contractは次まで拡張すべきです。
このIssueが「完全除去のみ」を目的とするなら、distributionは検出用であり、absent後は
not_applicableになると明記すべきです。Latitudeを残したままpinningする可能性を含めるなら、lockfile、wrapper、package installation pathをAllowed Pathsへ加える必要があります。High 1:
safeとnot_applicableが重複し、remote traceを無視している現在の定義では、Latitude関連surfaceがすべて不存在でunknownなしの場合、
not_applicableの条件を満たします。同時にcurrent_secrets_mode == noneならsafe条件も満たします。さらにsafe条件にremote_trace_stateが含まれていません。absent_human_attestedもmachine-verifiable evidenceではありません。次の分離が必要です。過去にcredential、preload、spool、exportのいずれかが存在した可能性があるなら、local postconditionがcleanでも
safeではなくcontained相当として扱い、rotation/deleteがOut of Scopeならparentのreal pilotはBLOCKEDのままにすべきです。High 2: credentialをCLI argumentへ渡す公式手順への対処がない
公式docsは
--api-key=...をinstaller argumentとして渡す例を掲載しています。これはshell historyやprocess argvに残る可能性があります。 ([Latitude Docs]3)shell history全体を自動scanすると無関係なsecretまで読む危険があるため、checkerでhistoryを読むべきではありません。代わりに次をpolicy化すべきです。
exposure_state: possibleHigh 3: fixture pathとsecurity gate契約が現行repoと一致しない
既存testのcanonical fixture pathは
tests/fixtures/session-recording-runtime-safety/**ですが、#1157のAllowed Pathsはtests/fixtures/session-recording/**だけです。既存testは行指向outputとexit 0/1/2も前提にしています。また現在の
security:session-recordingはpolicy、manifest、fixture smoke、scannerを実行しますが、live runtime checkerを直接実行していません。最低限、次を追加してください。
そしてscriptを分離するのが妥当です。
{ "security:session-recording:fixture": "... deterministic fixture checks ...", "security:session-recording:host": "... --execution-profile host --json ...", "security:session-recording": "... fixture checks only ..." }generic CIでhost inspectionを実行すると、systemd user bus、active process、launchctl等が検査不能となり、CIが恒常的に
fail_closedになるためです。推奨するv2 contractの骨格
承認条件
次の修正が入れば、A0として実装可能な契約になります。
SRRS_*overrideを拒否し、Secret Inventory SSOTを直接参照する。safeを返さない。現状の#1157は安全側の意図は正しいものの、判定器そのものの適用性と検査境界が未確定です。このまま実装すると「常にBLOCKED」か「未検査surfaceをsafeと誤認」のどちらかになりやすいため、Issue本文の契約修正を先行させるべきです。
squne121 commentedon Jun 25, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jun 25, 2026
Issue Contract Review: go
status: go
issue: #1157
source: all_checks_pass
VC Preflight 集約
pnpm typecheckpnpm lintpnpm testpnpm buildtest -f .claude/scripts/check_session_recording_runtime_safety.pytest -f tests/session_recording_runtime_safety.test.tsuv run python3 check_session_recording_runtime_safety.py ...pnpm policy:check他 5 件Worktree / Branch
```
branch: worktree-issue-1157-latitude-telemetry-safety
```
Handoff
implement-issue または impl-review-loop を起動してください。
```
issue: 1157
contract_snapshot_url: (this comment)
```
[-]security(latitude): telemetry credential / preload capture を封じ込め、Secret Inventory / Kill Switch を fail-closed 化する[/-][+]実装: security(latitude): telemetry credential / preload capture を封じ込め、Secret Inventory / Kill Switch を fail-closed 化する[/+]squne121 commentedon Jun 25, 2026
Contract Review Result
squne121 commentedon Jun 25, 2026
Issue Contract Review: go
status: go
issue: #1157
source: all_checks_pass
VC Preflight 集約
pnpm typecheckpnpm lintpnpm testpnpm buildtest -f .claude/scripts/check_session_recording_runtime_safety.pytest -f tests/session_recording_runtime_safety.test.tsuv run python3 check_session_recording_runtime_safety.py ...pnpm policy:check他 4 件Worktree / Branch
Handoff
implement-issue または impl-review-loop を起動してください。
Contract Review Result
fix(#1157): ruff F401 + test fixture accuracy
squne121 commentedon Jun 25, 2026
実装完了: PR #1162 #1162 — latitude telemetry safety fail-closed / 全 1098 テスト pass
squne121 commentedon Jun 25, 2026
Issue Contract Review: go
status: go
issue: #1157
source: all_checks_pass
VC Preflight 集約
pnpm typecheckpnpm lintpnpm testpnpm buildtest -f .claude/scripts/check_session_recording_runtime_safety.pytest -f tests/session_recording_runtime_safety.test.tsuv run python3 check_session_recording_runtime_safety.py ...pnpm policy:check他 4 件Allowed Paths 更新
.claude/scripts/lib/__init__.pyを Allowed Paths に追加(PR #1162allowed_paths_gate: fail_closed解消のため)。Worktree / Branch
Handoff
implement-issue または impl-review-loop を起動してください。
Contract Review Result
fix(#1157): 8 Blocker 修正 — fixture 隔離/B2-B8 全修正