Skip to content

Add agent_workflow_injection check for AI-agent CI steps - #2303

Merged
remigiusz-antczak merged 1 commit into
mainfrom
feat/agentic-actions-injection-3
Nov 12, 2026
Merged

remigiusz-antczak merged 1 commit into
mainfrom
feat/agentic-actions-injection-3

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Supersedes #2301 (second review round folded in).

  • New scripts/agent_workflow_injection.py, run by review_checks.sh on changed workflows as tool agent-injection (leads, report-only, stdlib, line-based).
  • Rules: agent-untrusted-input (issue/PR/comment/branch/workflow_run text into a Claude, Codex, Gemini or Copilot step, directly or via job- or workflow-level env; base.ref is trusted and skipped), agent-head-checkout (PR head via actions/checkout ref or fork repository, gh pr checkout, or git fetch pull/N/head, with or without template expressions in the path, beside an agent under pull_request_target, issue_comment or workflow_run), agent-broad-tools (sandbox or approval off, unrestricted Bash incl. multi-line tool lists; disallowedTools is not a match, any-user trigger).
  • Agent CLIs split across backslash continuations are matched; rows are deduped per line and rule.
  • One review question added to appsec-supply.md.
  • Tests: 18/18 (a positive and a decoy per rule and fix, plus the review_checks step); the new round's tests fail against the previous script.
  • The review-config.md size-budget row is resynced to the size already on main, with a marker.

Flag names are matched as patterns and not re-verified against each vendor's current docs, hence "leads".

🤖 Generated with Claude Code

…sider text can steer

review_checks.sh now runs agent_workflow_injection.py on changed workflows (tool agent-injection). It lists as leads: issue, PR, comment, branch-name or workflow_run text interpolated into an AI-agent step (directly or through job- or workflow-level env, with the job's token and secret reach named), a pull-request head checked out (actions/checkout, gh pr checkout, git fetch pull/N/head) beside an agent under pull_request_target, issue_comment or workflow_run, and agent steps with sandbox or approval off, an unrestricted Bash tool, or an any-user trigger. appsec-supply.md gains the matching review question. Tests cover a positive and a decoy per rule plus the review_checks step.

Tests: 18/18

size-budget-raise: .claude/skills/deep-code-review/references/appsec-supply.md 10495→11005
size-budget-raise: .claude/skills/INDEX.md 18224→18362
size-budget-raise: .claude/skills/deep-code-review/INDEX-scripts.md 9383→9605
size-budget-raise: .claude/skills/deep-code-review/references/review-config.md 6472→6888

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@remigiusz-antczak
remigiusz-antczak marked this pull request as ready for review November 12, 2026 08:48
@remigiusz-antczak
remigiusz-antczak merged commit c2199eb into main Nov 12, 2026
11 checks passed
@remigiusz-antczak
remigiusz-antczak deleted the feat/agentic-actions-injection-3 branch November 12, 2026 08:49
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.

1 participant