Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR optimizes the Security Guard agentic workflow to reduce token usage and tool round-trips by reusing already-computed PR metadata and increasing the amount of pre-fetched diff content included in the prompt.
Changes:
- Increase the pre-fetched diff limit from 5 KB → 100 KB and update truncation guidance to use
mcp__github__get_pull_request_diff. - Remove the redundant “Check security relevance” API call from the agent job and pass through the count from
check_security_relevancejob outputs. - Update prompt efficiency guidance to encourage batching tool reads and using the pre-fetched diff first.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/security-guard.md |
Raises diff prefetch limit, removes redundant relevance check step, and updates agent prompt guidance. |
.github/workflows/security-guard.lock.yml |
Regenerated compiled workflow reflecting the new diff limit and relevance count passthrough. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (4)
.github/workflows/security-guard.lock.yml:96
- This
uses:reference is no longer pinned to a commit SHA (it uses the mutable tag@v0.71.1). Lock workflows elsewhere in this repo pingithub/gh-aw-actions/setupto a full commit SHA; update this to the resolved SHA and recompile the lock file.
uses: github/gh-aw-actions/setup@v0.71.1
with:
.github/workflows/security-guard.lock.yml:344
- This job’s
github/gh-aw-actions/setupaction is referenced by tag (@v0.71.1) instead of a commit SHA, which defeats the purpose of the compiled lock file. Pin it to the resolved commit SHA and regenerate the lock file so all jobs use the same pinned ref.
uses: github/gh-aw-actions/setup@v0.71.1
with:
.github/workflows/security-guard.lock.yml:990
- This
github/gh-aw-actions/setupreference is tag-based (@v0.71.1) rather than SHA-pinned. For lock workflows, please pin to the exact commit SHA (and ensure the manifest/header list are updated accordingly) to avoid supply-chain drift.
uses: github/gh-aw-actions/setup@v0.71.1
with:
.github/workflows/security-guard.lock.yml:1112
- This
github/gh-aw-actions/setupuses:entry is tag-based (@v0.71.1) and should be SHA-pinned like other generated *.lock.yml workflows. Re-run compilation in an environment that can resolve tag→SHA (or manually set the resolved SHA) and commit the regenerated lock file.
uses: github/gh-aw-actions/setup@v0.71.1
with:
- Files reviewed: 2/2 changed files
- Comments generated: 2
| # gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"5f638c7a1f626a80c808afb016a775ce87a40f8ff2098ab08d778311c7286200","compiler_version":"v0.71.1","strict":true,"agent_id":"claude"} | ||
| # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"v0.71.1","version":"v0.71.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.29"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.29"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.25.29"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.29"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.0","digest":"sha256:9c2228324fb1f26f39dc9471612e530ae3efc3156dac05efb2e8d212878d454d","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.0@sha256:9c2228324fb1f26f39dc9471612e530ae3efc3156dac05efb2e8d212878d454d"},{"image":"ghcr.io/github/github-mcp-server:v1.0.2","digest":"sha256:26db03408086a99cf1916348dcc4f9614206658f9082a8060dc7c81ad787f4ba","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.2@sha256:26db03408086a99cf1916348dcc4f9614206658f9082a8060dc7c81ad787f4ba"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} |
There was a problem hiding this comment.
gh-aw-manifest now records github/gh-aw-actions/setup with sha:"v0.71.1", which is not a commit SHA. This breaks the lock-file’s action pinning and weakens supply-chain guarantees; resolve the tag to the actual commit SHA (as in other *.lock.yml files) and regenerate the lock file with the pinned SHA values.
This issue also appears in the following locations of the same file:
- line 95
- line 343
- line 989
- line 1111
| 1. **Review the pre-fetched diff below** (up to 100 KB of changes are included) | ||
| 2. **Batch all independent reads** in a single tool-use block rather than making sequential calls | ||
| 3. **Use `mcp__github__get_pull_request_diff`** only when the diff below is truncated and you need the remainder | ||
| 4. **Use `get_file_contents`** only for files not changed in this PR (e.g., to understand adjacent security context) |
There was a problem hiding this comment.
The instructions reference get_file_contents, but this workflow’s tool allowlist uses MCP tool names (e.g. mcp__github__get_file_contents). To avoid the agent attempting a non-existent tool, align the doc text/tool name with the actual allowed tool name.
| 4. **Use `get_file_contents`** only for files not changed in this PR (e.g., to understand adjacent security context) | |
| 4. **Use `mcp__github__get_file_contents`** only for files not changed in this PR (e.g., to understand adjacent security context) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot address the review feedback, merge main and recompile the workflows |
Done in da7ca13:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Smoke Test Results:
Overall: PASS
|
🔬 Smoke Test ResultsPR: perf(security-guard): eliminate redundant API call and raise diff pre-fetch limit to 100 KB
Overall: FAIL — pre-step template variables (
|
Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( PR author: Overall: FAIL — pre-step template variables (
|
|
fix: block Shocker container-escape syscalls in seccomp profile (CVE-2014-9357) Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Security Guard averaged ~376K tokens/run because the agent job re-fetched PR file metadata that the gate job already computed, and a 5 KB diff ceiling truncated almost every PR, forcing repeated
get_file_contentstool calls.Changes
Remove redundant
Check security relevancestep — the agent job was duplicating thegh api …/pulls/…/filescall already made bycheck_security_relevance. Replaced with a passthrough from the job output:Raise
DIFF_LIMIT5 KB → 100 KB — covers the full diff of typical security-relevant PRs, eliminating theget_file_contentsround-trips that drove up token counts.Update prompt efficiency guidelines — instruct the agent to batch independent reads in a single tool-use block, work from the pre-fetched diff first, and fall back to
mcp__github__get_pull_request_diff(notget_file_contents) only when the diff is truncated.Lock file regenerated via
gh aw compile+ post-processing.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/actions/github-script/git/ref/tags/v9/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv(http block)https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.71.1/usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.71.1 --jq [.object.sha, .object.type] | @tsv(http block)If you need me to access, download, or install something from one of these locations, you can either: