What happened
On PR #1611, the review bot's initial review (May 27 17:38 UTC) found only medium/low findings: protected-path detection, incorrect prioritize path resolution, and a stale comment. Within 50 minutes, human reviewer waynesun09 found a CRITICAL bug: permissions: {} at workflow level blocks OIDC token minting in all per-org stage jobs because reusable workflows called via workflow_call cannot elevate beyond the caller's permission grant. waynesun09 also found HIGH issues: secrets: inherit exposing all repo secrets to the prioritize workflow, and prioritize.yml missing secrets: declaration under workflow_call. The bot's security sub-agent has detailed guidance for GHA workflow command injection and permission-expansion detection, but nothing about how permissions propagate (or fail to propagate) through workflow_call chains. The bot ran 3 more review cycles and never flagged these issues.
What could go better
The security sub-agent (skills/pr-review/sub-agents/security.md) covers permission expansion and role escalation in workflow files, but lacks specific knowledge about GitHub Actions' permission inheritance model for workflow_call. This is a well-documented platform behavior: called workflows inherit the caller's effective permissions as a ceiling, and cannot request elevated permissions. When a caller sets permissions: {}, all called workflows get zero permissions regardless of their own permissions: blocks. This pattern is distinct from issues #1275 (correctness-focused workflow_call chain tracing), #2658 (verifying tool permission requirements), and #2933 (CI security anti-patterns like verbose scanning). High confidence this is a systematic gap: the bot had 4 review cycles and never caught it, and #898 documents the same class of gap on another large PR.
Proposed change
Add a 'workflow_call permission inheritance' section to skills/pr-review/sub-agents/security.md with these checks: (1) When a workflow sets permissions: {} or restrictive permissions at the workflow level, verify that all jobs calling reusable workflows via uses: have explicit permissions: blocks granting what the called workflow needs (especially id-token: write for OIDC). (2) Document that the caller's effective permissions are the ceiling — called workflows cannot exceed them. (3) Flag secrets: inherit as a least-privilege violation when explicit secret passing is feasible, with medium severity. (4) When a workflow_call trigger declares inputs: but not secrets:, and the caller passes explicit secrets, flag the missing declaration as a runtime failure.
Validation criteria
Run the security sub-agent against a test diff containing: (a) a workflow with permissions: {} at the workflow level and stage jobs calling reusable workflows without explicit permission blocks, and (b) secrets: inherit on one job while others pass secrets explicitly. The sub-agent should produce at least one high-severity finding about the permission inheritance gap and at least one medium finding about secrets: inherit.
Generated by retro agent from fullsend-ai/fullsend#1611
What happened
On PR #1611, the review bot's initial review (May 27 17:38 UTC) found only medium/low findings: protected-path detection, incorrect prioritize path resolution, and a stale comment. Within 50 minutes, human reviewer waynesun09 found a CRITICAL bug:
permissions: {}at workflow level blocks OIDC token minting in all per-org stage jobs because reusable workflows called viaworkflow_callcannot elevate beyond the caller's permission grant. waynesun09 also found HIGH issues:secrets: inheritexposing all repo secrets to the prioritize workflow, andprioritize.ymlmissingsecrets:declaration underworkflow_call. The bot's security sub-agent has detailed guidance for GHA workflow command injection and permission-expansion detection, but nothing about how permissions propagate (or fail to propagate) throughworkflow_callchains. The bot ran 3 more review cycles and never flagged these issues.What could go better
The security sub-agent (
skills/pr-review/sub-agents/security.md) covers permission expansion and role escalation in workflow files, but lacks specific knowledge about GitHub Actions' permission inheritance model forworkflow_call. This is a well-documented platform behavior: called workflows inherit the caller's effective permissions as a ceiling, and cannot request elevated permissions. When a caller setspermissions: {}, all called workflows get zero permissions regardless of their ownpermissions:blocks. This pattern is distinct from issues #1275 (correctness-focused workflow_call chain tracing), #2658 (verifying tool permission requirements), and #2933 (CI security anti-patterns like verbose scanning). High confidence this is a systematic gap: the bot had 4 review cycles and never caught it, and #898 documents the same class of gap on another large PR.Proposed change
Add a 'workflow_call permission inheritance' section to
skills/pr-review/sub-agents/security.mdwith these checks: (1) When a workflow setspermissions: {}or restrictive permissions at the workflow level, verify that all jobs calling reusable workflows viauses:have explicitpermissions:blocks granting what the called workflow needs (especiallyid-token: writefor OIDC). (2) Document that the caller's effective permissions are the ceiling — called workflows cannot exceed them. (3) Flagsecrets: inheritas a least-privilege violation when explicit secret passing is feasible, with medium severity. (4) When aworkflow_calltrigger declaresinputs:but notsecrets:, and the caller passes explicit secrets, flag the missing declaration as a runtime failure.Validation criteria
Run the security sub-agent against a test diff containing: (a) a workflow with
permissions: {}at the workflow level and stage jobs calling reusable workflows without explicit permission blocks, and (b)secrets: inheriton one job while others pass secrets explicitly. The sub-agent should produce at least one high-severity finding about the permission inheritance gap and at least one medium finding aboutsecrets: inherit.Generated by retro agent from fullsend-ai/fullsend#1611