Skip to content

refactor!: remove the generated protection of installed files - #265

Merged
furedea merged 1 commit into
mainfrom
refactor/remove-protection-inventory
Nov 27, 2026
Merged

furedea merged 1 commit into
mainfrom
refactor/remove-protection-inventory

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

概要

  • インストールしたファイルの一覧から保護パスを導出する仕組み(generation/protection,ADR-0008)を削除した.
    • Claude:インストールしたファイルへの Edit(...) の拒否と sandbox.filesystem.denyWrite の追加をやめた.denyWrite はソースの値をそのまま出す.
    • Codex:[permissions.guarded.filesystem] へのインストールしたファイルの "read" エントリをやめた.秘密パスポリシーの "none" エントリと glob_scan_max_depth は引き続き生成する(generation/guarded_filesystem に改名).
    • Antigravity(ADR-0031 の保護部分):インストールしたファイルと ~/.gemini/config,~/.gemini/antigravity-cli/settings.json への write_file(...) の拒否,read_file(/nix) と read_file(/run) の許可,/run 配下の秘密のマウントの read_file(...) の拒否,agentMode = "" と enableTerminalSandbox = true の固定をやめた.秘密パスとコマンド権限の変換,使えないパスルールの拒否は残した.
    • 実行時のフック向けの ~/.claude/hooks/rules/protected_paths.json を生成しなくなった.
  • 保護パスのためだけにあった install --dsh-profile,GenerationContext.dsh_profile,SyncTarget,InstalledLayout::generated_files_for などを削除した.Home Manager モジュールは --dsh-profile を渡さなくなった(dsh.profile オプションは同期先として残る).
  • ADR-0008 を ADR-0032 で superseded,ADR-0031 を partly-superseded にして amended を追記した.README,DESIGN,構成図を更新した.

Refs #262(3 つの PR の 3 つ目.#263,#264 のマージ後に origin/main へ載せ替えた)

破壊的変更と利用側の移行

以下を利用側が先に用意しないと,アップグレードした時点で保護が黙って外れる.旧版が生成していた内容と,置き換えの方針(書き込みの許可リスト+ハーネスのルートごとの拒否,Issue の方針の更新 1)を併記する.

最優先:保護パスのポリシーを読むフック

  • 旧版は ~/.claude/hooks/rules/protected_paths.json({"version": 1, "paths": [...]})を書き,ソースのフック(agent-config の hooks/)が読んでいた.このファイルは次の install で消える(~/.claude/hooks/ は丸ごと置き換える管理ディレクトリ).
  • ADR-0008 のとおりフックがファイルの欠落で拒否側に倒れる実装なら,アップグレード後にすべての対象呼び出しが止まる.agent-config のフックからこのファイルを読む処理を先に外す.守りたいパスはフック自身の規則(たとえばハーネスのルート)で持つ.

agent-config(ソースの設定)に足すもの

旧版が拒否していた範囲は,次のハーネスのルートの中にすべて収まる:~/.claude,~/.codex,~/.devin,~/.config/devin/config.json,~/.hermes,~/.pi,~/.dsh,~/.gemini/config,~/.gemini/antigravity-cli/settings.json.プロジェクト内インストール(--runtime-root)では,これらは実行時ルートの下の絶対パスだった.スキル(skills/)は旧版も保護していなかった.

