Skip to content

fix(workflows): harden /squad router authorization - #1868

Merged
bradygaster merged 1 commit into
devfrom
bradygaster-1730-router-hardening
Aug 25, 2026
Merged

fix(workflows): harden /squad router authorization#1868
bradygaster merged 1 commit into
devfrom
bradygaster-1730-router-hardening

Conversation

@bradygaster

Copy link
Copy Markdown
Owner

Summary

  • serialize /squad runs by issue or pull request with cancel-in-progress: false
  • keep only status, research, and /squad plan preview open; require authorization for every other recognized mode
  • fail closed on unresolved permissions and post an actionable refusal comment before any skill or mutating safe output runs
  • preserve the existing numeric issue-number and workflow-specific implementation dispatch guards

Authorization policy

For issue, issue-comment, and PR-review-comment triggers, the router checks github.actor through GitHub's effective collaborator-permission API and permits only write, maintain, or admin. Exact workflow_dispatch events rely on GitHub's native write-access requirement, which also preserves the controlled squad-implement-worker relay. Unknown modes and unresolved signals require authorization or refuse; there is no permissive fallback.

on.roles: all is intentional: current gh-aw defaults would otherwise silently pre-skip public actors before open modes or the explicit refusal comment can run.

Validation

  • 218 focused Vitest cases passed
  • targeted ESLint passed
  • strict gh-aw compilation passed in the installed .github/workflows layout
  • full npm run build passed in a clean proxy-backed scratch checkout
  • mutation check confirmed reopening triage makes the authorization suite fail
  • independent review found no correctness or security defects

gh-aw security review

Fresh-workspace compilation reported SQUAD_GITHUB_APP_PRIVATE_KEY and SQUAD_GITHUB_TOKEN as unapproved restricted secrets because the ephemeral compiler workspace had no prior gh-aw manifest. Both references already exist in the imported shared workflow; this PR adds, removes, or redirects no secrets or actions. The diff was reviewed for credential exposure and shell injection, and the actor/repository values remain env-bound rather than interpolated into shell source.

Working as Procedures (Prompt Engineer).

Closes #1730

Closes #1730

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 25, 2026 01:47
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #1868

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 3
Files added 0
Files modified 3
Files deleted 0
Modules touched 2

🎯 Risk Factors

  • 3 files changed (≤5 → LOW)
  • 2 modules touched (2-4 → MEDIUM)

📦 Modules Affected

root (1 file)
  • workflows/squad.md
tests (2 files)
  • test/gh-aw-command-parse.test.ts
  • test/gh-aw-quality.test.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 55cbecb

PR Scope: 🔧 Infrastructure

⚠️ 1 item(s) to address before review

Status Check Details
Single commit 1 commit — clean history
Not in draft Ready for review
Branch up to date Up to date with dev
Copilot review No Copilot review yet — it may still be processing
Changeset present No source files changed — changeset not required
Scope clean No .squad/ or docs/proposals/ files
No merge conflicts No merge conflicts
Copilot threads resolved No Copilot review threads
CI passing All checks passing

Files Changed (3 files, +265 −4)

File +/−
test/gh-aw-command-parse.test.ts +130 −3
test/gh-aw-quality.test.ts +45 −0
workflows/squad.md +90 −1

Total: +265 −4


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes match the stated authorization/concurrency policy and are backed by targeted tests that assert the new guard and concurrency configuration.

Pull request overview

This PR hardens the /squad router workflow by adding issue/PR-scoped concurrency serialization and a fail-closed actor authorization guard for mutating modes, while preserving open access for explicitly read-only modes and maintaining existing dispatch safeguards.

Changes:

  • Added issue/PR-scoped concurrency to serialize /squad runs with cancel-in-progress: false.
  • Introduced an explicit “Actor Authorization Guard” that permits only status, research, and plan without authorization; all other recognized modes require write/maintain/admin (or workflow_dispatch).
  • Added focused test coverage asserting the concurrency block, roles: all, and the authorization guard’s classification/decision behavior.
File summaries
File Description
workflows/squad.md Adds roles: all, concurrency serialization, and a documented/declared authorization guard for mutating modes with a refusal pathway.
test/gh-aw-quality.test.ts Adds parsing/assertions for the new concurrency block and validates roles: all.
test/gh-aw-command-parse.test.ts Adds behavioral tests for the authorization guard’s mode classification and permission decision logic.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bradygaster
bradygaster merged commit 078b545 into dev Aug 25, 2026
18 checks passed
@bradygaster
bradygaster deleted the bradygaster-1730-router-hardening branch September 9, 2026 19:44
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.

Phase 0a: Add issue-scoped concurrency and actor authorization to the /squad router

2 participants