The chown walks that run as root over a worktree the agent controls either cannot
be steered outside that tree, or the residual risk is recorded as accepted.
Evidence
internal/agentexec/harness_proc_unix.go:116, internal/app/agentworker/task_execution.go:121 and
internal/worktree/worktree.go:364,372 Lchown every entry of a worktree the agent owns while running as
root. Lchown does not follow symlinks, but the walk itself is not root-scoped, so
a directory swapped during the walk chowns outside the tree. os.Root does not
cover chown, so there may be no small fix. gosec G122 flags all four.
Stop when
[ ] Each walk is confined or root-scoped, or the decision to accept the race is
written here and the bead is closed.
Imported from beads archie-core-rzh5 · GitHub #1554 · type task · priority P2 · created 2026-10-08
## Goal
The chown walks that run as root over a worktree the agent controls either cannot
be steered outside that tree, or the residual risk is recorded as accepted.
## Evidence
internal/agentexec/harness_proc_unix.go:116, internal/app/agentworker/task_execution.go:121 and
internal/worktree/worktree.go:364,372 Lchown every entry of a worktree the agent owns while running as
root. Lchown does not follow symlinks, but the walk itself is not root-scoped, so
a directory swapped during the walk chowns outside the tree. os.Root does not
cover chown, so there may be no small fix. gosec G122 flags all four.
## Stop when
[ ] Each walk is confined or root-scoped, or the decision to accept the race is
written here and the bead is closed.
---
_Imported from beads `archie-core-rzh5` · GitHub #1554 · type task · priority P2 · created 2026-10-08_
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Goal
The chown walks that run as root over a worktree the agent controls either cannot
be steered outside that tree, or the residual risk is recorded as accepted.
Evidence
internal/agentexec/harness_proc_unix.go:116, internal/app/agentworker/task_execution.go:121 and
internal/worktree/worktree.go:364,372 Lchown every entry of a worktree the agent owns while running as
root. Lchown does not follow symlinks, but the walk itself is not root-scoped, so
a directory swapped during the walk chowns outside the tree. os.Root does not
cover chown, so there may be no small fix. gosec G122 flags all four.
Stop when
[ ] Each walk is confined or root-scoped, or the decision to accept the race is
written here and the bead is closed.
Imported from beads
archie-core-rzh5· GitHub #1554 · type task · priority P2 · created 2026-10-08