Skip to content

Align workflow tool allowlists with required operations - #67472

Merged
pelikhan merged 2 commits into
mainfrom
copilot/aw-top-10-fix-tool-allowlists
Oct 10, 2026
Merged

pelikhan merged 2 commits into
mainfrom
copilot/aw-top-10-fix-tool-allowlists

Conversation

Copilot AI commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Several workflows were denied required shell, Actions-read, or review-write tools. The Codex MCP test also treated integrity-filtered issue data as a tool failure.

  • Review writes: Allow safeoutputs in the PR reviewer and direct it to submit review comments and summaries through the CLI.
  • Shell tools: Add cut to the threat-spec optimizer’s allowlist and require exact missing-entry details in denial reports.
  • Actions reads: Enable the actions toolset for Avenger and use MCP tools instead of unauthenticated gh commands.
  • Integrity policy: Keep the Codex test’s trust filter intact; report filtered issue content as withheld rather than bypassing the policy.

Example review submission:

printf '%s' '{"pull_request_number":123,"event":"COMMENT","body":"Review summary"}' \
  | safeoutputs submit_pull_request_review .

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix tool allowlists that deny required tools Align workflow tool allowlists with required operations Oct 10, 2026
Copilot AI requested a review from pelikhan October 10, 2026 16:46
@pelikhan
pelikhan marked this pull request as ready for review October 10, 2026 17:32
Copilot AI balanced review requested due to automatic review settings October 10, 2026 17:32

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.

🟡 Changes recommended

The integrity-filtered fallback still requires issue numbers that the linked failure confirms are withheld.

1 open finding
What changed in this PR

Aligns workflow allowlists and prompts with required review writes, shell commands, Actions reads, and integrity-filtered results.

Changes:

  • Enables safeoutputs, cut, and GitHub Actions tools.
  • Replaces unauthenticated Actions CLI reads with MCP calls.
  • Preserves integrity filtering, though the fallback still incorrectly expects unavailable issue numbers.
File Description
.github/​workflows/​pr-code-quality-reviewer.md Routes review writes through the safeoutputs CLI.
.github/​workflows/​pr-code-quality-reviewer.lock.yml Regenerates the reviewer workflow.
.github/​workflows/​daily-compiler-threat-spec-optimizer.md Allows cut and improves denial reporting.
.github/​workflows/​daily-compiler-threat-spec-optimizer.lock.yml Regenerates the optimizer workflow.
.github/​workflows/​codex-github-remote-mcp-test.md Handles integrity-filtered issue results.
.github/​workflows/​codex-github-remote-mcp-test.lock.yml Regenerates the Codex test workflow.
.github/​workflows/​avenger.md Enables Actions MCP reads for CI diagnosis.
.github/​workflows/​avenger.lock.yml Regenerates Avenger with the Actions toolset.

🧠 Review effort: Balanced


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

- Number of issues retrieved
- Sample issue numbers and titles

When contents are filtered, say that sample titles are unavailable rather than inventing or bypassing the filter.
@pelikhan
pelikhan merged commit 9e12379 into main Oct 10, 2026
16 checks passed
@pelikhan
pelikhan deleted the copilot/aw-top-10-fix-tool-allowlists branch October 10, 2026 18:18
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed for PR #67472: the PR does not carry the 'implementation' label (has_implementation_label=false) and adds 0 new lines in default business logic directories (src/, lib/, pkg/, internal/, app/, core/, domain/, services/, api/), well under the 100-line threshold. No custom .design-gate.yml config is present (has_custom_config=false), so default rules apply. 8 files changed.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped. Changes are limited to workflow markdown files (.github/workflows/*.md) and their compiled lock files (.lock.yml).

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

no action

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #67472

@github-actions github-actions Bot mentioned this pull request Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-10T18:20:21Z
review_event: REQUEST_CHANGES
top_themes:
  - avenger-actions-tool-contract
  - reviewer-safeoutputs-json-serialization
files_reviewed:
  - .github/workflows/avenger.md
  - .github/workflows/codex-github-remote-mcp-test.md
  - .github/workflows/daily-compiler-threat-spec-optimizer.md
  - .github/workflows/pr-code-quality-reviewer.md
comment_count: 2

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 56.8 AIC · ⌖ 5.61 AIC · ⊞ 19.9K · ◷
Comment /review to run again

@github-actions github-actions Bot 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.

Request changes Two workflow-contract regressions still block this from doing what the PR claims.
Blocking themes
  • Avenger Actions triage: the prompt replaces unauthenticated gh usage with an Actions MCP call signature that does not appear to match the actual tool surface, so the fixer can still fail before reading the first bad job log.
  • PR reviewer write path: the new safeoutputs example inlines a multiline review body into JSON with printf; that is the exact quoting path the runtime warns against, and jq is not allowlisted to do this safely.
Those both leave the workflows broken at runtime, not just under-documented.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 56.8 AIC · ⌖ 5.61 AIC · ⊞ 19.9K
Comment /review to run again


