Repository navigation
feat(codex): apply the secret path policy to the guarded filesystem - #233
Conversation
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Review summaryBlocking findings (P0/P1): none. P2 (one inline comment, Checked and found correct:
The PR already notes that relative patterns only match under the workspace root. That is narrower than the hook's matching, but the hook still covers those paths, so I didn't flag it. 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8feff6a130
ℹ️ 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".
|
@codex review |
Review summaryNo blocking findings (P0/P1: 0).
What I checked and found correct: converting read denials to I did not check this against Codex itself. The assumption that Codex accepts 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4762f1ea45
ℹ️ 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".
|
@codex review |
|
Review summary (read-only): no findings. I checked:
Tests cover each new branch, and the golden diff is limited to the expected 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f52b8799b1
ℹ️ 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".
Denied reads become none and write-only denials become read. The stricter access wins when a path is also protected. Relative patterns go under :workspace_roots. Rules Codex cannot express fail generation instead of emitting a rejected config. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Keep the stricter of a source-declared and a generated access for one path. Keep a scalar :workspace_roots grant as a . entry beside scoped rules. Read // as absolute, reject a single leading /, and match slash-free patterns at any depth as Claude does. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Compare source entries inside scoped tables with the generated ones. Raise generated children to a scalar source denial of their scope. Keep a write-only subtree rule such as secrets/** anchored at the root. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Raise each generated entry to the strictest source access that covers it: :root, :workspace_roots (scalar or dot entry), or a parent directory. Move the reconciliation into its own module. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
f52b879 to
5ca5865
Compare
|
@codex review |
Review summaryNo blocking issues (0 P0/P1).
I checked the rest and it looks right: the policy-to-Codex value mapping ( 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ca58656a0
ℹ️ 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".
… paths Model a guarded entry so only a denial may hold a pattern and a looser entry is one concrete path. Normalize ~, ., .. and separators once, then raise each looser entry to the strictest source or generated entry that covers it, by ancestor directory or by glob match. Replace the ad-hoc ancestor logic. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryI found no P0/P1 issues. The conversion rules, the Two P2s, posted inline:
Blocking findings: 0 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a6562ca85
ℹ️ 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".
…roups Reject braces in write-only rules, error on a generated looser entry that is not a concrete path, and widen a brace group that spans a slash to everything below. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
…tries Treat C:/ paths as absolute so Windows runtime roots generate. Read a looser entry ending in /** as its directory so it is raised like any other. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aebf34efbd
ℹ️ 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".
A rule that only denies writes is not rendered for Codex: its permissions apply to every process the agent starts, and harness scripts write the paths such rules guard. Hooks keep enforcing them. Remove the write-only rendering and its errors. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary (read-only) I found no P0 or P1 issues.
Everything else matched the PR description: write-only rules are left out of the Codex config, read-denying rules become I couldn't confirm against the Codex source whether |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
… looser one Codex uses the most specific entry. A looser entry that resolves through an in-between entry of the same access reopens nothing, so it is no longer a conflict. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryI reviewed this by reading the code. I could not run Blocking findings (P0/P1): none. P2 (1): Checked and found no problems in:
One behaviour change to be aware of: a source config with Tests cover the conflict shapes, write-only rules, entries that don't overlap, and path normalization well. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdd10c4c8b
ℹ️ 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".
Match {a,b} and [a-c] by their members instead of widening them.
Let / cover ~ entries. Drop a leading ./ and a trailing / before rendering for Codex.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Automated review summary I found no blocking issues, and nothing reached the bar for an inline comment. What I checked:
Minor notes, none blocking:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e0a1d18c2
ℹ️ 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".
Codex does not expand braces, so a read-denying rule with one fails generation. Treat a backslash as a path separator when normalizing guarded keys. Document that a project-local runtime root is not matched against the workspace. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryBlocking findings (P0/P1): 0
Things I checked that look correct:
The known limitations are documented in the PR body: project-runtime absolute protected paths are not compared against the workspace, and glob-vs-glob coverage is not checked. Since the secret policy is still enforced by hooks, I don't consider these blocking. 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab4dc154ef
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab4dc154ef
ℹ️ 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".
🤖 I have created a release *beep* *boop* --- ## [0.9.13](agent-harness-v0.9.12...agent-harness-v0.9.13) (2026-11-12) ### Features * **codex:** apply the secret path policy to the guarded filesystem ([#233](#233)) ([0830fd9](0830fd9)) * **pi:** run Pi shell and file tools inside srt ([#228](#228)) ([37de3ac](37de3ac)) ### Bug Fixes * dedupe the Nix socket in Pi's srt policy and name the failed sidecar write ([#237](#237)) ([1ccafe0](1ccafe0)) * fail on missing HOME, bound GitHub API waits, reject unknown hook keys ([#218](#218)) ([c0b936d](c0b936d)) * **install:** publish atomically and keep Claude settings keys the harness does not own ([#219](#219)) ([c914c76](c914c76)) * **pi:** confirm ask decisions and deliver skills, instructions, and settings ([#223](#223)) ([2e755af](2e755af)) --- 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>
## Issue Refs #235(レーン `guarded`).#233 で範囲外とした Codex の guarded パス照合の端のケースを直す. ## Plan #235 (comment) ## 変更 - 中間の例外:パスは「最も近い被覆エントリ」で解決する.`:root = "deny"` の下の `~ = "write"` は,その下の生成エントリの例外になる. - Windows 形式(ドライブ,UNC,Windows ホスト上のすべてのパス)は大文字と小文字を区別せずに比べ,`\` を区切りとする.それ以外では `\` はファイル名の文字. - 文字クラス末尾のハイフン(`[a-]`)を文字として残す(globset の `parse_class` に合わせた). - プロジェクト内インストールでは,ワークスペース内の絶対パスと `:workspace_roots` のエントリを同じ場所として照合する.`RuntimeRoot::project_directory` から渡し,ファイルシステムは読まない. - UNC を別のルートにした.照合のグロブ部分を `guarded_path/pattern.rs` に分離し,`docs/DESIGN*.md` を更新した. 各ケースを先にテストとして書いてから実装した. ## 検証 - `cargo test` 全件成功,`cargo clippy -- -D warnings`,`cargo fmt --check` 通過. - 実ソース(`agent-config/agents`)で,変更前(origin/main)と変更後の `install`(ホーム,`--runtime-root /work/proj`)の出力 370 ファイルが `diff -r` で完全一致. - CI:再レビューの上限(3 回)に達したため,`codex-review` は最後の指摘で失敗のまま(下記のフォローアップ).他のチェックは通過. ## 計画からの変更点 なし. ## フォローアップ(再レビューの上限で保留) - UNC のプロジェクトルートで,`rewritten_for` が `Root::Unc` を変換せず,`below` が常に `Root::Absolute` を作る.そのため UNC のプロジェクト内インストールでは `:workspace_roots` との照合が効かない. - Windows ホストで UNC の接頭辞を `\\` と `//` 以外の混在(`\/`,`/\`)でも認識する(自動セキュリティレビューの指摘). --------- Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Closes #232
計画:https://github.com/furedea/agent-harness/issues/232#issuecomment-6813519563(レーン
secrets)lookupsレーンの #234 はマージ済みで,これで #232 の受け入れ条件が揃う.概要
秘密パスのポリシー(
hooks/rules/secret_path_policy.json)を Codex の[permissions.guarded.filesystem]にも反映する.これまで Codex ではフックの検査だけが効いており,フックを通らないシェルからの読み取りは設定では止まらなかった.
変換規則
accessにreadを含む)"none"accessが["write"]だけ)~/と//x(絶対パス)はトップレベルのキー,相対パターンは[permissions.guarded.filesystem.":workspace_roots"]の下に置く./は Claude ではプロジェクト相対で曖昧なのでエラー./を含まない相対パターン(.env*)は**/を前置して任意の深さに一致させる."read")は変えない.書き込みのみのルールを Codex に出さない理由
Edit(...)の deny は Edit ツールにしか効かない.verification_session.pyは**/agent-harness/{verification,trusted-owners,audit}/**に書く.~/.local/state/agent-harnessへの書き込みは許すのと同じ扱い."read")エントリ」は生成されない.弱いエントリは保護パスだけになる.競合の検出(書き換えはしない)
Codex は具体的なエントリを優先する.そのため
secrets/** = "none"の下にsecrets/key = "read"があると,読み取りが開く.逆に,ソースが意図的に開けた例外(:root = "deny"の下の~/.codex = "read")を自動で閉じるのも誤りになる.どちらの意図かを推測して書き換えると,レビューで互いに逆向きの指摘が出たため,ガード用のエントリは書き換えず,競合を検出して生成を失敗させる.:workspace_roots = "write"の下に**/secrets/** = "none")は競合ではない.codex/config.toml(:workspace_rootsの入れ子の表を含む).ソースどうしの組は,ソースの作者のものなので検査しない.generation/guarded_path.rs:GuardedEntryはDeny(パターン可)かLooser(正規化済みの具体的パスのみ)で,パターンを持つLooserは作れない.パスは一度だけ正規化する(~,.,重複する/,..,ドライブレター).generation/guarded_conflict.rs:上の判定を生成側とソースの表に適用する.*,**,?)にした.globsetなどを足すとregex系の依存が増え,このリポジトリは依存を完全固定しているため.[...]と{...}は取りうる範囲に広げて扱い,覆う範囲が広がる方向(より厳しい側)にだけ誤る.--runtime-rootがプロジェクト)の絶対パスの保護エントリは,ソースの:workspace_rootsとは照合しない(ルールごとにルートを分けて比べるため).競合検出は安全網で,秘密ポリシーはフックが実行時に強制する.グロブどうしの包含は比べない(別のグロブより緩いグロブは検出できない).:tmpdirは実行環境で決まるためモデル化していない(:slash_tmpは/tmp).~は生成時にホームが分からないため記号のまま扱い,~/xと同じ場所を指す/Users/.../xは別のルートとして比べる.:workspace_roots = "write"を持ち,生成側が入れ子の表を出すときは,マージで消えないよう"." = "write"にする(意味は変えない).Codex のソースでの確認(根拠)
openai/codexの6bfdc75f0d9e6fae313234f694839866d7c63c39(main)をgh apiで読んだ.codex-rs/protocol/src/permissions.rs:FileSystemAccessModeはRead/Write/Deny.Denyは#[serde(alias = "none")]なので"none"は受理される.ただし「legacy input alias retained temporarily」と注記されている.同じ具体性の衝突ではdenyが勝つ.codex-rs/config/src/permissions_toml.rs:filesystem表はglob_scan_max_depthと,キーごとのFileSystemAccessModeまたは入れ子の表.codex-rs/core/src/config/permissions.rs:グロブを含むキーはdenyのときだけパターンとして扱われる.read/writeのグロブは末尾の/**だけ許され,それ以外はエラー.非 macOS で**を使う deny グロブはglob_scan_max_depth(すでに 5 を出力)が必要.codex-rs/core/src/config/permission_path.rs:トップレベルのキーは絶対パスか~/...か:始まりで,相対パスはエラー.相対パターンは:workspace_rootsの下の入れ子の表なら許される(.・..を含まない子孫パス).判断・注意点
"none"を出力した.alias が外れると設定の読み込みが失敗する(黙って緩むことはない).その場合は"deny"に切り替える.**の deny グロブはglob_scan_max_depth(既存の 5)までしか展開されない.それより深い秘密ファイルは設定では止まらず,フックの検査に頼る.:workspace_rootsの起点(プロジェクトルート)からの一致になる.テスト
:workspace_rootsの入れ子,生成側どうし(保護パスと読み取り禁止ルール)."none"になる.:root = "deny"の下の例外は,書き換えではなくエラーになる.guarded_pathの単体テスト:型の不変条件,正規化,祖先とグロブ,ルート間の独立,:root,波括弧,ドライブパス.tests/golden/complete_source/.codex/config.tomlに[permissions.guarded.filesystem.":workspace_roots"]と"**/secrets/**" = "none"が末尾に加わっただけ.他のプロバイダの生成物は変わらない.検証
cargo test:全件成功.ただしtests/pi_provider.rsのpi_bash_tool_runs_only_through_srt(pi_sandbox_smoke)は,この環境ではorigin/mainでも失敗する.cargo clippy -- -D warnings,cargo fmt --check:成功/Users/kaito/ghq/github.com/furedea/agent-config/agents,読み取りのみ)でgenerate-codex-config-sourceを実行:成功(競合なし,"none"が 26 件,書き込みのみのルールは出力に含まれない).フォローアップ(最終ラウンドの指摘.このPRでは直さない)
#235 で扱う.
guarded_path.rs(P2):間にある例外の判定は,緩いエントリと同じアクセスだけを受け入れる(==).より緩い間のエントリ(:root = "deny"の下の~ = "write")でも,生成されたreadは何も開かないのに「開く」というエラーになる.<=にして,テストを足す.guarded_path.rs(P1):Windows のドライブ付きパスを大文字小文字を区別して比べている(C:/WorkとC:/work).ドライブとコンポーネントを正規化して比べる.guarded_path.rs(P2):バックスラッシュを Unix でも区切りとして扱うため(直前の対応で入った),/work/project\\nameのようなファイル名の文字としてのバックスラッシュが区切りになり,兄弟パスが重なると誤判定する.Windows 形式のパスのときだけ区切りにする.対象外(フォローアップ)
#235 で扱う.
src/generation/pi_sandbox.rs).pi_sandbox_smoke(tests/pi_provider.rsのpi_bash_tool_runs_only_through_srt)が,この環境ではmainでも失敗する.src/generation/assets/pi/bash_sandbox.tsの jev-lint の指摘.🤖 Generated with Claude Code