Skip to content

fix(sandbox): match the Codex plugin script under any numeric version - #302

Merged
furedea merged 2 commits into
mainfrom
fix/codex-plugin-version
Oct 23, 2026
Merged

furedea merged 2 commits into
mainfrom
fix/codex-plugin-version

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

概要

Codex プラグインのバージョンが上がるたびに excludedCommands が合わなくなる問題を直す.excludedCommands のバージョン部分を * にし,guard_command.py が厳密なパス(Path.home() で展開した絶対パス.引用符付きのリテラル ~ は node が cwd 相対で解決するため拒否)だけを許可する.

変更前後

項目 変更前 変更後
excludedCommands node "/Users/kaito/.claude/plugins/cache/openai-codex/codex/1.0.3/scripts/codex-companion.mjs" * node "~/.claude/plugins/cache/openai-codex/codex/*/scripts/codex-companion.mjs" *
guard のパス検査 ファイル名が codex-companion.mjs なら許可 <home>/.claude/plugins/cache/openai-codex/codex/<数字>.<数字>.<数字>/scripts/codex-companion.mjs(Path.home() で展開した絶対パス)だけ許可
拒否するもの なし ..,別ディレクトリ,別ファイル,数字でないバージョン

確認事項

  • ドキュメント上,excludedCommands は Bash(...) の権限ルールと同じ構文で,途中の * に対応すると読める.ただし sandbox.excludedCommands の設定リファレンス本体は読めず,先頭の ~/ の展開についても記載がない.
  • そのため,switch 後に親が実際の呼び出しで,~/ と途中の * が合うことを確かめる.

受け入れ条件

  • guard のテストを先に書き,失敗を確認してから実装した
  • 正しいバージョンの絶対パスを許可し,引用符付きのリテラル ~ を拒否する
  • ..,別ディレクトリ,別ファイル,数字でないバージョンを拒否する
  • 単一コマンド,$ なし,バッククォートなしの既存ルールを維持する
  • uv run pytest tests/agents 2345 件成功
  • lefthook run pre-commit --all-files 成功
  • switch 後に Codex プラグインの呼び出しが sandbox の外で動くことを親が確認する

Closes #301

🤖 Generated with Claude Code

furedea and others added 2 commits October 23, 2026 13:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…script

A quoted ~ is not expanded by the shell, so node resolves it relative to
the writable cwd and would run a planted script outside the sandbox.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@furedea-agent
furedea-agent Bot force-pushed the fix/codex-plugin-version branch from bdc2bd8 to 82625f0 Compare October 23, 2026 04:17
@furedea
furedea merged commit ba597ec into main Oct 23, 2026
11 checks passed
@furedea
furedea deleted the fix/codex-plugin-version branch October 23, 2026 04:58
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.

Codex プラグインの呼び出しを,プラグインのバージョンに依存せず sandbox の外で動かす

1 participant