Skip to content

Security sub-agent should detect CI trust model expansions from dynamic config discovery #155

Description

@fullsend-ai-retro

What happened

On PR #145, the fullsend review agent's security sub-agent reviewed a change that replaced hardcoded agent names in functional-tests.yml with dynamic selection via select-eval-agents.sh. The agent found a GHEOF heredoc injection risk (medium) but did not flag a broader trust model concern.

A human reviewer (waynesun09's review squad) identified that the dynamic pattern means adding a harness/<name>.yaml + eval/<name>/eval.yaml pair in a single PR grants that eval config code execution with GCP WIF credentials and EVAL_GH_TOKEN — with no workflow file diff to signal the trust expansion to reviewers doing ok-to-test authorization.

The security sub-agent's prompt (skills/pr-review/sub-agents/security.md) has explicit guidance for permission expansion in workflow permissions: blocks and secrets: blocks, but does not cover the pattern where dynamic dispatch extends an existing trust boundary to new configuration files without modifying the workflow file itself.

What could go better

The security sub-agent should recognize that dynamic CI dispatch patterns (where configuration files control which code runs with secrets) create a new attack surface: any PR that adds a qualifying config file inherits the credential scope of the dispatch mechanism. This is analogous to the existing secrets: block check but operates at a higher level of abstraction — the workflow file grants credentials once, and configuration files determine who benefits.

Confidence: High. The human reviewer explicitly identified this as an unstated security tradeoff. The security sub-agent's own rules require flagging permission expansions even when internally consistent, and this qualifies — the blast radius of ok-to-test labeling expanded without a workflow diff to surface it.

Uncertainty: The security sub-agent may not have had visibility into the full pull_request_target trust model to reason about this. It may also be that this class of finding (architectural trust model shift rather than code-level vulnerability) is genuinely out of scope for a code-level security review.

Proposed change

Add a heuristic to the security sub-agent prompt (skills/pr-review/sub-agents/security.md) under a new section titled Dynamic dispatch trust expansion:

## Dynamic dispatch trust expansion

**Category:** `trust-model-expansion`

When the diff introduces or modifies a pattern where configuration files
(YAML, JSON, etc.) control which code runs in a CI workflow that has
access to secrets or cloud credentials, flag it as a trust model
expansion:

- Identify which secrets/credentials the workflow grants
- Determine whether adding a new configuration file would grant a new
  code path access to those credentials
- If yes, flag as **medium** with a note about the review safeguard
  implications (e.g., no workflow file diff for reviewers to notice)

This pattern commonly appears as: glob-based or directory-enumeration
loops that execute scripts based on config file presence, matrix
strategies populated from repository contents, or dynamic workflow
dispatch based on file discovery.

This complements the existing secrets: block and permissions: block checks by covering the indirect case where credentials are granted once and configuration files determine scope.

Validation criteria

On the next PR that introduces dynamic CI dispatch with credential inheritance (or when PR #148 is re-reviewed), the security sub-agent should produce a finding about trust model expansion. Verify by checking the security sub-agent's output in the review comment for a trust-model-expansion category finding.


Generated by retro agent from #145

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions