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: bool in ManagedAgent
- 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
References
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
working_dir, it is locked for the sessionscope_locked: boolinManagedAgentEscape Prevention
..path traversal in file operation argumentsScope-Negative Test Suite
../../../etc/passwd-- must failIntegration
PostToolUsehook inspects file pathsReferences
mise run test-scope-negativecto-executive-system/knowledge/external/context-engineering/piwork-desktop-ui-for-pi-agent.mdcto-executive-system/plans/adf-architecture-improvements.md(item 2.2)