Skip to content

feat(cli): guard the orchestrator's pane - #36

Merged
Bakhomious merged 1 commit into
mainfrom
step/guard-orchestrator
Nov 3, 2026
Merged

Bakhomious merged 1 commit into
mainfrom
step/guard-orchestrator

Conversation

@Bakhomious

Copy link
Copy Markdown
Contributor

What

Row guard-orchestrator: baton hook guard now rules the orchestrator's pane too, and the orchestrator's copilot runs with --allow-all (decision 54, the lead's call, flagged).

  • bash: baton's commands for the orchestrator (baton wait, answer, handover, status, help) run unasked. baton feature start answers ask while plan approval is on. Outward commands answer ask, so the user approves each push and pull request. tmux, osascript, other agents' CLIs, baton's other commands, programs that only the run decides and unreadable scripts are denied. A deny anywhere in a script wins; otherwise the first ask names the question.
  • create / edit: allowed only in the session's folder, session-state/<sessionId> under COPILOT_HOME or ~/.copilot, by the hook input's sessionId.
  • Config: new planApproval setting (default true; false turns the question off; null keeps the layer below). The guard reads the config only for a script that starts a feature.
  • Guard names: baton feature … and baton hook … are named by two words, so baton feature start stands apart from later baton feature commands.
  • The orchestrator keeps ask_user and copilot's folder-trust question (no --no-ask-user, no COPILOT_ALLOW_ALL). Its prompt now says that the guard asks the user, and what to do after a no.

Docs

docs/plan.md: new decision 54 and fact 37 (how copilot shows a hook's ask and what the agent gets after a no); amended decisions 8, 19, 45, 49 and 52, risk 3, the Safety, orchestrator and Config sections, and rows plugin-check (Done, #35) and guard-orchestrator. README: planApproval.

Checks

  • mise run check: green; internal/cli 99.8%, the guard files, internal/config and internal/guard at 100%.
  • Probes: 34 mutants (orchestrator rules, session folder, planApproval loading and layering, first-answer order, two-word names, --allow-all), all caught; two first failed to build and were rewritten, then caught.
  • Smoke: the built binary fed 20 hook inputs on stdin, with a temp HOME, COPILOT_HOME and repo, and no tmux: each ask, deny, silence and failure as designed, including the config turned off and a broken config file.
  • Live check, with the user's OK: an orchestrator pane on its own tmux server, Claude Haiku 5.5, a throwaway COPILOT_HOME and repo without a remote, 0.32 AI credits. The ask box showed for git push --dry-run (declined with feedback) and baton feature start (allowed, ran); a create in the session's files/ ran, one in the repo was denied. Everything temporary was removed afterwards.

Known gaps (decision 54)

The orchestrator's bash can still write any file and run local commands such as rm unasked (risk 3); web_fetch can send data in a URL; its extra tools run unasked; plan approval comes from the hook folder's repo, not from a repo the script cds into; baton feature start -h asks too.

In the orchestrator's pane, baton hook guard asks the user before outward commands and, while the new planApproval setting is on, before baton feature start; it lets the orchestrator's baton commands run, denies the other watched commands, and keeps create and edit in the session's folder. The orchestrator's copilot now runs with --allow-all (decision 54).
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@Bakhomious
Bakhomious merged commit 3765ff4 into main Nov 3, 2026
3 checks passed
@Bakhomious
Bakhomious deleted the step/guard-orchestrator branch November 3, 2026 23:12
Bakhomious added a commit that referenced this pull request Nov 4, 2026
A role's pane runs its copilot with a second belt behind the guard: env settings that make git's pushes out of the machine fail (pushInsteadOf rules to a missing remote helper, exact rules per remote URL, pushurls cleared) and gh fail (GH_CONFIG_DIR under /dev/null), with GH_TOKEN or GITHUB_TOKEN moved to COPILOT_GITHUB_TOKEN for copilot's own login (decision 55, fact 38, risk 2). Docs: rows guard-orchestrator Done (#36) and belt In review (#37), fact 37's start script fixed.

Merged under the user's standing OK of 2026-10-31.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant