security-audit

security-audit is a command for coding agents from xiaobei930/cc-best. It costs 12 tokens per session (1,592 once invoked), scanned B, original, MIT.

A command that scans an add-on's own configuration files for security risks, rather than scanning the user's project code.

In plain words
What is it for?
It is for auditing hooks, settings, agents, and CLAUDE.md files across eight security categories.
Why use it?
It helps identify dangerous commands, overly broad permissions, missing deny rules, and other configuration weaknesses before the add-on is used.

Command

Part of the cc-best plugin — 3 skills, 44 commands, 8 agents, 20 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/xiaobei930/cc-best/security-audit
Clone the repo
git clone --depth 1 https://github.com/xiaobei930/cc-best

Or install cc-best, the plugin that ships this one along with the rest of its 3 skills, 44 commands, 8 agents, 20 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for security-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/xiaobei930/cc-best/security-audit.svg)](https://agentmods.dev/commands/xiaobei930/cc-best/security-audit)
Your own site
<a href="https://agentmods.dev/commands/xiaobei930/cc-best/security-audit"><img src="https://agentmods.dev/badge/commands/xiaobei930/cc-best/security-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,592 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00012 $0.01592
Opus 5 $0.00006 $0.00796
Sonnet 5 $0.00002 $0.00318
Haiku 4.5 $0.00001 $0.00159

Measured 3d ago against content hash 7151a05e9942, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

security-audit scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootlowPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- `chmod 777`

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- `rm -rf /`

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

commands/security-audit.md · 222 lines

How it starts

The opening of the file, as written. The whole thing — 222 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/security-audit - 配置安全审计

核心理念: 安全不仅是审查用户代码,插件自身的配置也需要审计。

对 cc-best 插件配置文件进行 8 类安全扫描,识别 hooks、settings、agents、CLAUDE.md 中的潜在风险。


角色定位

  • 身份: 配置安全审计员
  • 目标: 确保插件配置本身不存在安全隐患
  • 原则: 扫描插件配置,不扫描用户项目代码(用户代码安全由 security-reviewer agent 负责)
  • 核心能力: 8 类配置安全检查

扫描范围

与现有安全能力的分工

能力 扫描对象 职责
security-reviewer agent 用户项目代码 OWASP Top 10
check-secrets.js hook git 暂存文件 密钥泄露
validate-command.js hook 运行时 Bash 命令 危险命令
/security-audit 插件配置本身 hooks / settings / agents / CLAUDE.md

8 类扫描项

立即执行以下检查:

1. Hook 命令注入 (CRITICAL)

目标文件: hooks/hooks.json

检查内容:

  • $(...) 命令替换
  • 反引号 ` 命令替换
  • | 管道(非 matcher 中的正则 |
  • && / || 链式命令(在 command 字段中)
  • 未转义的用户输入引用

判定标准:

  • command 字段中出现 $( 或反引号 → CRITICAL
  • command 字段中出现非 Node.js 的管道命令 → HIGH

2. 权限过宽 (HIGH)

目标文件: settings.json, .claude/settings.local.json

检查内容:

  • Bash(*) 无限制通配符
  • allow 列表中含 * 模式
  • 缺少 deny 规则

判定标准:

  • Bash(*) 无任何限制 → HIGH
  • allow 中含有过于宽泛的模式 → MEDIUM

3. Deny 清单完整性 (HIGH)

目标文件: settings.json

检查内容:

  • 是否包含标准拒绝规则:
    • git push --force
    • git reset --hard
    • rm -rf /
    • chmod 777

判定标准:

  • 缺少 3 项以上标准拒绝规则 → HIGH
  • 缺少 1-2 项 → MEDIUM

4. Agent 过度授权 (MEDIUM)

目标文件: agents/*.md

检查内容:

  • 同时拥有 Bash 工具 + 高 maxTurns (>20) + 无 skill 约束
  • agent 声明了不需要的工具

判定标准:

  • Bash + maxTurns>20 + 无 skill → MEDIUM
  • 声明了全部工具 → LOW

5. MCP 信任 (MEDIUM)

目标文件: mcp-configs/ 目录下的配置

检查内容:

  • 非官方 MCP 服务器
  • MCP 配置中的硬编码凭证

判定标准:

  • 非官方 MCP + 无说明 → MEDIUM
  • MCP 配置中的硬编码密钥 → CRITICAL

6. 配置中的密钥 (CRITICAL)

目标文件: settings.json, CLAUDE.md, hooks/hooks.json

Read the full file on GitHub · 222 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 222 lines · 12 tokens per session scan B 7151a05e9942

Subscribe to this mod's changes

security-audit is a command published in the GitHub repository xiaobei930/cc-best (50 stars, last pushed 2mo ago), licensed MIT. It adds 12 tokens to every session and 1,592 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.