Implement working directory scope locking for ADF agents
まだ誰も着手していません。
評価
調査の方向性
Start with item 2.2 in cto-executive-system/plans/adf-architecture-improvements.md and the ManagedAgent model, then trace the PostToolUse hook, structured envelope, and NightwatchMonitor integration, noting dependencies #688 and #689. Done means working-directory binding, traversal and symlink escape rejection, scope-violation events, and the listed scope-negative tests all work before deployment.
索引モデルが issue の本文から書いたものです。
説明
Context
ADF agents currently have unrestricted filesystem access on bigbox. There is no mechanism to prevent an agent from reading or writing files outside its assigned working directory. Piwork (ferologics/Piwork) implements a robust scope locking model: one-time bind of working folder per task, traversal/symlink escape blocking, and a dedicated scope-negative test suite.
Proposal
Scope Locking
- One-time bind: once an agent is assigned a
working_dir, it is locked for the session - Record
scope_locked: boolinManagedAgent - Reject any attempt to change working directory after binding
Escape Prevention
- Block
..path traversal in file operation arguments - Block symlink escapes (symlinks pointing outside scope)
- Log violations to NightwatchMonitor as security events
Scope-Negative Test Suite
- Attempt traversal:
../../../etc/passwd-- must fail - Attempt symlink escape: create symlink pointing outside scope -- must fail
- Attempt working_dir change after lock -- must fail
- All tests must pass as prerequisites for agent deployment
Integration
- With Agent SDK (#689):
PostToolUsehook inspects file paths - With subprocess model: parse file paths from structured envelope (#688)
- NightwatchMonitor: new signal type for scope violations (alongside drift and error rate)
References
- Piwork permissions model: https://github.com/ferologics/Piwork/blob/main/docs/permissions-model.md
- Piwork scope-negative tests:
mise run test-scope-negative - KB article:
cto-executive-system/knowledge/external/context-engineering/piwork-desktop-ui-for-pi-agent.md - Plan:
cto-executive-system/plans/adf-architecture-improvements.md(item 2.2) - Depends on: #688 (RPC envelope) or #689 (Agent SDK)
- 主要言語
- Rust
- スター
- 62
- フォーク
- 5
- 平均マージ
- 2時間 27分
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
terraphim/terraphim-ai のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
terraphim/terraphim-ai#885 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
terraphim/terraphim-ai#871 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
terraphim/terraphim-ai#810 · コメント 2 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
terraphim/terraphim-ai#729 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
terraphim/terraphim-ai#728 ·
terraphim/terraphim-ai の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
bug core
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW オープンfuzz
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ClickHouse/ClickHouse#122114 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
linebender/vello_svg#90 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100