四款 AI 编程 Agent 插件自动更新怎么关
Plugin4Shell 利用默认开启的插件自动更新在零点击下替换 pin。2026 年 9 月在 Claude Code、Codex、Copilot、遗留 Gemini CLI 上减面与关更新的可执行对照。

The Register 与 Air Security 在 2026 年 9 月 Plugin4Shell 披露中反复提到:Claude Code 与 Codex 默认会自动更新已安装的 marketplace 插件。攻击者 upstream 替换 pin 指向的 commit 后,Agent 可能在无确认对话框的情况下拉下恶意 tree。升级 client 到已修版本是第一优先,但在 Copilot 仍无补丁、或企业变更窗口未到时,关自动更新 + 减插件数量是少数能立刻做的杠杆。
Claude Code
先确认 claude --version ≥ 2.1.179(见 升级步骤)。
在 settings 或 /config 中查找 plugin marketplace / auto-update 相关项(2.1.x 文档将 auto update 列在 plugin 配置段)。若 UI 无开关,策略改为:仅安装组织 mirror 插件;升级 Claude Code 版本时人工 diff 插件目录 hash。
卸载长期未用的 --plugin-dir 批量目录里的 stale 子包,见 2.1.265 plugin-dir。
OpenAI Codex
Floor 版本 0.146.0(Plugin4Shell 总览)。codex --version 检查后:
npm update -g @openai/codex
Codex 插件面板若提供 “automatically update plugins”,在升级窗口外设为 off。企业镜像应 pin codex 版本与插件 lockfile 一并审批。
Codex 与 GitSpawn CVE 升级 共用发布节奏,一次 change ticket 打齐。
GitHub Copilot
截至 2026 年 9 月无 client patch,关自动更新依赖 VS Code / Copilot 设置中与 extension 或 agent plugin 更新相关的选项(命名随渠道变,以 Microsoft 文档为准)。实质 mitigation 见 Copilot 无补丁文:删插件、禁第三方 marketplace。
Gemini CLI(遗留)
无修复版本。不要尝试「关更新保平安」;应 卸载并迁 Antigravity。
团队级策略模板
| 策略 | 目的 |
|---|---|
| 插件 allowlist | 新装需 ticket |
| pin 变更 PR review | 防 silent drift |
| 季度插件 census | 删僵尸包 |
| client 最低版本 MDM | ≥ Claude 2.1.277 / Codex 0.146.0 |
与仓库级 intake checklist 合并成一份「Agent 攻击面登记表」,审计时一次过。