Claude(claude/settings.json):

  • permissions.deny:旧版はファイルごとに Edit(<path>) を足していた.置き換えはルートごとに 1 つ,たとえば Edit(~/.claude/**),Edit(~/.codex/**) など上の各ルート.Claude Code 自身が書く場所(~/.claude.json や ~/.claude/ 配下の状態)との兼ね合いは agent-config で確かめる.
  • sandbox.filesystem.denyWrite:旧版は同じパスを足していた.Claude の sandbox の書き込みは allowWrite と作業ディレクトリだけの許可リストなので,allowWrite が上のルートを含まない限り追加は不要.含む場合はそのルートを denyWrite に書く.

Codex(codex/config.toml):

  • 旧版は [permissions.guarded.filesystem] にインストールしたファイルごとに "<path>" = "read" を足していた(guarded プロファイルを使うときだけ効く).refactor!: remove the agent GitHub token #264 の移行で guarded を ":root" = "read" と作業ディレクトリ・一時領域・キャッシュだけの書き込みにすれば,ルートは書けない.書き込みを許すエントリがルートを覆うときは,"~/.codex" = "read" のようにルートを書く.

Antigravity(antigravity/settings.json):

  • "agentMode": "" と "enableTerminalSandbox": true(旧版はソースの値を上書きして固定していた)
  • permissions.allow:read_file(/nix),read_file(/run)
  • permissions.deny:read_file(/run/credentials),read_file(/run/secrets),read_file(/run/secrets.d),read_file(/run/secrets-for-users),read_file(/run/agenix),read_file(/run/agenix.d),read_file(/run/keys),read_file(/run/user),write_file(~/.gemini/config),write_file(~/.gemini/antigravity-cli/settings.json),および上の各ルートの write_file(...)(agy はグロブを受け付けないのでディレクトリをそのまま書く.先頭の ~ は同期が展開する)

既存インストールで残る値

  • Claude の設定でソースが sandbox を宣言しないとき,旧版が生成した sandbox(denyWrite の保護パスを含む)は同期で残る.Antigravity でソースが agentMode/enableTerminalSandbox を宣言しないときも,旧版の ""/true が残る(ADR-0029 の WhenAbsent::Keep).残るのは厳しい側の値で,ソースが宣言すれば次の同期で置き換わる.上の移行でソースに書けば,新規と既存のインストールは一致する.
  • 手作業の後始末:ソースに sandbox を書かない利用者は,アップグレード後の最初の同期のあとで ~/.claude/settings.json の sandbox.filesystem.denyWrite から旧版が足したハーネスのパス(上の各ルートの配下)を消すか,sandbox を丸ごと消す.消さないと,README の「denyWrite はソースの値をそのまま出す」に反して,それらのパスへの sandbox 内の書き込みが拒否され続ける.Antigravity の agentMode/enableTerminalSandbox も,ソースに書かずに既定へ戻したいときは ~/.gemini/antigravity-cli/settings.json から消す.

dotfiles

  • Home Manager 経由なら変更不要.agent-harness install --dsh-profile ... を直接呼んでいるスクリプトがあれば,フラグを外す.

そのほか

  • generate-codex-config-fragment の出力は秘密パスのエントリと glob_scan_max_depth だけになる.
  • pre-major の互換性方針(ADR-0009,ADR-0010)に従い,タイトルの ! で破壊的変更として記録する.リリースはしない.

検証

  • ローカル:cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test,nix flake check がすべて成功
  • Red:path_rules_come_only_from_the_source_secret_policy,the_source_mode_and_sandbox_settings_pass_through,build_settings_merges_hooks_command_permissions_and_secret_paths,write_config_source_adds_no_guarded_entry_for_installed_files,every_provider_declares_how_it_enforces_command_rules が削除前の実装で失敗することを確認した
  • golden は再生成し,差分が保護エントリ,Antigravity の固定値と許可・拒否,protected_paths.json の削除だけであることを確認した
  • CI:push のたびに確認(最新の結果は PR のチェック欄)

レビュー対応

  • 旧版が生成した Claude の sandbox と Antigravity の agentMode/enableTerminalSandbox が既存インストールに残る(codex-review P2 ×2):変更せず,上の「既存インストールで残る値」に明記した.所有範囲から外れたキーは,harness が書いた値かユーザーが書いた値かを区別できず,消すとユーザーの設定を落としうる.残るのは厳しい側の値で,ソースが宣言すれば置き換わる.
  • 同じ点の README との食い違い(codex-review P3):コードは変えず,「既存インストールで残る値」に手作業の後始末を追記した.

計画からの逸脱

  • Antigravity の agentMode/enableTerminalSandbox の固定と /nix・/run の許可・拒否も,ソースが宣言していない方針なので,ADR-0031 の保護部分として外した.
  • --dsh-profile は保護パスにしか使われていなかったので削除した.

🤖 Generated with Claude Code

@furedea

furedea commented Nov 27, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T06:58:41.385844Z d4f3ebd Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Review summary (read-only): no blocking findings.

I checked that the removal of the generated protection is complete and that nothing still depends on it:

  • No code, Nix module or test still refers to protection, dsh_profile, SyncTarget, generated_files_for or protected_paths.json. The only remaining mentions are in older ADRs, which is expected.
  • Upgrading an existing install: the sync removes the old generated entries.
    • Antigravity owns rules that start with read_file( or write_file(, so the old protection rules are dropped on the next sync.
    • Codex's managed keys use WhenAbsent::Remove, so the old guarded "read" entries are dropped too.
    • The old .claude/hooks/rules/protected_paths.json goes away because the hooks directory is replaced as a whole.
  • What stays behind (more restrictive, so harmless): these keys use WhenAbsent::Keep, so if the source never sets them, the old values stay in the installed file:
    • Antigravity: agentMode and enableTerminalSandbox
    • Claude: sandbox.filesystem.denyWrite
  • guarded_filesystem.rs keeps the secret-path "none" entries, the glob_scan_max_depth setting and the conflict check. It has new tests for the case with no secret rules, for write-only rules and for overlapping entries.
  • New tests cover the changed behaviour: source values pass through, path rules come only from the secret policy, installed files get no guarded entries, and Claude's denyWrite passes through.

The migration risk (hooks that fail closed when protected_paths.json is missing) is outside this repo and the PR description covers it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91d4e88ff5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/generation/claude_config.rs Resolved
Comment thread src/generation/antigravity_config.rs Resolved
@furedea-agent
furedea-agent Bot force-pushed the refactor/remove-agent-github-token branch from d4f3c1e to e64ea2c Compare November 27, 2026 04:31
@furedea-agent
furedea-agent Bot force-pushed the refactor/remove-protection-inventory branch from 91d4e88 to bdee585 Compare November 27, 2026 04:37
@furedea

furedea commented Nov 27, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

Review summary

No findings (P0: 0, P1: 0, P2: 0, P3: 0).

What I checked:

  • Removing the protection paths for Claude, Codex and Antigravity: merge_permissions and the TOML merge still apply the source secret-path policy and the command rules. reject_unusable_path_rules still runs on Antigravity.
  • Leftover entries in existing Codex installs: permissions is in CODEX_MANAGED_KEYS with WhenAbsent::Remove, so the old "<installed path>" = "read" entries are replaced on the next sync. They are not left behind.
  • protected_paths.json: nothing in the repo reads it any more. It is no longer in the generated or verified files, and ~/.claude/hooks/ is replaced as a whole, so the old file is removed. The PR description already covers the hooks in agent-config that fail closed when it is missing.
  • Removing --dsh-profile, SyncTarget and generated_files_for: nothing else refers to them. The Home Manager module no longer passes the flag.
  • Tests: the tests that asserted the old protection were changed to assert it is gone (Claude deny and sandbox pass-through, the Codex fragment, the render test). The new guarded_filesystem tests cover secret-only output and deduplication.

The breaking behaviour is intentional and the migration notes describe it.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: bdee585c98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@furedea-agent
furedea-agent Bot force-pushed the refactor/remove-protection-inventory branch from bdee585 to 70eaf98 Compare November 27, 2026 04:57
@furedea

furedea commented Nov 27, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

Review summary (automated, read-only)

No P0–P3 findings.

What I checked:

  • I grepped the tree for leftover uses of the removed items (protection::, dsh_profile / --dsh-profile, SyncTarget, protected_paths, InstalledLayout::relative / generated_files_for). None remain outside historical ADR text, and the Home Manager module no longer passes --dsh-profile.
  • guarded_filesystem::codex_config_fragment_for_runtime produces the same secret-path none entries and glob_scan_max_depth as the old protection code. It still dedupes the entries and runs the guarded_conflict check against the project directory. Dropping CodexAccess and ensure_same_access is safe because every remaining entry is none.
  • For Claude, sandbox now passes through from the source unchanged. The removed denyWrite type validation was only reached on the path that merged the protected paths.
  • For Antigravity, the permissions merge keeps the secret-path and command rules and still runs reject_unusable_path_rules. The fixed agentMode and enableTerminalSandbox values and the /nix and /run rules are removed, as the PR description says.
  • protected_paths.json drops out of generated_rule_files, so verification no longer requires it. Because the hooks directory is replaced wholesale on install, the old file is removed.
  • The tests and golden files are updated to assert that the protection entries are absent. The behaviours that remain (secret-path entries, the source denyWrite passing through, the Antigravity home rule) are still covered.

These changes intentionally weaken protection. That is a policy decision, and the PR description already covers it along with the consumer migration (the hook that reads protected_paths.json, and the retained sandbox/agentMode values). The hook migration in agent-config needs to land before this one, or a hook that fails closed when the file is missing will block calls.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 70eaf9867a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Base automatically changed from refactor/remove-agent-github-token to main November 27, 2026 06:52
furedea
furedea previously approved these changes Nov 27, 2026
The harness no longer derives a protected path inventory from what it
installs. Claude gets no Edit denials or sandbox denyWrite entries for
installed files, Codex no guarded read entries, Antigravity no
write_file denials, sandbox grants, or mode and sandbox pins, and
protected_paths.json is no longer written. The source settings declare
protection (ADR-0032); the secret path policy and command rules are
still rendered. install drops --dsh-profile, which only named a
protected file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@furedea-agent
furedea-agent Bot dismissed furedea’s stale review November 27, 2026 06:55

The merge-base changed after approval.

@furedea-agent
furedea-agent Bot force-pushed the refactor/remove-protection-inventory branch from 70eaf98 to d4f3ebd Compare November 27, 2026 06:55
@furedea

furedea commented Nov 27, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread src/generation/claude_config.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Review summary: no blocking findings (0 P0/P1). This PR removes the installed-file protection (ADR-0008 superseded by ADR-0032). I checked that the removal is complete and consistent. Nothing in the repo still reads protected_paths.json, and the Home Manager module no longer passes --dsh-profile. For Codex, guarded_filesystem still emits the secret-path none entries and glob_scan_max_depth, and the conflict checks still run. For Antigravity, the sync owns the read_file(/write_file(/command( entries, so the old generated denies and /run rules are removed on the next sync. The golden files and unit tests were updated to match. P3 (inline comment on src/generation/claude_config.rs): Claude's sync keeps top-level keys that the rendered settings no longer have (WhenAbsent::Keep). On installs that already exist and whose source has no sandbox key, the old generated sandbox.filesystem.denyWrite list of harness paths stays in ~/.claude/settings.json. Worth a migration note. I couldn't run cargo test here; it was blocked by permissions. 🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: d4f3ebd779

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@furedea
furedea merged commit 2008c43 into main Nov 27, 2026
23 checks passed
@furedea
furedea deleted the refactor/remove-protection-inventory branch November 27, 2026 11:30
furedea added a commit to furedea/agent-config that referenced this pull request Nov 28, 2026
…policy (#286)

## 概要

agent-harness が描画と配置だけを担うようになり(furedea/agent-harness#262),これまで harness
が合成していた保護とエージェント用 GitHub トークンの配線が消えた.その代わりをこのリポジトリのソース設定とフックで持つ.

- 保護は「書き込みの許可リスト+ハーネスのルートごとの拒否」にした.ルートは
`agents/hooks/rules/harness_roots.json` に 1 か所で宣言し,Claude と Antigravity
のネイティブの拒否,および全 provider 共通の `guard_file.py harness`
がそれに従う.テストが各設定と宣言の一致を確かめる.
- フックは生成ファイル `protected_paths.json` を読まなくなった.`harness_roots.json`
を読み,対象が(`.` と `..` を畳んだうえで)いずれかのルートの中なら拒否する.
- GitHub:`gh` を Claude の sandbox の中で動かし,`github.com` と `api.github.com`
への通信を許す.Codex は guarded プロファイルで動く.`GH_CONFIG_DIR` の値はホストごとの絶対パスで,Claude
の `env` も Codex の `shell_environment_policy.set` も `~`
を展開しないため,ソースには書かずホスト(dotfiles,サーバーでは `bootstrap_server.sh`)が渡す(ユーザーの決定).
- App の鍵は,`~/.ssh` 全体の読み取り拒否として各 provider
のネイティブ設定に明示した.ソースには鍵のファイル名を書かない.
- ADR-0031 を追加し,ADR-0013 を partly-superseded にした.

Closes #285

## 移行項目の対応表

### furedea/agent-harness#265(保護)

- [x] フックの `protected_paths.json` 依存を外す →
`agents/hooks/guard_file.py`,`agents/hooks/rules/harness_roots.json`(Codex,Devin,Hermes,Pi,dsh,Antigravity
のアダプターも同じフックを通る)
- [x] Claude `permissions.deny` にルートごとの `Edit(...)` →
`agents/claude/settings.json`(`~/.claude/**`,`~/.codex/**`,`~/.devin/**`,`~/.config/devin/config.json`,`~/.hermes/**`,`~/.pi/**`,`~/.dsh/**`,`~/.gemini/config/**`,`~/.gemini/antigravity-cli/settings.json`)
- [x] Claude `sandbox.filesystem.denyWrite` → 追加不要.`allowWrite`
はどのルートも含まない(テストで固定)
- [x] Codex:ルートを書けない guarded プロファイル →
`agents/codex/config.toml`(`":root" = "read"`,書き込みは作業ディレクトリ,一時領域,Claude
の `allowWrite` と同じキャッシュだけ.テストで Claude と一致を固定)
- [x] Antigravity `agentMode = ""`,`enableTerminalSandbox = true` →
`agents/antigravity/settings.json`(新規)
- [x] Antigravity `read_file(/nix)`,`read_file(/run)` の許可,`/run`
の秘密のマウント 8 つの `read_file(...)` の拒否 → 同上
- [x] Antigravity の各ルートの `write_file(...)` 拒否 → 同上
- [x] Devin,Hermes,Pi,dsh → ネイティブの規則の面がないので,フック(`harness_roots.json`)で拒否
- [x] dotfiles の `--dsh-profile` → このリポジトリは使っていない(対応なし)

### furedea/agent-harness#264(GitHub トークン)

- [x] Claude `sandbox.enableWeakerNetworkIsolation = true` → 既にソースにある
- [x] Claude `sandbox.network.allowedDomains` に
`github.com`,`api.github.com` → `agents/claude/settings.json`
- [x] Claude `sandbox.excludedCommands` から `gh *` を外す → 同上
- [x] Claude の鍵の拒否(`permissions.deny` と `sandbox.filesystem.denyRead`
の両方)→ `Read(~/.ssh/**)` と `~/.ssh`(鍵のパスを含む `~/.ssh`
全体.`secret_path_policy.json` の `~/.ssh/**`,`**/*.pem` でも生成される)
- [x] `<configDir>` を隠す規則を置かない → テスト
`test_agents_can_read_the_agent_gh_config_the_host_mints`
- [x] Codex `default_permissions =
"guarded"`,`":root"`,`":tmpdir"`,`":slash_tmp"`,`":workspace_roots"."."`,キャッシュの
`"write"`,`[permissions.guarded.network] enabled = true` →
`agents/codex/config.toml`
- [x] Codex の鍵の拒否 → `"~/.ssh" = "deny"`(加えて harness が `"~/.ssh/**" =
"none"` を生成)
- [x] Codex `"~/.config/gh/hosts.yml" = "deny"` →
`secret_path_policy.json` から harness が `"none"` を生成(従来どおり)
- [x] Antigravity `read_file(~/.config/gh/hosts.yml)` →
`secret_path_policy.json` から生成(従来どおり)
- [x] Antigravity の鍵の拒否 → `read_file(~/.ssh)`(ソースに明示,生成とも重複は畳まれる)
- [ ] Claude `env.GH_CONFIG_DIR`,Codex
`shell_environment_policy.set.GH_CONFIG_DIR` → **dotfiles
が渡す**(下記).ソースには書かない
- [ ] トークンの発行と更新 → dotfiles(furedea/dotfiles のトークン lane).サーバーは下記のフォローアップ

### furedea/agent-harness#263(Pi の srt 拡張)

- [x] `manifest.json` の `runtime_commands` に `srt` はない,Pi のためだけの sandbox
エントリもない → 対応なし

## 旧版との意図した違い

- ルート単位の拒否になったため,ファイルツールは `~/.claude/plans`(plan mode の計画ファイル)や
`~/.claude/keybindings.json`
など,ルート配下のすべてを書けない.旧版はインストールしたファイルだけを拒否していた.現在 `~/.claude/plans` は空で,plan
mode は使われていない.
- スキル(`~/.claude/skills` など)も保護される.旧版は保護していなかった.
- Codex は main checkout で `.git/worktrees` 全体を書けない(Codex がグロブのエントリに
`deny` しか受け付けず,`config.worktree` は git が読むため).Claude は `config.worktree`
だけを拒否する.Codex の lane は worktree で動き,共通の `.git` は元々作業領域の外なので影響しない.
- Codex の guarded プロファイルで,フックだけが書く状態と作業領域の `.git/hooks`,`.git/config`
を書けなくなった(旧版は書けた).
- 鍵の拒否は鍵のファイル単体ではなく `~/.ssh` 全体(従来から秘密パスのポリシーで拒否していた範囲と同じ).
- App の鍵がないホストでも,GitHub への通信が sandbox で開き,`gh` は sandbox の中で未認証で動く.旧版は
`gh` を sandbox の外でユーザー自身のログインで動かしていた.

## dotfiles が用意するもの

- `GH_CONFIG_DIR = <home>/.config/agent-harness/gh`(旧既定値と同じ絶対パス)を,Home
Manager の `programs.agent-harness.claude.settings.env` と
`programs.agent-harness.codex.settings.shell_environment_policy.set`
に足す(`NVIM_LOG_FILE` と同じ形).
- トークンを `<home>/.config/agent-harness/gh/hosts.yml`(0600,一時ファイルからの
rename)に書くスクリプトと,その定期実行.
- 鍵は `~/.ssh/` の下に置いたままにする(ここに置く限り,上の拒否が効く).

## マージ後にユーザーが確かめること

- dotfiles を新しい agent-harness に上げて切り替えたあと,Codex
のセッションで作業領域への書き込みができ,`.git/hooks` と `~/.claude` への書き込みが拒否されること.このレーンの
sandbox の中では `codex sandbox` が入れ子の seatbelt を作れず,設定の読み込みまでしか確かめられなかった.
- Claude のセッションで `gh auth status` がエージェントの身元を示すこと(トークンは表示しない).

## 必要な agent-harness のリビジョン

- この PR のソースは,ロック中の 0.9.15(c5b1303)と,#263〜#265 を含む main の 2008c43 の両方で
`install` と `verify` が成功し,描画結果に保護,GitHub の配線,鍵の拒否が入ることを確かめた.
- dotfiles は 2008c43 以降へ上げてよい(この PR のマージ後).

## フォローアップ

- agent-config:`scripts/bootstrap_server.sh` は `agent-harness
github-app-token refresh` でトークンを発行している.固定中のリリースでは動くが,#264
を含むリリースへ上げるとこのサブコマンドがなくなるので,その前に dotfiles と同じ形の発行スクリプトへ置き換える.
- agent-config:`docs/DESIGN.md` の「`denyWrite`
はまだ効いていない(agent-harness#213)」は,両方のリビジョンの描画で `denyWrite`
がソースのまま出ていたので,記述の見直しが要る.

## レビュー対応

- 相対パスとシンボリックリンクでルートの判定をすり抜ける(claude-review P2):payload の `cwd`
から解決し,字句上のパスと解決後のパスの両方で判定するよう修正した(dabd8070).
- GitHub への通信路(claude-review P3):旧版と同じ構成なのでコードは変えず,ADR-0031
に追記した(caf37603).
- Codex の guarded プロファイルが Claude の
`denyWrite`(フックだけが書く状態,`.git/hooks`,`.git/config`,`config.worktree`)を写していない(claude-review
P1):`"read"` で写し,テストで Claude
と一致を固定した(45257d64).旧版が合成していたプロファイルにも同じ欠落があった.
- codex-review は「レビューを完了できなかった」で失敗した(使用量制限など).

## 検証

- Red:`tests/hooks/test_guard_file.py` の新しい契約(28 件)と
`tests/test_harness_protection.py`(宣言ファイルがない,鍵の拒否がない)が実装前に失敗することを確認した
- `uv run pytest`:6662 passed,2 skipped
- `bats tests/bootstrap_server.bats`:81 件成功
- `ruff check`,`ruff format --check`,変更ファイルの `dprint check`,`nix run
.#adr-check -- docs/adr`:成功
- 新旧 2 つの agent-harness で一時ディレクトリへ `install` と `verify`,配置した
`guard_file.py harness` がルート配下を拒否し,作業ディレクトリのファイルを許すことを確認した

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
furedea pushed a commit that referenced this pull request Dec 1, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.10.0](agent-harness-v0.9.16...agent-harness-v0.10.0)
(2026-11-29)


### ⚠ BREAKING CHANGES

* remove the generated protection of installed files
([#265](#265))
* remove the agent GitHub token
([#264](#264))
* **pi:** remove the srt sandbox extension
([#263](#263))

### Features

* render MCP servers declared once in the source
([#268](#268))
([2eb9fe7](2eb9fe7))


### Code Refactoring

* **pi:** remove the srt sandbox extension
([#263](#263))
([d1f8a11](d1f8a11))
* remove the agent GitHub token
([#264](#264))
([ea5741d](ea5741d))
* remove the generated protection of installed files
([#265](#265))
([2008c43](2008c43))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant