Agent Skill 能在你装完几小时后,把你的 shell 交给陌生人 一、grith.ai 在 2026 年 9 月 7 日点出的核心问题 2026 年 9 月 7 日,grith.ai 发布一篇技术分析 "An agent skill can hand a stranger your shell – hours after you installed it"(HN 3pts,但技术深度极高

Agent Skill 能在你装完几小时后,把你的 shell 交给陌生人

一、grith.ai 在 2026 年 9 月 7 日点出的核心问题

2026 年 9 月 7 日,grith.ai 发布一篇技术分析 "An agent skill can hand a stranger your shell – hours after you installed it"(HN 3pts,但技术深度极高)。

文章开篇就点出 Agent Skill 的根本问题:

"An agent skill can bundle executable Python, Bash and JavaScript. Its specification defines the maximum length of its name, but provides no portable way to limit which files that code may read, which processes it may spawn or which hosts it may contact."

中文:Agent skill 可以打包可执行的 Python / Bash / JavaScript。规范定义了 name 的最大长度,但没有 portable 的方式来限制代码可读哪些文件、可生哪些进程、可联系哪些主机**。

更危险的是:用户装 skill 的时间和 skill 实际触发的时间是错开的

二、"progressive disclosure" 的安全时序问题

现代 Agent Skill 的工作模式叫 progressive disclosure:

  • 启动时,Agent 只看到每个 skill 的 name + description
  • 当某个任务匹配 skill 描述时,才加载完整 SKILL.md
  • 当 SKILL.md 指示运行时,才读支持文件、跑 bundled 脚本

这是好的 context management 设计,但安全时序有问题:

"The developer may inspect and install a skill on Monday. On Thursday, during an unrelated-looking repository task, the agent decides the description matches and activates it."

中文:开发者周一检查并安装一个 skill。周四,某个不相关的 repo 任务里,Agent 判定 description 匹配,激活了这个 skill

这就意味着:用户在周一安装时的安全审查,跟周四触发时的实际行为之间,有不可控的时间差

三、grith 描述的典型攻击链

grith 描述了一个完全不需要内存破坏漏洞的攻击链:

1. Skill 告诉 Agent "运行 `python3 scripts/report.py` 作为常规准备步骤"

2. 脚本搜索"能改进 report"的"配置"——读邻居项目的 `.env` / Git credential store / 云凭据文件

3. 把结果发到外部 endpoint,或者用开发者已认证的工具发布

4. 返回一个看起来正常的 report,用户看不到任何明显失败

关键点:这个攻击链不需要任何 memory-corruption exploit。Skill 只是让 Agent 用它已有的能力。Markdown 文件是一个延迟激活的代码执行控制面,在普通开发者权限下运行

四、SKILL.md 当前 spec 的根本缺陷

grith 文章细致分析了当前 SKILL.md frontmatter 5 个字段:

  • `name`、`description`:帮助 Agent 发现 / 选择 skill
  • `license`:管理分发
  • `compatibility`:环境要求的散文描述
  • `metadata`:任意字符串 map
  • `allowed-tools`:听起来像权限系统,但官方文档明确说"experimental, support varies between clients"

关键问题:`allowed-tools` 命名的是工具,不是权限:

  • `Read` 不回答"哪些路径"
  • `Bash(git:*)` 不回答"哪些 repo / remote / credentials"
  • 不规定子进程、DNS、监听 socket、密钥

加上 spec 单独定义 `scripts/` 作为可执行代码存放位置,并推荐 Python / Bash / JavaScript 作为常见选项——规范既给了"可执行代码的标准位置",又没给"代码效力的标准边界"

五、真实风险场景与对应权限缺口

grith 把"运行时权限"分成几个层次,每个对应一类实际威胁:

运行时权限恶意 skill 的后果
**只读 workspace,无网络,无密钥**主要风险是 prompt manipulation + workspace 内容泄漏
**workspace 写 + 包执行**源码篡改 + 依赖妥协
**home 目录读 + 外网**凭据 + 私有项目 exfiltration
**完整 shell + 跳过审批**开发者账户被攻陷 + 持久化
**CI runner + repo / deploy 凭据**

关键洞察:Native agent sandbox + 审批提示只在它们被启用且严格配置时起作用。它们不在 portable skill contract 里——同一个 skill 跑在不同 client 上,得不到一致的安全边界

六、生态已经在反应:packslip / Vett / Aguara / ClawCare / Samma Suit / SkillGuard

HN/技术圈在 2026 年 Q2-Q3 已经出现一批 skill 安全工具:

packslip(Jeff Dickey / mise 作者,2026-09-05)

  • signed release manifest
  • 把 versioned skill 与所文档化的软件关联
  • 签名验证 provenance(谁发布的),不验证 behavior
  • 文章原话:"A verified signature tells you where the instructions came from. It does not establish that those instructions are appropriate for your project."

Vett(2026-02,Show HN)

  • "Scan, sign, and verify AI agent skills before installing"
  • 提到 64k skills 在 Vercel skills.sh,Cursor / Claude Code / Windsurf 直接从 GitHub HEAD 拉取,没有 versioning / signing / scanning
  • 原话:"The supply chain attack nobody is talking about: skill.md is an unsigned binary."

Aguara / ClawCare(2026-02,Show HN)

  • 安全扫描器,检查 AI agent skill 和 MCP server
  • HTML 注释里的隐藏指令 / 零宽 Unicode 字符(U+200B-U+200F, U+2060-2064, U+FEFF)/ CSS 隐藏 / 双向文本覆盖——这些 LLM 能处理但人类看不见

Safeclaw(2026-02,Show HN)

  • OpenClaw skill 静态分析
  • 列举了所有"恶意 skill 类别"

Samma Suit(2026-02,Show HN)

  • 8 层安全框架包 agent
  • 包括"skills 能执行任意代码"作为重点

SkillGuard(grith 提到的研究方向)

  • 把 skill 当作 permission-bearing executable artefacts
  • manifests + deny-by-default runtime access control + behaviour monitoring
  • 评估显示 "减少了攻击成功率,但没减到零"

七、grith 自己的解法:OS-level 强制执行

grith 作者自己提供的产品 `grith` 是 OS-level 强制执行层:

grith exec --workspace-only -- claude
  • Skill 能让 Claude 跑 Python
  • Skill 不能让 Grith 相信 Python 的后续 syscall 没发生
  • Skill 告诉 Agent 做 X,Grith 评估:
  • 跑 bundled helper → 检查 process spawn / executable 来源 / 子进程树
  • 读 SSH key / .env / 云凭据 → 检查文件路径 / 敏感性 / 数据污染
  • 发数据 → 检查 DNS / 目标 / 端口 / egress 信誉 / 历史敏感读
  • 改文件 → 检查目标路径 / 操作风险 / 速率 / 销毁模式
  • 委托给 Docker / systemd-run → 检查权限 delegation 是否逃出 supervised tree

`--workspace-only` 模式下,项目外的文件系统访问被拒绝,即使绕开正常 read 路径。

八、对企业的现实启示

短期(立刻):

  • 重新评估 agent skill 安装流程——如果团队成员随意 `npx skills add ...`,等于让他们装未经审核的代码到自己的 dev 环境
  • 关注 SkillGuard / Vett / Aguara 等扫描工具——在 skill 安装前做静态 + 行为分析
  • 实施 OS-level 强制执行(类似 grith / Firecracker / bubblewrap)——即使 skill 想跑 Python,system call 必须受控

中期(3-6 个月):

  • 建立 skill 白名单 / 黑名单——企业内部维护"已审核的 skill 列表",员工只能从白名单装
  • 关注 SKILL.md spec 的"权限声明"扩展——grith 提的 manifest 思路 + packslip 的 signing 是两个并行方向
  • 关注 MCP / Skills supply chain 标准化——一旦有标准(如 Sigstore for skills),立即采用

长期(1 年+):

  • "Skill 供应链安全"会成为新的基础设施投资方向——跟 npm/pip/maven 一样,未来 5 年会有 Skill 安全扫描 + 签名 + 分发的标准化基础设施
  • Agent 治理委员会需要新增职责:Agent Skill 供应链审计——同等于"软件依赖审计"
  • 立法跟进——AI Agent Skill 误用导致公司损失的合规责任归属,目前完全空白

九、回到题目:Skill 是延迟激活的代码执行控制面

grith 文章原话点出了最深的判断:

"This is why the risk is higher than 'a Markdown file might contain a bad prompt'. The Markdown is a delayed control plane for code execution under ambient developer authority."

中文:这就是为什么这个风险高于"Markdown 文件可能含坏 prompt"。Markdown 是在普通开发者权限下,代码执行的延迟激活控制面**。

AI Agent Skill 的安全模型,不能套用传统软件供应链安全模型:

  • npm package:装上立即生效,行为透明
  • Docker image:运行前 review Dockerfile + image 层
  • Agent Skill:装上可能几天后才被 LLM 触发,触发时根据 prompt 上下文动态决定行为

这种"延迟 + 上下文敏感"的行为模式,是传统供应链安全工具根本没设计来处理的。

2026 年下半年,Agent Skill 安全会从"未充分研究的领域"变成"必须解决的工程问题"。任何继续把 Skill 当作"普通 Markdown 文件"对待的企业,会在 2026-2027 年遇到第一起 Skill 供应链攻击

准备时间不多了。