Repository navigation
Lint roles: all workflows with threat detection disabled (CTR-005) - #78403
Conversation
New AW-AST rule untrusted-roles-detection (CTR-005) flags workflows whose on.roles is 'all' with untrusted-actor triggers while threat detection is disabled. Error in strict mode, warning with strict: false. The diagnostic recommends the nvx microVM sandbox. Re-enable threat detection in ai-moderator. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ Matt Pocock Skills ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Overview
Reviewed head 03cef159ecc50b14aebceed5c01fc55739a2bf6a against the compiler threat-detection contract (Version 1.0.102), including the changed CTR-005 mapping and supporting documentation.
Finding
- Blocking: The PR adds a normative
untrusted-roles-detectionCTR-005 obligation but does not update the specification version metadata orspecs/compiler-threat-detection-changelog.md. Section 10 requires the changelog update whenever Section 2/versioned specification content changes. Please synchronize the version and changelog before merge. An inline comment is attached to the changed contract row.
Coverage
Static review only; no tests or conformance scripts were run per reviewer policy. The captured PR head matched the metadata.
References:
specs/compiler-threat-detection-spec.md(CTR-005 mapping)specs/compiler-threat-detection-changelog.md(required companion history)
Generated by PR Specification Reviewer for #78403 · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review-specs to run again
🏗️ Design Decision Gate: ADR RequiredThis PR adds 225 lines in business-logic directories ( I pushed a draft ADR to the branch: Next step: review the draft, fix any The draft records the decision to add the
|
There was a problem hiding this comment.
Review summary
No actionable issues found in the changed lines. The specialist pass was unavailable because its file-read invocation was denied; I completed the independent review of the diff and relevant lint helpers.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again
Comment MemoryPeek at saved memory (spec-review-history)History |
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /codebase-design. Requesting changes on one behavior gap that contradicts the PR's own opt-out promise.
📋 Key Themes & Highlights
Key Themes
- Suppression gap (blocking):
gh aw lintreports CTR-005 even with a valid, unexpiredthreat-detection-suppressentry.gh aw compilehonors it. The changeset and PR body both advertise the opt-out. - Duplicated settings list:
untrustedRolesOnSettingsis a hand copy ofgatewayDispatchOnSettings. It matches today but has no drift guard. - Unreachable branch: the list-containing-
allcheck is defensive only. The JSON schema rejectsroles: [write, all], so the branch never fires through normal compile.
Positive Highlights
- ✅ Fail-closed default: unknown trigger keys count as untrusted.
- ✅ Detection-disabled logic covers compiled jobs, imports, and authored
threat-detection. - ✅ Lock file for
ai-moderatorrecompiles to an identical result. - ✅ Targeted lint and rule-contract tests pass.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.7K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
Critical gaps in imported and conditional threat-detection handling allow untrusted workflows to pass strict compilation and publish without inspection.
4 open issues
What changed in this PR
Adds the untrusted-roles-detection lint rule (CTR-005) to flag workflows that admit untrusted actors through on.roles: all while disabling threat detection.
Changes:
- Registers the rule with strict-mode errors, non-strict warnings, trusted-trigger exemptions, and NVX sandbox guidance.
- Adds focused tests, rule contracts, documentation, and a minor changeset.
- Re-enables threat detection for AI Moderator and regenerates its workflow.
| File | Description |
|---|---|
specs/compiler-threat-detection-spec.md |
Maps the new rule to CTR-005 and documents its analysis scope. |
pkg/workflow/lint/untrusted_roles_detection.go |
Implements role, trigger, and detection checks with sandbox guidance. |
pkg/workflow/lint/untrusted_roles_detection_test.go |
Covers policy forms, severity, NVX guidance, and compiled graphs. |
pkg/workflow/lint/rule_contract_test.go |
Adds safe and unsafe rule-contract cases. |
pkg/workflow/lint/README.md |
Lists the new rule constructor. |
pkg/workflow/lint/lint.go |
Registers the rule in the default runner. |
pkg/workflow/lint/lint_test.go |
Updates expected rule registration. |
docs/src/content/docs/reference/workflow-linters.md |
Documents rule behavior and limitations. |
docs/src/content/docs/reference/triggers.md |
Warns about unrestricted roles with disabled detection. |
docs/src/content/docs/reference/sandbox.md |
Recommends NVX for untrusted-trigger workflows. |
.github/workflows/ai-moderator.md |
Removes explicit threat-detection disablement. |
.github/workflows/ai-moderator.lock.yml |
Regenerates detection, publishing dependencies, and cache handling. |
.changeset/untrusted-roles-threat-detection.md |
Announces the new lint behavior and remediation options. |
Review effort: Max (dynamic)
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "1379295142239290e005b1dcc9c21d4ffb0ca58e",
"kind": "requested",
"schema_version": "1",
"state": "e02e375ae65cbec69f0f8bb7b722a95bcc3976a0af139af5a32ac673ad016fa3",
"work": [
"0204c31f9b14a76a05c2d555d79a64544ead6ca78108324188f0b1a600740744",
"07cffd2bfdd860840c68d82cc2c142ea599edfb531418b0905f0a918f6db913c",
"4ecf7a9401db0b7219a37acdfe95aabfcaa9f55678bb13732956062fca169da8",
"55a4115ba5acc5c2103c013a87f3ef7b51b68c2842cd148a27228a851e08bd7e",
"9f594ae95d5adfa764c160240a07277afde5f4dd6cc43fe5e10b543a63714758",
"ac55da1d1b84cdc54175b4648fd741fc3c41dc836f66093c6779ed55ad724697",
"ef690ccd87329c8747e249053474a076758a6988c54d4fecb3f5e310c05f8740"
],
"workflow": "pr-sous-chef"
}
|
|
Batch update in f0dbc17 addressing the conversation comments:
Validation: |
|
🎉 This pull request is included in a new release. Release: |