Use the CI Run ID from pre-check and identify the first failed job and failing signal before running any local validation:
Use the GitHub Actions MCP tools, not `gh run view` (the agent's `gh` CLI is unauthenticated), and identify the first failed job and failing signal before running any local validation:

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.

This swaps out the unauthenticated gh call for an Actions MCP path, but the prompt now hard-codes a tool contract (actions_list with method: list_workflow_jobs and resource_id) that does not match the Actions tools gh-aw exposes, so Avenger can still fail before it ever reaches the job logs.

💡 Why this blocks the workflowThere is no prior-art usage of method: list_workflow_jobs or resource_id in this repo, while generated manifests expose Actions reads as dedicated MCP tools such as mcp__github__actions_list and mcp__github__get_job_logs. If the agent follows the literal contract here, it will burn a denial or validation error and noop instead of triaging CI. Please describe the actual tool shape the runtime exposes, or keep the step tool-agnostic instead of inventing parameter names.

@@ -154,7 +155,13 @@ You may use compact pseudo-language/encoding during private reasoning (examples:

### Step 4: Write Review Comments

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.

This sample command tells the agent to inline the review body directly into JSON with printf, which is exactly the fragile path that breaks once the body contains the required <details> block, quotes, or code fences, so the reviewer can still fail when it tries to post real findings.

💡 Why this is still brokenThe new prompt requires every inline review comment to be multi-line and to include structured markdown. The sandbox instructions explicitly warn against building long body strings inline because shell and JSON quoting become error-prone. The robust pattern is a heredoc plus jq -Rs, but this workflow does not allow jq in tools.bash, so the agent has no reliable way to follow the safe-output guidance you just moved it onto. Please switch the example to the heredoc-plus-jq -Rs pattern and add jq to the allowlist.

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs — one blocking concern about whether the Avenger fix addresses the actual root cause; everything else is solid.

📋 Key Themes & Highlights

Key Themes

  • Avenger root-cause risk: tools.github.toolsets now correctly includes actions (matches the actions: read permission already granted), but Step 3's body text still instructs gh run view ... --json jobs using the repo's gh CLI, while the PR description itself says "the agent's gh CLI is unauthenticated" for this workflow. If that's accurate, the repair step will keep failing the same way; if it's not accurate, the stated rationale for other changes in this PR is misleading. Also, the specific "name the exact allowlist entry" fallback text required by issue #67450's acceptance criteria was deleted from Step 3.
  • safeoutputs CLI wiring (pr-code-quality-reviewer): Correctly follows the established repo convention (seen in code-scanning-fixer.md, daily-code-debt-aider.md) of invoking safeoutputs via the bash CLI rather than the MCP tool directly, and the tools.bash allowlist addition matches.
  • threat-spec-optimizer / codex-mcp-test: Both changes are narrowly scoped, map directly to the named failure (missing cut, integrity-filter false-negative), and preserve existing guardrails (no broadening beyond what's needed, filter policy kept intact).

Positive Highlights

  • ✅ daily-compiler-threat-spec-optimizer.md: cut added to both the tool allowlist and the prose list, with a sensible instruction to preserve denial text rather than broadening the allowlist further.
  • ✅ codex-github-remote-mcp-test.md: Correctly treats integrity-filtered content as an expected policy outcome rather than a test failure, without bypassing the trust filter.
  • ✅ Compiled lock files were verified via local go run ./cmd/gh-aw compile — the diffs match source changes with no stray drift.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 129.9 AIC · ⌖ 15.8 AIC · ⊞ 10.3K
Comment /matt to run again

@@ -30,7 +30,7 @@ tools:
cli-proxy: true

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.

[/diagnosing-bugs] Good: toolsets: [default, actions] now matches the actions: read permission already granted at the top of this file, closing the denial. One gap remains — the "If an Actions tool is unavailable" fallback text (previously at the end of Step 3) that named the exact missing allowlist entry was deleted in this PR, even though the issue's "Done when" criterion requires "Missing tool reports name the exact allowlist entry to add." Consider keeping a short fallback note for future regressions (e.g. if actions toolset access is revoked again).

@copilot please address this.

```
1. Call `actions_list` with `method: list_workflow_jobs` and `resource_id` set to the CI Run ID from pre-check.
2. Identify the first failed job.
3. Call `get_job_logs` with that job's ID and inspect the failing output.

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.

[/diagnosing-bugs] This mandatory step still invokes gh run view "${{ needs.check_ci_status.outputs.ci_run_id }}" --json jobs using the agent's gh CLI, but line 87 of this same PR's description states "the agent's gh CLI is unauthenticated" and the companion Step-0 fallback at line 161 also reverts to raw gh run list. If that premise is true, this gh run view call will fail the same way the original bug (#67444/#67431) did, and the "If an Actions tool is unavailable" fallback guidance that named the exact tools.github.toolsets: [default, actions] entry was removed, so a future denial will no longer self-document the fix.

💡 Root cause check

Compare with the compiled lock file: toolsets: [default, actions] was reverted to [default] and GITHUB_TOOLSETS dropped actions, yet the body text keeps a gh run view/gh run list based repair flow instead of the actions_list/get_job_logs MCP calls that were in the issue's intended fix. If gh really is unauthenticated for this workflow, Step 0's and Step 3's gh run list/gh run view calls are dead code that will always fail, silently defeating the "CI self-healed" and "inspect failing run" branches. Verify whether gh is authenticated here (it may be, via GH_TOKEN as seen at line 63) — if so, document that explicitly instead of claiming otherwise elsewhere in the PR, since the inconsistency between the PR description and the body text is itself a latent regression risk.

@copilot please address this.

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.

[AW Top 10] 05 Fix tool allowlists that deny required tools

3 participants