
Claude Code、Codex CLI、Gemini CLI、Grok Build 和 Antigravity 的 Skarn 插件:审计技能、守护钩子和 MCP 声明,在 AI 编码会话中发现泄露的秘密和凭证,...
概览
Skarn 守护是一个预执行钩子:在你的代理运行 shell 命令、应用补丁、写入文件、获取 URL、调用 MCP 工具或发送提示符之前,Skarn 检测引擎会返回拒绝、询问或允许。它会在本地扫描,不进行网络调用,也不打印原始秘密。 先安装 skarn 二进制;每个钩子都会调用 skarn guard 在 PATH 上。 按钮添加本地MCP服务器;桌面安装守卫。 这两个按钮都将服务器注册为 skarn,并从 PATH 运行 Skarn MCP,所以先安装二进制文件。如果你不想安装,置顶启动器表单只需节点存在:光标或 VS Code——它在第一次运行时下载 @skarn-security/[email protected],之后会重复使用npx缓存;更新的Skarn需要更新的链接。 这两个守护插件都包含了 skarn-audit 技能。
概述(AI 翻译)
Skarn 守护是一个预执行钩子:在你的代理运行 shell 命令、应用补丁、写入文件、获取 URL、调用 MCP 工具或发送提示符之前,Skarn 检测引擎会返回拒绝、询问或允许。它会在本地扫描,不进行网络调用,也不打印原始秘密。
安装
先安装 skarn 二进制;每个钩子都调用 skarn guard 在 PATH 上。
按钮添加本地MCP服务器;桌面安装守卫。
这两个按钮都将服务器注册为skarn,并从你的PATH运行skarn mcp,所以先安装二进制文件。如果你不想安装,置顶启动器表单只有Node存在时:光标或VS Code——第一次运行时下载@skarn-security/[email protected],之后重复使用npx缓存;更新的Skarn需要更新的链接。
| 主持人 | 指令 | 注意事项 |
|---|---|---|
| Claude Code | claude plugin marketplace add skarn-security/agent-guard``claude plugin install skarn-guard@skarn |
钩子将在你下一次会话中实时使用,而不是运行中的那场。 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Skarn guard: agent plugins
The Skarn guard is a pre-execution hook: before your agent runs a shell command, applies a patch, writes a file, fetches a URL, calls an MCP tool, or sends a prompt, the Skarn detection engine returns deny, ask, or allow. It scans locally, makes no network call, and prints no raw secret.
Install
Install the skarn binary first; every hook calls skarn guard on PATH.
brew install skarn-security/tap/skarn
The buttons add the local MCP server; the table installs the guard.
Both buttons register the server as skarn and run skarn mcp from your PATH, so install the binary first. If you would rather not install it, the pinned launcher form works with only Node present: Cursor or VS Code - it downloads @skarn-security/[email protected] on first run and reuses the npx cache afterward; a newer Skarn needs a newer link.
| Host | Commands | Caveat |
|---|---|---|
| Claude Code | claude plugin marketplace add skarn-security/agent-guard``claude plugin install skarn-guard@skarn |
The hooks are live in your next session, not the running one. |
| Codex CLI | codex plugin marketplace add skarn-security/agent-guard``codex plugin add skarn-guard-codex@skarn |
Choose “Trust all and continue” at the “Hooks need review” prompt, or the hooks stay off. A hook change asks again. |
| Gemini CLI | gemini extensions install https://github.com/skarn-security/agent-guard |
The root is itself the Gemini extension, because Google’s installer reads the manifest there, and carries the same hooks, skill, and MCP server. Install asks for consent and folder trust; answer both. |
| Antigravity CLI | git clone https://github.com/skarn-security/agent-guard``agy plugin install agent-guard/antigravity |
Fails closed; see Safety. |
安装
npx -y @skarn-security/[email protected] mcp配置
{
"mcpServers": {
"skarn": {
"command": "skarn",
"args": ["mcp"]
}
}
}