@bas.io/guard

中文文档
0.33.1发布于 2026/10/27MIT零依赖构建来源已验证近 30 天下载 2817

Local, offline security scan for AI agent setups: audit the skills, MCP servers, hooks and permission grants an agent auto-loads, and vet one before installing it.

原始使用文档
文档目录4 节
  1. Use it
  2. The load-time gate needs a stable path
  3. What it is, and is not
  4. More

bas-guard

Local, offline security scan for AI agent setups — an "antivirus for your Claude Code configuration". It audits everything an agent auto-loads (skills, MCP servers, hooks, permission grants, subagents, slash commands, instruction files) and reports what carries risk.

It never executes what it scans and makes no network calls of its own. Scanning is read-only; the one command that writes (clean) only ever moves things inside your config root.

Use it

No install needed — the binary ships inside the package, so there is no install script and nothing is downloaded when you install it:

# vet one skill, plugin or zip BEFORE it reaches a directory an agent loads from
npx --yes @bas.io/guard@latest check ./some-skill

# audit everything the agent on this machine auto-loads
npx --yes @bas.io/guard@latest scan --report

check answers about the thing you point it at, so it means the same wherever you run it. scan answers about the machine it runs on — on your own computer that is your real ~/.claude, which is the point; in a hosted session or a CI container it describes that container instead, and the report prints a banner saying so rather than letting a near-empty box score close to 100 unremarked.

Keep it around for repeated use, and for the load-time gate:

npm i -g @bas.io/guard

bas-guard check ./some-skill     # vet one skill/plugin/zip before installing it
bas-guard scan --report          # audit this machine's ~/.claude + write an HTML report
bas-guard clean                  # list duplicate, bloated and stale skills (report-only)
bas-guard version

Exit codes: 0 below threshold · 1 a finding at or above --fail-on · 2 runtime error (the scan did not happen — never read a 2 as a pass) · 3 clean acted partially · 4 a gate could not be evaluated (with --fail-on, the root held nothing to check or a project's .claude it did not read; with --fail-on-llm, the judge could not answer for everything). A run cut short by a signal ends as 128 + signal, like any Unix program: 130 for Ctrl-C, 141 when the output pipe is closed (bas-guard scan | head). Anything non-zero that is not 1 or 3 means you did not get a verdict.

The load-time gate needs a stable path

bas-guard hook install registers the absolute path of the binary it was run from, so Claude Code can call it before each skill loads. Do not install the gate from an npx invocation: that path lives in npm's temporary cache and is garbage-collected, after which the hook points at a file that no longer exists — every skill then loads unaudited while the setup still looks protected (the scan reports this as GATE-001). Install globally, or use a release binary, when you want the gate.

What it is, and is not

A static scanner: a relative risk signal, not a safety certificate. It cannot prove intent, observe what a program does at run time, read through an encrypted payload, or tell you what a remote MCP endpoint actually does. "No findings" means no findings from the static rules, which is worth reading as exactly that.

More

Full documentation, the rule reference (every finding ID it can print), the Claude Code plugin, and the platform binaries with checksums: https://github.com/basdotio/bas-guard

MIT.

版本与发布记录

@bas.io/guard 共发布 31 个版本,首次发布于 2026/09/09;过去 12 个月发布了 31 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.33.1latest2026/10/2711 天前
0.33.02026/10/2711 天前
0.32.02026/10/2315 天前
0.31.02026/10/2216 天前
0.30.02026/10/2117 天前
0.29.02026/10/2018 天前

关于 @bas.io/guard 的常见问题

@bas.io/guard 是什么?

Local, offline security scan for AI agent setups: audit the skills, MCP servers, hooks and permission grants an agent auto-loads, and vet one before installing it.

如何安装 @bas.io/guard?

在项目目录运行 npm install @bas.io/guard,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 aguard、bas-guard,可以用 npx aguard 直接运行。

@bas.io/guard 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bas.io__guard 是否存在。

@bas.io/guard 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bas.io/guard 可以商用吗?

@bas.io/guard 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bas.io/guard 的下载量有多少?

根据 npm 官方下载统计,@bas.io/guard 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,817 次,日均约 94 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bas.io/guard 还在维护吗?

最新版本 0.33.1 发布于 2026/10/27(11 天前);至今共发布 31 个版本,其中过去 12 个月发布了 31 个;首次发布于 2026/09/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。