Why
Depi Security's Codex issue-labeler attack (https://depi.security/blog/20261111-backdooring-codex/) started with an untrusted user opening an issue. From there it went prompt injection -> shell access in the agent sandbox -> escape via host
/tmp(CoreCLR debug pipes) -> token theft -> Actions cache poisoning. The gh-aw equivalent ofallow-users: '*'ison.roles: all. When that is combined withthreat-detection: false, there is no detection layer between untrusted input and the agent's outputs. The AWF container sandbox also mounts host/tmpread-write, so on its own it does not contain this class of escape.What
New built-in AW-AST lint rule
untrusted-roles-detection(threat rule CTR-005). It runs duringgh aw compileandgh aw lint.on.rolesisall(scalar or list entry), threat detection is disabled, and at least one trigger can be fired by an untrusted actor.strict: false.push,schedule,workflow_dispatchandmerge_group. Unknown keys and command-style triggers count as untrusted, so the rule fails closed.safe-outputs.threat-detection(false,enabled: false,engine: falsewith no steps).threat-detection: falseor narrowroles. Unlesssandbox.agent.runtime: nvxis already set, it also recommends the NVX microVM sandbox. Using NVX does not exempt the workflow.threat-detection-suppressmechanism with CTR-005.Also in this PR:
ai-moderator.md: removedthreat-detection: falseand recompiled. It was the only workflow in the repo the rule flagged.specs/compiler-threat-detection-spec.md, and the lint README.Review notes
pkg/workflow(import cycle), so the list of gh-awon:setting keys is copied fromgatewayDispatchOnSettings. Keep the two in sync.ai-moderator.mdredirects togithubnext/agentics. The upstream copy needs the samethreat-detection: falseremoval, orgh aw updatewill bring the setting back and the workflow will fail to compile.Validation:
make agent-report-progresspasses. I also checked end to end with a built binary: compile fails in strict mode and warns withstrict: false.