Skip to content

fix: raise security-guard turn budget to avoid hard-cap 403#5484

Open
lpcox wants to merge 1 commit into
mainfrom
fix/security-guard-turn-budget
Open

fix: raise security-guard turn budget to avoid hard-cap 403#5484
lpcox wants to merge 1 commit into
mainfrom
fix/security-guard-turn-budget

Conversation

@lpcox

@lpcox lpcox commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses #5483 — an auto-generated "Security Guard failed" report for run 28107226319.

The Security Guard agentic workflow runs with max-turns: 6, which compiles to the api-proxy hard cap maxRuns: 6. A genuine security review of a PR diff exhausts that 6-call budget mid-task; the api-proxy then returns HTTP 403, which the Copilot CLI surfaces as a non-retryable authentication_failed error, failing the agent job.

Evidence from the failing run

  • Failure: Authentication failed with provider at http://172.30.0.30:10002 (HTTP 403) (port 10002 = Copilot api-proxy endpoint).
  • failureClass=authentication_failed, first-attempt → non-retryable.
  • The agent was mid-task (running git log, inspecting the diff) when it died: 136.1k tokens used (105.1k cached), +0 -0 changes — it never got to post its review.
  • awf-config for the run: apiProxy: { maxRuns: 6, maxCacheMisses: 5, ... }.

Fix

Raise max-turns from 612, in line with peer agentic workflows in this repo (doc-maintainer 8, red-team 8, smoke-claude 8, firewall-issue-dispatcher 10). This gives a review enough model round-trips to complete without tripping the proxy run cap.

Changes

  • .github/workflows/security-guard.mdmax-turns: 612
  • .github/workflows/security-guard.lock.yml — recompiled (maxRuns/GH_AW_MAX_TURNS → 12); post-processed
  • scripts/ci/security-guard-workflow.test.ts — updated pinned assertions

Testing

  • npx jest scripts/ci/security-guard-workflow.test.ts → 2 passed.

Fixes #5483

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

The Security Guard agent runs with max-turns: 6, which compiles to the
api-proxy hard cap maxRuns: 6. A real security review of a PR diff
exhausts that budget mid-task; the api-proxy then returns HTTP 403,
which the Copilot CLI surfaces as a non-retryable
"authentication_failed" error and the agent job fails (see #5483, run
28107226319: 136.1k tokens used, +0/-0 changes before the 403).

Raise max-turns to 12 (in line with peer agentic workflows: 8-10) so a
review can complete without tripping the proxy run cap. Recompiled the
lock file and updated the pinned assertions in
security-guard-workflow.test.ts.

Fixes #5483

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 24, 2026 15:14
@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.06% 98.10% 📈 +0.04%
Statements 98.00% 98.03% 📈 +0.03%
Functions 99.52% 99.52% ➡️ +0.00%
Branches 93.75% 93.75% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.7% → 94.5% (+1.82%) 92.7% → 94.5% (+1.82%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

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.

Pull request overview

Increases the Security Guard agentic workflow turn budget to prevent the api-proxy maxRuns hard-cap from aborting mid-review with a non-retryable HTTP 403 (as seen in #5483).

Changes:

  • Raised max-turns in .github/workflows/security-guard.md from 6 → 12.
  • Regenerated .github/workflows/security-guard.lock.yml so apiProxy.maxRuns and GH_AW_MAX_TURNS match the new limit (12).
  • Updated scripts/ci/security-guard-workflow.test.ts assertions to reflect the new turn budget.
Show a summary per file
File Description
.github/workflows/security-guard.md Bumps workflow max-turns to 12 to allow longer security reviews to complete.
.github/workflows/security-guard.lock.yml Updates compiled lock output (maxRuns + GH_AW_MAX_TURNS) to 12 to match the source workflow.
scripts/ci/security-guard-workflow.test.ts Updates pinned string assertions for the new max-turns / GH_AW_MAX_TURNS value.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0

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] Security Guard failed

2 participants