Skip to content

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

Closed
remigiusz-antczak wants to merge 1 commit into
mainfrom
feat/agentic-actions-injection-2
Closed

remigiusz-antczak wants to merge 1 commit into
mainfrom
feat/agentic-actions-injection-2

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Supersedes #2300 (review fixes folded in, rebased on current main).

  • 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; token and secret reach named), agent-head-checkout (PR head checked out via actions/checkout, gh pr checkout or git fetch pull/N/head 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, any-user trigger).
  • One review question added to appsec-supply.md.
  • Tests: 12/12 (positive and decoy per rule, per review fix, plus the review_checks step).
  • 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: 12/12

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

Copy link
Copy Markdown
Collaborator Author

Superseded by #2303.

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