Repository navigation
feat(security): allow agent-browser and agent-desktop except named risky forms - #63
Merged
Merged
Conversation
5 tasks
…sky forms Run listed browser and desktop automation forms outside the sandbox from the first call. Deny file: and chrome: URLs and terminal, settings, and credential apps. Ask for connections, profiles, saved state and sessions, launch options, file transfer, targets the arguments cannot name, and quoted or wrapped forms. Refs furedea/dotfiles#377 Co-Authored-By: Claude Opus 5.5 <[email protected]>
furedea-agent
Bot
force-pushed
the
feat/browser-desktop-automation
branch
from
November 3, 2026 13:52
c8473ee to
866d0ef
Compare
furedea
approved these changes
Nov 3, 2026
furedea
added a commit
that referenced
this pull request
Nov 3, 2026
…sandbox (#64) ## 概要 #63 で残った穴を塞ぐ.`agent-browser` と `agent-desktop` はサンドボックスの外で動くため,許可された呼び出しでもサンドボックス外のファイルを読み書きできる経路が残っていた. - **オプションの許可リスト(両 CLI)**:許可されたサブコマンドは,そのサブコマンドについて列挙したオプションだけを使える.それ以外のオプションは,`--name=value` の形も含めて,引数列のどこにあっても `ask` になる.一覧は upstream から作り,パスを読み書きせず,別のプロセス・アプリ・セッションにも届かないものだけを残した(下表).これまでの除外リスト(denylist)は `--action-policy`,`--ca-cert`,agent-desktop の `--trace` と `clipboard-get --out` を見落としていた.さらに `agent-browser` は flake の更新ごとに新しくなるため,新しいオプションが黙って通る.そこで除外リストを許可リストに置き換えた. - **シンボリックリンクの解決(両 CLI)**:オプションでない引数(と `--opt=value` の `=` 以降)を,コマンドの作業ディレクトリから,存在する各構成要素のシンボリックリンクをたどって解決する.コマンドのある Git worktree かセッションの一時ディレクトリ(`TMPDIR`,`CLAUDE_TMPDIR`,`CLAUDE_CODE_TMPDIR`,`tempfile.gettempdir()`)の中に収まるときだけ許可する.ルートの決め方は既存の `verification_session.require_inside` と同じもので,`hook_input.temporary_roots()` に移して共有した. - **`agent-browser` の daemon が書くファイルは確認**:daemon は相対パスを自分が起動したディレクトリから開くため,フックでは保存先を判定できない.そこで `screenshot`,`pdf`,`trace stop`,`profiler stop`,`network har stop` は `ask` にした.例外として,引数列が完全一致する `agent-browser screenshot` と `agent-browser screenshot --full` だけは許可する.パスを指定しない screenshot は `~/.agent-browser/tmp/screenshots/screenshot-<ミリ秒>.png` に保存される(WebDriver バックエンドでは `/tmp/screenshot-<ミリ秒>.png`).worktree と `$TMPDIR` の外だが,ファイル名は daemon が決める. - **`agent-browser.json` があれば確認**:CLI は作業ディレクトリの `agent-browser.json` を自動で読み,そこで実行ファイル・起動引数・保存先などを指定できる.そのため,このファイルがある作業ディレクトリでの呼び出しは `ask` にした. - **TAB や改行で分割したスキームも拒否**:URL パーサーは TAB と改行を取り除くので,`'fi<TAB>le:///etc/passwd'` も `file:` として読み込まれる.プログラムを限定した拒否ルールの照合前に,これらの文字を取り除く. ### 方針の変遷 1. **引数解析**:CLI の引数解釈を再現して daemon に渡るパスを探す方式.Codex レビュー 3 回で毎回新しい回避が見つかったため,やめた. 2. **完全一致の許可リスト**:daemon が書く形式だけを完全一致で許可する方式に変えた.ただしオプションは除外リストのままで,レビューで `--action-policy` の見落としが見つかった. 3. **オプションの許可リスト**:ユーザーの承認を得て,オプションも許可リストに置き換えた(本 PR の最終形). ## 許可するオプション すべてのサブコマンドで,下表のグローバルオプションも使える.表にないサブコマンドはオプションを取れない. | CLI | サブコマンド | 許可するオプション | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | agent-browser | (グローバル) | `--json` `--headed` `--session` | | agent-browser | `a11y` | `--json` `--selector` `--tags` `-s` | | agent-browser | `click` | `--human` `--new-tab` | | agent-browser | `console`,`errors` | `--clear` | | agent-browser | `cookies` | `--domain` `--expires` `--http-only` `--httpOnly` `--path` `--same-site` `--sameSite` `--secure` `--url` | | agent-browser | `drag` | `--human` | | agent-browser | `eval` | `--base64` `-b` | | agent-browser | `find` | `--exact` `--name` | | agent-browser | `mouse` | `--duration` `--human` `--seed` `--steps` | | agent-browser | `network` | `--abort` `--allow-origin` `--body` `--clear` `--content` `--filter` `--method` `--status` `--type` `--resource-type` `--resource-types` | | agent-browser | `profiler` | `--categories` | | agent-browser | `react` | `--json` `--only-dynamic` `--raw-json` | | agent-browser | `read` | `--filter` `--json` `--llms` `--outline` `--raw` `--require-md` `--timeout` | | agent-browser | `screenshot` | `--full`(引数列の完全一致 `screenshot --full` のみ) | | agent-browser | `scroll` | `--selector` `-s` | | agent-browser | `snapshot` | `--compact` `--cursor` `--depth` `--full` `--interactive` `--selector` `--urls` `-C` `-c` `-d` `-i` `-s` `-u` | | agent-browser | `tab` | `--label` | | agent-browser | `type` | `--clear` `--delay` | | agent-browser | `vitals` | `--json` | | agent-browser | `wait` | `--fn` `--load` `--text` `--timeout` `--url` `-f` `-l` `-t` `-u` | | agent-desktop | (グローバル) | `--session` `--help` `-h` `--version` `-V` | | agent-desktop | `snapshot` | `--app` `--compact` `--force-electron-a11y` `--include-bounds` `--interactive-only` `-i` `--max-depth` `--skeleton` `--timeout-ms` `--wait-for` `-w` `--wait-for-gone` `--wait-timeout` | | agent-desktop | `find` | `--app` `--count` `--description` `--exact` `--first` `--last` `--limit` `--name` `--native-id` `--nth` `--role` `--state` `--text` `--timeout-ms` `--value` | | agent-desktop | `screenshot`,`list-surfaces`,`minimize`,`maximize`,`restore`,`dismiss-all-notifications` | `--app` | | agent-desktop | `resize-window` | `--app` `--width` `--height` | | agent-desktop | `move-window` | `--app` `--x` `--y` | | agent-desktop | `focus-window` | `--app` `--title` | | agent-desktop | `click` `double-click` `triple-click` `right-click` `clear` `focus` `toggle` `check` `uncheck` `expand` `collapse` `scroll-to` `set-value` `select` | `--timeout-ms` `--wait-for` `-w` `--wait-for-gone` `--wait-timeout` | | agent-desktop | `type` | 上の行と同じ + `--interval-ms` | | agent-desktop | `scroll` | 上の行と同じ + `--amount` `--direction` | | agent-desktop | `get`,`is` | `--property` | | agent-desktop | `list-apps`,`list-windows` | `--app` `--timeout-ms` | | agent-desktop | `list-notifications` | `--app` `--limit` `--text` | | agent-desktop | `dismiss-notification` | `--app` `--expected-app` `--expected-title` | | agent-desktop | `notification-action` | `--expected-app` `--expected-title` | | agent-desktop | `clipboard-get` | `--format` | | agent-desktop | `wait` | `--app` `--action` `--count` `--element` `--event` `--menu` `--menu-closed` `--notification` `--predicate` `--text` `--timeout` `--value` `--window` | 意図して外したオプションと理由: - agent-browser - `--state`(`wait` でもグローバルの状態ファイルとして解釈されうる) - `--download` / `-d`(`wait`) - `--stdin`(`eval`) - `--curl`(`cookies`) - `--delta`(`snapshot`) - agent-desktop - `--surface`,`--root`:`--app` 以外の対象に届く - `--window-id` - `--headed` - `--agent-id` - `--trace`,`--screenshot`,`--debug` - `--out`,`--image`,`--file-url` - `--force`(`close-app`) - `--screen` - `--request` / `--guide`(`permissions`) ## 変更前後 | 呼び出し | 変更前 | 変更後 | | -------------------------------------------------------------------------------------------------- | ------- | --------------- | | `agent-browser click @e1 --new-tab`,`snapshot -i -c -d 3`,`--session s --json get title` | `allow` | `allow` | | `agent-browser open … --user-agent x` / `--action-policy p.json` / `--ca-cert c.pem` / `--proxy …` | `allow` | `ask` | | `agent-browser click @e1 -i`(他のサブコマンドのオプション) | `allow` | `ask` | | `agent-desktop snapshot --app Finder --trace out.jsonl` / `--surface dock` / `--root @ref` | `allow` | `ask` | | `agent-desktop clipboard-get --out x.png`,`clipboard-set --image x.png` | `allow` | `ask` | | `agent-desktop move-window --app Finder --x=-100 --y=20` | `allow` | `allow` | | `agent-browser screenshot`,`screenshot --full` | `allow` | `allow` | | その他の `screenshot`,`pdf`,`trace stop`,`profiler stop`,`network har stop` | `allow` | `ask` | | 作業ディレクトリに `agent-browser.json` がある `agent-browser` の呼び出し | `allow` | `ask` | | `agent-browser tab new 'fi<TAB>le:///etc/passwd'` | `allow` | `deny` | | `agent-browser inspect`(macOS の `open` で既定ブラウザーを開き,ログイン済みのセッションに届く) | `allow` | `ask` | | `agent-browser profiles`(ユーザーの Chrome の `Local State` を読む) | `allow` | `ask` | | `agent-desktop screenshot --app Finder out`(`out -> 外部ファイル`),宛先のないリンク,ループ | `allow` | `ask` | | 作業ディレクトリが不明,または worktree・一時ディレクトリの外 | `allow` | `ask` | | `agent-browser fill @e1 -5`(`-` で始まる入力値) | `allow` | `ask`(誤検知) | ## 残る制限 - **パスを指定しない screenshot の保存先**:worktree と `$TMPDIR` の外(`~/.agent-browser/tmp/screenshots`).承認済みの例外. - **CLI 自身の状態ディレクトリへの書き込み**:たとえば `agent-desktop clipboard-get --format image` は `~/.agent-desktop/tmp/clipboard-*.png` に,`agent-desktop trace export` は `~/.agent-desktop/sessions/<session>/` に書く(Codex P2).保存先は CLI が決める. - **TOCTOU**:判定後にリンクや `agent-browser.json` を差し替えられると外に届く.フックからは防げない. - **一覧の鮮度**:オプションとサブコマンドの一覧は upstream から手で作った.CLI の更新で既存オプションの意味が変わっても気付けない.新しいオプションは確認になる. - **worktree 内の保護パス**:サンドボックスが worktree 内で禁じているパス(`.claude/settings.json` など)にも `agent-desktop` の出力は書ける. - **誤検知(安全側)**: - `-` で始まる入力値(`fill @e1 -5`,`move-window --x -100`.後者は `--x=-100` なら通る) - 外を指すリンクとたまたま同名の引数 - `fill` の入力文に ` stop` などを含む場合 - ADR-0018 本文は Accepted のため変更せず,`Refines: ADR-0018` の ADR-0019 を追加した. ## 検証 - `uv run pytest -q`:3290 passed,1 skipped - `tests/hooks/test_browser_desktop_automation.py`:未知のオプション,サブコマンド違いのオプション,`--name=value` 形式,許可されたオプション,`-` 始まりの値,TAB 入りスキーム.先に失敗を確認してから実装した.#63 の既存ケースも通過 - lefthook pre-commit / commit-msg:passed - Codex レビュー(許可リスト版) 1. P1 1 件:`--surface` が `--app` を迂回する → 一覧から外した.P2 2 件は CLI の状態ディレクトリへの書き込みとして記録 2. P1 2 件:`--root` が `--app` を迂回する,TAB 入りスキームで拒否をすり抜ける → 修正 3. P0/P1 なし.P2 1 件:`inspect` が既定ブラウザーを開く → ユーザーの承認を得て許可サブコマンドから外し,`ask` にした 4. 修正後の再レビュー:`inspect` の修正を確認.P0/P1 なし.P2 1 件:`profiles` が Chrome の `Local State` を読む → ユーザーの承認を得て許可サブコマンドから外し,`ask` にした - 差分:完全一致版 10 files,+287/−19 → 許可リスト版 12 files,+516/−28 Refs furedea/dotfiles#377 🤖 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
Nov 10, 2026
🤖 I have created a release *beep* *boop* --- ## 0.1.0 (2026-11-10) ### Features * add devin provider to hooks.json with hook adapter (furedea/dotfiles[#136](#136)) ([5bc5550](5bc5550)) * add git-commit-split skill ([35f4e16](35f4e16)) * add Hermes Agent and pi hook providers (furedea/dotfiles[#138](#138)) ([ed3a774](ed3a774)) * add lock-settings, report-doc-conflict, and report-hook-block skills ([35b8585](35b8585)) * **agents:** add Rust style skill ([a82df41](a82df41)) * **agents:** allow cd, sed, awk, xargs, cp, and mv under the sandbox (furedea/dotfiles[#165](#165)) ([5783f87](5783f87)) * **agents:** bootstrap the harness on servers without Nix ([80a0f9b](80a0f9b)) * **agents:** chain git add, status, commit, and push outside the sandbox (furedea/dotfiles[#169](#169)) ([dd5a05c](dd5a05c)) * **agents:** Codex implements, Claude reviews, and lanes clean up opened workspaces (furedea/dotfiles[#266](#266)) ([c9a3fd9](c9a3fd9)) * **agents:** generate hook settings from nix ([b20d592](b20d592)) * **agents:** hand approved lanes to Herdr task worktree sessions (furedea/dotfiles[#184](#184)) ([58a591f](58a591f)) * **agents:** own personal agent source (furedea/dotfiles[#52](#52)) ([51060b1](51060b1)) * **agents:** permit commands by reversibility (furedea/dotfiles[#124](#124)) ([bb96256](bb96256)) * **agents:** run agent git inside the sandbox with unsigned commits (furedea/dotfiles[#172](#172)) ([1492f3e](1492f3e)) * **agents:** start Herdr Claude lanes on Sonnet at medium effort (furedea/dotfiles[#257](#257)) ([3caf8d5](3caf8d5)) * **agents:** write PR bodies inline and close lanes' parent workspaces (furedea/dotfiles[#211](#211)) ([8c6df4e](8c6df4e)) * **claude:** close the sandbox escape and reach the Nix daemon inside (furedea/dotfiles[#191](#191)) ([b61f2ac](b61f2ac)) * **claude:** let Go CLIs verify TLS inside the sandbox (furedea/dotfiles[#167](#167)) ([282b3d2](282b3d2)) * **claude:** let sandboxed commands listen on local ports (furedea/dotfiles[#206](#206)) ([36c09d2](36c09d2)) * **claude:** run the Codex plugin companion outside the sandbox (furedea/dotfiles[#232](#232)) ([0255159](0255159)) * **codex:** let Codex write, test, and deliver inside the sandbox (furedea/dotfiles[#200](#200)) ([33a0a82](33a0a82)) * compose Herdr and Moshi agent hooks (furedea/dotfiles[#33](#33)) ([4951ee8](4951ee8)) * **dsh:** add the dsh hook adapter ([#101](#101)) ([db86f57](db86f57)) * **git-commit-split:** accept mode from slash-command argument ([10c3ef7](10c3ef7)) * **git-commit-split:** modularize commit splitting workflow with branch ([bab6f19](bab6f19)) * **github:** add repository creation script ([1a7910b](1a7910b)) * **hermes:** use Apple Mail for mail access (furedea/dotfiles[#69](#69)) ([94268fa](94268fa)) * **hooks:** add related test selection rules ([2aca101](2aca101)) * **hooks:** add shared audit and command guard hooks ([6ab33b5](6ab33b5)) * **hooks:** allow read-only local curl diagnostics and log syntax ask kinds (furedea/dotfiles[#287](#287)) ([83cd643](83cd643)) * **hooks:** ask before an agent adds a lint suppression (furedea/dotfiles[#214](#214)) ([b767665](b767665)) * **hooks:** ask only for effects that escape the sandbox (furedea/dotfiles[#163](#163)) ([21409a5](21409a5)) * **hooks:** block destructive non-push git operations ([cc02cb4](cc02cb4)) * **hooks:** escalate unrecognized command forms to a prompt (furedea/dotfiles[#159](#159)) ([e30de17](e30de17)) * **hooks:** fast-forward main after cleaning up merged lanes (furedea/dotfiles[#210](#210)) ([f8a60af](f8a60af)) * **hooks:** honor project allow rules only from trusted owners ([#33](#33)) ([305d391](305d391)) * **hooks:** improve lint-format feedback across providers ([8a512f6](8a512f6)) * **hooks:** judge heredocs, substitutions, loops, and redirections structurally (furedea/dotfiles[#175](#175)) ([9276283](9276283)) * **hooks:** let sessions lock flake inputs and close their own lanes (furedea/dotfiles[#208](#208)) ([f109b49](f109b49)) * **hooks:** let the parent run cleanup_worktrees.py after merge (furedea/dotfiles[#300](#300)) ([fc44c74](fc44c74)) * **hooks:** remove merged task worktrees and branches at session start (furedea/dotfiles[#185](#185)) ([2701e0b](2701e0b)) * **hooks:** replay recent commands through the hooks (furedea/dotfiles[#199](#199)) ([2ed4984](2ed4984)) * **hooks:** report ast-grep rule findings after an edit ([#119](#119)) ([ff91d8c](ff91d8c)) * **hooks:** review only commands that reach past the sandbox (furedea/dotfiles[#178](#178)) ([40c97da](40c97da)) * **hooks:** run zizmor offline after workflow edits (furedea/dotfiles[#295](#295)) ([79b66a6](79b66a6)) * **hooks:** scan with the shared ast-grep rules shipped beside the hooks ([#121](#121)) ([35a9270](35a9270)) * **hooks:** support Go projects in formatting, verification, and permissions ([#57](#57)) ([5506f3c](5506f3c)) * **hooks:** verification selection, unified patch input, formatter/linter ordering (furedea/dotfiles[#144](#144)) ([99a825b](99a825b)) * **lint:** add the first ten ast-grep rules and drop the prose they replace ([#117](#117)) ([c235eb5](c235eb5)) * **nix:** expose the plain agents path as passthru.tree of agent-source ([#94](#94)) ([63632e4](63632e4)) * **security:** add a program_path option that pins a rule's program to one absolute path ([#61](#61)) ([d629ca9](d629ca9)) * **security:** allow agent-browser and agent-desktop except named risky forms ([#63](#63)) ([8dc8da5](8dc8da5)) * **security:** allow cargo caches, crates.io, and OSV in the sandbox ([#60](#60)) ([2f29423](2f29423)) * **security:** allow Go caches and module hosts in the sandbox ([#58](#58)) ([4b3a35c](4b3a35c)) * **security:** ask for every docker form the allowlist does not list ([#54](#54)) ([764374f](764374f)) * **security:** deny the 1Password CLI and keep the Codex login in the keyring ([#52](#52)) ([0580825](0580825)) * **skill-auditor:** support Codex audit workflow ([0d88c3f](0d88c3f)) * **skills:** add measurement-evidence and change-type evidence to tsdd ([#70](#70)) ([85714b5](85714b5)) * **skills:** clarify names and add Herdr delegation (furedea/dotfiles[#127](#127)) ([e6576ba](e6576ba)) * **skill:** skill-auditor by nyosegawa/skills/skill-auditor ([f191132](f191132)) * **skills:** render provider-specific SKILL.md frontmatter ([44325e5](44325e5)) * **statusline:** render the status on one line (furedea/dotfiles[#110](#110)) ([03ad85e](03ad85e)) * update bash-style skill instructions ([9ab1d65](9ab1d65)) * update github-ci-init skill templates ([d238f51](d238f51)) * verify agent changes through native hooks (furedea/dotfiles[#106](#106)) ([923b0ae](923b0ae)) ### Bug Fixes * **agents:** accept generated command permissions (furedea/dotfiles[#66](#66)) ([0af9650](0af9650)) * **agents:** allow gh api reads that pass --allow-escape-sequences (furedea/dotfiles[#265](#265)) ([e732939](e732939)) * **agents:** apply harness review findings (furedea/dotfiles[#149](#149)) ([c8a51d7](c8a51d7)) * **agents:** cap Codex session-end timeout ([2f29a7e](2f29a7e)) * **agents:** deny codex-companion calls the sandbox exclusion cannot match (furedea/dotfiles[#269](#269)) ([25518ab](25518ab)) * **agents:** harden hooks and separate workflow responsibilities (furedea/dotfiles[#128](#128)) ([7e508c4](7e508c4)) * **agents:** let pnpm fetch from the npm registry inside the sandbox (furedea/dotfiles[#222](#222)) ([ac114e8](ac114e8)) * **agents:** let the forbidden rule admit Sonnet lane arguments (furedea/dotfiles[#259](#259)) ([f1b29a9](f1b29a9)) * **agents:** make the bootstrap hint work for POSIX login shells ([c2667fa](c2667fa)) * **agents:** stop asking for commands the hooks can prove safe (furedea/dotfiles[#242](#242)) ([a93d241](a93d241)) * **agents:** wait for hook state locks instead of failing with EAGAIN (furedea/dotfiles[#285](#285)) ([673c108](673c108)) * allow secret scanner hook files ([bca4207](bca4207)) * **bootstrap:** give Codex the agent GitHub token settings and run the bootstrap in CI ([#21](#21)) ([25de080](25de080)) * **bootstrap:** keep Neovim's fallback nvim.log out of the working directory ([#43](#43)) ([3c9fc5c](3c9fc5c)) * **bootstrap:** make the server bootstrap behave like the Nix hosts ([#15](#15)) ([4554dec](4554dec)) * **bootstrap:** print actionable profile and legacy-file messages only when needed ([#49](#49)) ([1918254](1918254)) * **bootstrap:** target the login profile bash actually reads ([#50](#50)) ([0dae5bf](0dae5bf)) * **bootstrap:** verify downloaded tools against pinned checksums ([#111](#111)) ([1744df3](1744df3)) * **ci:** install the locked agent-harness instead of reading it from the flake ([bc2395b](bc2395b)) * **ci:** provide the shell format config and locked JavaScript tools ([dd59634](dd59634)) * **claude:** trust only the CA store bundled with Claude Code (furedea/dotfiles[#284](#284)) ([34be271](34be271)) * **codex:** fall back to auth.json when no keyring is available ([#62](#62)) ([79b6ceb](79b6ceb)) * correct agent tooling and Hister activation (furedea/dotfiles[#85](#85)) ([4bab065](4bab065)) * honor pytest testpaths and bootstrap bats on servers (furedea/dotfiles[#116](#116)) ([b17b59e](b17b59e)) * **hooks:** allow double quoted commit messages ([fc4afd4](fc4afd4)) * **hooks:** bound curl -o, -d and -H in the localhost rule (furedea/dotfiles[#291](#291)) ([7c9db8a](7c9db8a)) * **hooks:** close shell-syntax bypasses of the guard hooks ([#11](#11)) ([c6aacdf](c6aacdf)) * **hooks:** close the guard contract gaps from [#11](#11) review ([#31](#31)) ([db318db](db318db)) * **hooks:** deny codex-companion calls whose text holds a dollar sign or backtick (furedea/dotfiles[#290](#290)) ([f37c317](f37c317)) * **hooks:** find GNU grep on PATH instead of the first grep (furedea/dotfiles[#193](#193)) ([99ba317](99ba317)) * **hooks:** format without dotfiles-installed dprint and prettier configs ([#16](#16)) ([db21f55](db21f55)) * **hooks:** ignore git-ignored sources when judging a project removed ([#22](#22)) ([97c6b93](97c6b93)) * **hooks:** ignore prose arguments when matching forbidden patterns (furedea/dotfiles[#189](#189)) ([d2049d6](d2049d6)) * **hooks:** judge each command as one line with any grep (furedea/dotfiles[#196](#196)) ([202f937](202f937)) * **hooks:** keep merged worktrees holding non-regenerable ignored files ([#29](#29)) ([ac03cfa](ac03cfa)) * **hooks:** keep the first grep when no GNU grep is on PATH (furedea/dotfiles[#195](#195)) ([a0e6a2f](a0e6a2f)) * **hooks:** keep the verification snapshot from locking out symlinked or large worktrees ([#66](#66)) ([7d13f0e](7d13f0e)) * **hooks:** let cleanup_worktrees remove Claude Code session files ([#36](#36)) ([0a910bc](0a910bc)) * **hooks:** let cleanup_worktrees tests choose the untrusted locations (furedea/dotfiles[#306](#306)) ([e82980e](e82980e)) * **hooks:** let GitHub API reads take an unquoted jq filter (furedea/dotfiles[#198](#198)) ([5b6210a](5b6210a)) * **hooks:** make stop verification reliable (furedea/dotfiles[#81](#81)) ([04a33dd](04a33dd)) * **hooks:** preserve verification evidence (furedea/dotfiles[#87](#87)) ([4b5b9c2](4b5b9c2)) * **hooks:** redirect sandbox-failing Git forms and drop covered prompts (furedea/dotfiles[#180](#180)) ([34e39a7](34e39a7)) * **hooks:** resolve Rust integration test targets inside tests subdirectories (furedea/dotfiles[#304](#304)) ([2ccf547](2ccf547)) * **hooks:** respect project formatters and bound diagnostics (furedea/dotfiles[#131](#131)) ([30e83cf](30e83cf)) * **hooks:** scope generic secret regex to quoted values ([fc09292](fc09292)) * **hooks:** silence successful hook execution ([795d8f0](795d8f0)) * **hooks:** skip JavaScript triggers in projects without JavaScript tests (furedea/dotfiles[#161](#161)) ([dc80e28](dc80e28)) * **hooks:** skip verification for a language whose project was removed ([#6](#6)) ([4a9f325](4a9f325)) * **hooks:** support relocated harness assets (furedea/dotfiles[#82](#82)) ([59057bc](59057bc)) * **hooks:** treat any gh api call without write flags as a read (furedea/dotfiles[#201](#201)) ([3ecb215](3ecb215)) * **hooks:** treat glob characters inside double quotes as literal for literal_words rules ([#41](#41)) ([174a7f9](174a7f9)) * **hooks:** use agent-neutral guidance ([37153ce](37153ce)) * improve agent notifications and session setup (furedea/dotfiles[#92](#92)) ([9bf2349](9bf2349)) * load secret patterns from hook directory ([ca465ef](ca465ef)) * migrate dotfiles path to ghq convention ([faff774](faff774)) * **nix:** build CPython 3.15.2 for the ssl eMudhra denylist ([#113](#113)) ([faba045](faba045)) * **nix:** default editor to Neovim (furedea/dotfiles[#105](#105)) ([2a9a22a](2a9a22a)) * resolve hook directory from bash source ([c6ca454](c6ca454)) * restore SSH signing and reliable Bats verification (furedea/dotfiles[#91](#91)) ([891adce](891adce)) * **sandbox:** deny writes to every repository's git hooks and config (furedea/dotfiles[#298](#298)) ([1941513](1941513)) * **sandbox:** match the Codex plugin script under any numeric version (furedea/dotfiles[#302](#302)) ([a49ddc3](a49ddc3)) * **security:** allow the Go checksum tree head and vulnerability database in the sandbox ([#59](#59)) ([af6e158](af6e158)) * **security:** ask for every script a non-bash shell receives ([#99](#99)) ([f88f8fd](f88f8fd)) * **security:** close quoted-argument and wrapper bypasses in the command guard ([#76](#76)) ([5f72757](5f72757)) * **security:** close the remaining command guard bypasses ([#83](#83)) ([0387739](0387739)) * **security:** decide not-a-fork for project rules on hosts without gh ([#67](#67)) ([acaa758](acaa758)) * **security:** keep agent-browser and agent-desktop calls inside the sandbox ([#64](#64)) ([3f2d578](3f2d578)) * **security:** read more of the scripts handed to fish and PowerShell for deny rules ([#110](#110)) ([2c652bb](2c652bb)) * **skills:** audit Codex skill observations (furedea/dotfiles[#88](#88)) ([f429967](f429967)) * **skills:** refine routing triggers from audit ([cef3b9c](cef3b9c)) * **tests:** make git test wrappers exec the real git binary (furedea/dotfiles[#310](#310)) ([893c405](893c405)) * **tests:** stop shifting past the codex wrapper arguments ([eb0f6d7](eb0f6d7)) ### Performance Improvements * **hooks:** evaluate policy regexes with one grep and run pytest in parallel (furedea/dotfiles[#125](#125)) ([ce80ea3](ce80ea3)) --- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
agent-browserとagent-desktopをサンドボックスの外で実行できるようにし,許可リストにある通常の形式は最初の呼び出しからプロンプトなしで実行する.危険な形式だけを例外として拒否または確認に回す.当初はセッションごとに最初の 1 回だけ確認する方式(session grant)を実装したが,grant を保存する状態ファイルと PostToolUse の確認処理が必要で,節約できるのが 1 回のプロンプトだけのため,費用に見合わないとして取りやめた(計画コメント).ブランチの履歴からも grant の実装は除いてある.
変更前後
agent-browser open https://example.com,snapshot -i,click @e1などallow(サンドボックス外)agent-desktop snapshot --app Finder -i,click @s…:e8,list-appsなどallow(サンドボックス外)file:/chrome:の URL,ターミナル・設定・認証情報アプリdenyask(Codex ではdeny)ask例外
常に拒否(
agents/hooks/rules/forbidden_commands.json)agent-browser: 引数中のfile:/chrome:.大文字小文字,クォートの分割(fi''le:),evalのスクリプト内も含む.agent-desktop: ターミナル類(Ghostty,Terminal,iTerm2,Warp,Alacritty,kitty,WezTerm,Hyper,Tabby),システム設定,Keychain Access,Passwords,1Password,Script Editor,Automator,Shortcuts.英語名・日本語の表示名(システム設定,ターミナル,キーチェーンアクセスなど)・バンドル ID・パスのいずれでも拒否する.常に確認(
agents/hooks/rules/allowed_commands.json)agent-browserconnect,--cdp,--auto-connect)--profile,--state,--restore,--session-name,state)--args,--config,--executable-path,--extension,--init-script,--allow-file-access,--provider/-p)upload,download,--download,wait -d,--download-path)screenshot/pdf/traceの出力先など,サンドボックス外への書き込み)diff(--baselineでホスト上のファイルを読む),doctor(--fixで再インストールや状態の削除)plugins,mcp,chat,batch,auth,install,upgradeなど許可リストにないサブコマンドと別名agent-desktop--appのない snapshot 系,--window-id,--headedpressやマウスなど,フォーカス中のウィンドウや画面座標への入力batch,launch,permissions --request/--guideenvなどのラッパー,クォートでサブコマンドやオプションを隠す形式Codex での挙動
Codex のフックは
askを返せずdenyに変換するため,確認対象の形式は Codex では常に拒否される.許可リストの形式は Codex でもcommand_permissions.jsonの allow プレフィックスと execpolicy で許可される.excludedCommandsは Claude の設定なので,Codex では両 CLI はサンドボックス内で動き,ブラウザーやアプリの操作は失敗しうる.引数から判定できないこと
agent-desktopの ref を使う操作は,どのアプリの ref か引数から分からない.ref の出どころの snapshot 側を--app必須にして絞ったが,ユーザーが手動で承認した snapshot(例:--appなし)で得た ref は,その後確認なしで操作できる.evalの中で実行時に組み立てた URL は見えない.=/や/を含む引数は安全側に倒して確認になる.検証
uv run pytest -q: 3200 passed,1 skippedtests/hooks/test_browser_desktop_automation.py: 通常の形式の許可,すべての例外の拒否・確認(90 ケース)verification_session.py verify: passeddiff snapshot --baselineでのファイル読み出し →diffを許可リストから外したpdf/screenshot等の出力先でのサンドボックス外書き込み → 絶対・ホーム・親ディレクトリのパスを確認にwait --download/wait -d→ 確認に--provider/-p→ 位置によらず確認にdoctor --fix→doctorを許可リストから外したRefs furedea/dotfiles#377
🤖 Generated with Claude Code