Skip to content

work-items(work) + autonomy: unattended loop prompts the human — core git/gh verbs and out-of-tree write dirs missing from a shippable permission preflight #495

Description

@kyle-sexton

Lane: work (issue-execution loop, orchestrator dispatching per-issue subagents in out-of-tree worktrees) — also applies to source-control:babysit-prs
Category: operational

Triggering example

Running /work-items:work as an unattended /loop from a session whose cwd is the user's home directory (C:\Users\KyleSexton), not a repo clone. The orchestrator dispatched 4 implementation subagents, each of which: gh repo cloned the repo into a scratchpad temp dir, git checkout -b, git add/git commit, git push, gh pr create; the orchestrator itself ran gh issue comment / gh issue edit. Despite the session running in auto (acceptEdits) mode, the human was prompted to approve multiple operations — defeating the entire point of an unattended loop.

Observed vs expected

  • Observed: unattended loop repeatedly stops for human approval. Two independent causes:
    1. cwd is not a repo → all real work happens outside the workspace root. acceptEdits auto-approves Write/Edit only inside the workspace root. Subagents clone and edit under the scratchpad temp dir (outside the workspace), and no permissions.additionalDirectories entry covers it, so every out-of-tree file write prompts.
    2. The loop's core git/gh verbs are not in permissions.allow. acceptEdits never auto-approves Bash — only the allowlist does. The current global allowlist covers git worktree add, git fetch, gh pr merge/ready, gh search *, gh label list, but not the verbs every issue-execution cycle needs: gh repo clone, git checkout/git switch, git add, git commit, git push (non-force), gh pr create, gh pr view/gh pr diff, gh issue view/list/comment/edit/create. Each prompts, per subagent.
  • Expected: the autonomous work/babysit lanes ship a documented permission preflight so an operator can run them unattended without hand-approving routine git/gh operations — a canonical, security-reviewed allowlist recipe (force-push / --no-verify / destructive verbs stay denied) plus additionalDirectories guidance for the out-of-tree worktree/clone root, and ideally a loop-start self-check that detects "cwd is not a git repo" and "required grants missing" and surfaces the exact gap once, up front, instead of mid-cycle prompts.

Category

operational

Suggested fix direction

  1. Ship a copy-pasteable, security-reviewed permissions.allow recipe for the autonomous lanes (the verb list above), keeping the existing deny rails (force-push, --no-verify, git clean -fdx, reset --hard, secret reads) intact.
  2. Document a dedicated, trusted worktree/clone root (not the OS temp dir) and the matching permissions.additionalDirectories entry so out-of-tree edits are auto-trusted.
  3. Add a loop-start preflight in work (and babysit-prs) that detects cwd-not-a-repo and missing grants and reports the precise remediation once, rather than letting the loop discover it as per-operation prompts.

Related


Reference: Boris Cherny, "Steps of AI Adoption" (Google Doc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumReal value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions