Repository navigation
feat(pi): run Pi shell and file tools inside srt - #228
Conversation
Replace Pi's bash tool with an extension that wraps every command in srt, using a policy generated from the Claude sandbox source plus the runtime worktree and common git dir. Refuse to run when the policy is invalid. Refs #221 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Block read/write/edit targets outside the worktree or inside .git, and block file-tool calls when the hook times out, crashes or fails to spawn. bash keeps its existing behavior. Closes #221 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@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 summaryNo blocking findings (0 × P0/P1). Two P2 findings are posted inline:
The rest looks sound: the srt command quoting, the policy validation, the fail-closed behaviour on bad settings or a missing srt, and the symlink and 🤖 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: deaefb8c61
ℹ️ 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".
…ively Normalize a leading @, unicode spaces and ~ before the worktree check, and reject .git variants (case, trailing dots/spaces, git~1). Refs #221 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryI posted 3 inline findings. 1 of them blocks the merge.
The file-tool path checks themselves (symlink resolution, dangling links, 🤖 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: 03f071b587
ℹ️ 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".
- bash: build the srt policy per call cwd, skip Git entries outside a repository, and deny writes to a linked worktree's .git pointer file - hook bridge: a missing adapter no longer blocks bash or prompts; file tools still fail closed - file tools: ignore format characters, stream suffixes and 8.3 aliases when matching .git - nix: provide git to the check phase Refs #221 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
レビュー指摘への対応 (4377d36):
🤖 Generated with Claude Code |
|
@codex review |
|
Review summary (read-only) Found 1 blocking problem:
Other things I checked and found no problem with:
🤖 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: 4377d36ff7
ℹ️ 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".
…via node - rebuild the policy on every bash call so repository changes are seen - deny writes to cwd/.git unless it is a real directory - make the fake srt in tests independent of /usr/bin/env (nix sandbox) Refs #221 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summary1 blocking finding (P1) — see inline comment on
Not flagged:
Also: the PR says it was not tested against a real |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e5a154362
ℹ️ 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".
… allowWrite Refs #221 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary (read-only):
No other blocking issues found. The file-tool boundary, the fail-closed hook handling and policy validation look consistent with the PR description. As the description notes, nothing has been tested against a real 🤖 Generated with Claude Code |
|
@codex review |
Review summary1 blocking finding (P1)
I didn't find any other blocking problems. The policy generation, its validation, the |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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". |
…ubmodule git files Also read the Pi policy source from the parsed Claude settings. Refs #221 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
Review summary (read-only) Checked the new No P0/P1 findings. The design fails closed: missing
Blocking findings: 0 |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
Refs #221 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryI read the change without running it. 1 blocking finding (P1), 1 minor (P2).
Checked and found no problem:
🤖 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: a48c049609
ℹ️ 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".
Refs #221 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summaryBlocking findings (P0/P1): none. One P2, posted inline.
What I checked and found no problems in:
Note: 🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. 🎉 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". |
agent-harness を `37de3ac` に更新し,furedea/agent-harness#228(Pi の bash とファイル系ツールを srt 内で実行)を Pi に配る.srt 本体は #455 で導入済み. | 項目 | 現在 | 変更後 | | --- | --- | --- | | agent-harness | `e010600`(#228 を含まない) | `37de3ac` | | `~/.pi/agent/extensions` | `hook_bridge.ts` のみ | `bash_sandbox.ts`・`sandbox/file_operations.mjs`・`sandbox_policy.json` が加わる | ## 検証 - [x] `nix build .#darwinConfigurations.mba.system` が成功 - [x] 生成物に Pi の拡張と `sandbox_policy.json` が含まれ,`denyRead` に `~/.pi/agent/auth.json`,`network.deniedDomains` が出力されている <details><summary>範囲外</summary> - Pi の実機確認(ChatGPT プランが使えるようになってから) </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
🤖 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>
Closes #221
概要
Pi の bash と,ファイルを触るツール (read / write / edit / grep / find / ls) を,同じ生成済み srt 設定の下で実行する.許可はコード上のパス判定ではなく,カーネル (Seatbelt) が
allowWrite/denyWrite/denyReadで決める.bash_sandbox.tsが bash ツールを置き換え,全コマンドをsrt --settings <settings.json> -c <command>で実行する.operationsから,srt 内で動く小さな helper (file_operations.mjs) を呼ぶ.helper は信頼しない配管で,バグがあってもアクセスは広がらない.helper が無い,または設定が不正な場合は実行を拒否する.sandboxブロックと同じ設定元から生成し,~/.pi/agent/auth.jsonをdenyReadに加える.実行時に worktree と git common dir をallowWriteに追加し,.gitの hooks・config・pointer 類,ネストした.git,project の.piをdenyWriteにする.必須キーを全て出力し,検証に失敗したら実行しない.検証
cargo fmt --check/cargo clippy -- -D warnings/cargo test/npm test(fakesrt) が成功.ln <outside> <worktree>/x) がOperation not permittedで拒否されることを確認した.通常の書き込みは成功する対照も確認済み.追加の deny は不要.Linux (bwrap) では未確認.denyGlobRegexを持つ srt が必要 (nixpkgs 0.0.52 は不可).srt の導入は dotfiles 側のフォローアップ.🤖 Generated with Claude Code