Skip to content

Implement working directory scope locking for ADF agents #690

Description

@AlexMikhalev

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions