Fix agentic workflow incident handling - #10722
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6babe228-0d10-48a1-84c8-583f7ff56281
There was a problem hiding this comment.
Pull request overview
Fixes agentic workflow incident handling for ResourceLock PR creation and Test Improver threat detection.
Changes:
- Routes ResourceLock PR branches through the automation fork using the machine-user credential.
- Prevents literal
-PR bodies and constrains threat-detection output. - Updates authentication documentation and regenerated workflows.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/test-improver.md |
Pins and constrains threat detection. |
.github/workflows/test-improver.lock.yml |
Regenerates the Test Improver workflow. |
.github/workflows/resource-lock-refactoring.md |
Configures fork-based PR creation and complete bodies. |
.github/workflows/resource-lock-refactoring.lock.yml |
Regenerates ResourceLock automation with PAT handling. |
.github/workflows/README.md |
Documents the authentication exception. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
There was a problem hiding this comment.
Note
🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.
✅ 22/22 dimensions clean — no findings.
This PR touches only agentic workflow sources (.md), their compiled lockfiles (.lock.yml), and the workflows README. No C# production code, tests, analyzers, MSBuild files, or PowerShell scripts are changed, so dimensions 1–14, 18–19, and 22 are N/A.
Applicable dimensions reviewed:
- Documentation Accuracy (17) — README updates accurately describe the new
BACKPORT_MACHINE_USER_PATsecret, its purpose, and the explicit-exception carve-out forresource-lock-refactoring. The new agent instruction ("Never pass--body -") is clear and addresses a concrete incident. - Build Infrastructure & Dependencies (20) — Both lockfiles were regenerated with
--strict(metadata confirms"strict":true). No action pins or container digests changed. TheBACKPORT_MACHINE_USER_PATsecret is added to the manifest, redaction list, and safe-outputs config consistently. Thecompiler_versionremainsv0.86.2across both lockfiles. - Scope & PR Discipline (21) — The PR addresses two related incidents (#10715 and #10711) and cross-references the recovered output (#10718). Changes are cohesive: one workflow gets cross-fork PR creation, the other gets a threat-detection pin. Both share the same root cause domain (agentic workflow incident handling).
- Security (9) — The PAT is an existing credential; the agent sandbox does not receive it. It flows only through GitHub Actions secret interpolation (
${{ secrets.BACKPORT_MACHINE_USER_PAT }}), standard secret redaction, and the safe-outputs handler config. The PR description's security review section is thorough and appropriately scoped.
Summary
nohwnd-bot/testfxwith the existing machine-user credential, allowing draft PR creation when the repository blocks the run-scopedGITHUB_TOKEN.-pull request bodies by requiring the complete Markdown body in the safe-output request.gpt-5-miniand require one complete, unformattedTHREAT_DETECTION_RESULTline.Fixes #10715.
Addresses the threat-detection
parse_errorrecorded in #10711. This is intentionally non-closing because #10711 is the automatically managed detection ledger.The output blocked by #10715 was recovered separately as draft PR #10718.
Security review
gh awreports one new restricted-secret reference:BACKPORT_MACHINE_USER_PAT.nohwnd-bot/testfxand open the PR againstmicrosoft/testfx.resource-lock/*branches, explicit allowed/excluded files, protected-file blocking, and patch file/size limits.Validation
gh aw compile resource-lock-refactoring test-improver --strict --approve --validate --no-emitpython .github/scripts/check_action_pins.py