Skip to content

Restrict bash tools for read-only reviewer agents#37927

Merged
deyaaeldeen merged 1 commit intomainfrom
restrict-reviewer-bash-tools
Apr 1, 2026
Merged

Restrict bash tools for read-only reviewer agents#37927
deyaaeldeen merged 1 commit intomainfrom
restrict-reviewer-bash-tools

Conversation

@deyaaeldeen
Copy link
Copy Markdown
Member

What

Restrict the bash tool in 5 read-only reviewer workflows from unrestricted (bash: true) to an explicit safe-command allowlist. This causes gh-aw to compile --allow-tool shell(...) instead of --allow-all-tools, reducing the attack surface for prompt injection on pull_request_target workflows.

Changes

Agent Before After
archie bash: true bash: ["cat","date","echo","git:*","grep","head","ls","pwd","sort","tail","uniq","wc"]
dexter bash: true bash: ["cat","date","echo","grep","head","ls","pwd","sort","tail","uniq","wc"]
sentinel bash: true same as dexter
tester bash: true same as dexter
scribe (undeclared) same as dexter

dash and mgmt-review are unchanged — they need unrestricted bash for benchmarking and code fixes respectively.

Why

All reviewer agents run on pull_request_target and process untrusted PR content. With bash: true, the compiled lock file includes --allow-all-tools, granting the Copilot CLI agent access to file-write, file-edit, and arbitrary shell execution — none of which read-only reviewers need.

Verification

All 5 lock files now compile with explicit --allow-tool flags instead of --allow-all-tools:

  • --allow-tool github
  • --allow-tool safeoutputs
  • --allow-tool write
  • --allow-tool shell(cat), shell(grep), shell(head), etc.
  • archie additionally gets --allow-tool shell(git:*) for API report diffing

Resolves github/gh-aw#23198

Copilot AI review requested due to automatic review settings April 1, 2026 13:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens several read-only reviewer workflows by replacing unrestricted bash: true with an explicit shell-command allowlist so the compiled *.lock.yml uses --allow-tool shell(...) instead of --allow-all-tools, reducing exposure in pull_request_target contexts.

Changes:

  • Add explicit bash: allowlists to 5 reviewer workflow definition files (*.md).
  • Regenerate the corresponding 5 compiled workflow lock files (*.lock.yml) to pass explicit --allow-tool arguments to the Copilot CLI.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.github/workflows/tester.md Switch bash from unrestricted to an explicit allowlist for the Tester agent.
.github/workflows/tester.lock.yml Regenerated lock file to replace --allow-all-tools with explicit --allow-tool entries.
.github/workflows/sentinel.md Switch bash from unrestricted to an explicit allowlist for the Sentinel agent.
.github/workflows/sentinel.lock.yml Regenerated lock file to use explicit --allow-tool entries.
.github/workflows/scribe.md Declare an explicit bash allowlist for the Scribe agent (previously undeclared).
.github/workflows/scribe.lock.yml Regenerated lock file to use explicit --allow-tool entries.
.github/workflows/dexter.md Switch bash from unrestricted to an explicit allowlist for the Dexter agent.
.github/workflows/dexter.lock.yml Regenerated lock file to use explicit --allow-tool entries.
.github/workflows/archie.md Switch bash from unrestricted to an explicit allowlist (including git:*) for the Archie agent.
.github/workflows/archie.lock.yml Regenerated lock file to use explicit --allow-tool entries (including shell(git:*)).

Comment thread .github/workflows/tester.md
Comment thread .github/workflows/sentinel.md
Comment thread .github/workflows/scribe.md
Comment thread .github/workflows/dexter.md
Comment thread .github/workflows/archie.md
Replace `bash: true` (unrestricted) with explicit safe-command allowlists
for the 5 read-only reviewer workflows. This causes gh-aw to compile
`--allow-tool shell(...)` instead of `--allow-all-tools`, reducing the
attack surface for prompt injection on pull_request_target workflows.

Changes:
- archie: bash: ["cat","date","echo","git:*","grep","head","ls","pwd","sort","tail","uniq","wc"]
- dexter, sentinel, tester: bash: ["cat","date","echo","grep","head","ls","pwd","sort","tail","uniq","wc"]
- scribe: same (was missing bash declaration entirely)

dash and mgmt-review are unchanged (they need unrestricted bash for
benchmarking and code fixes respectively).

Resolves: github/gh-aw#23198

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@deyaaeldeen deyaaeldeen force-pushed the restrict-reviewer-bash-tools branch from 721b8a5 to 6ba47aa Compare April 1, 2026 17:03
@deyaaeldeen deyaaeldeen merged commit 4d309af into main Apr 1, 2026
19 checks passed
@deyaaeldeen deyaaeldeen deleted the restrict-reviewer-bash-tools branch April 1, 2026 20:42
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.

Feature: allow restricting Copilot CLI built-in tools via frontmatter

3 participants