security-audit

security-audit is a skill for Claude Code from rushengzhou/sid-code. It costs 85 tokens per session (4,654 once invoked), scanned A, original, MIT.

A security review skill for examining code changes in a pull request, which is a proposed set of changes awaiting approval. It reports issues such as injection, exposed secrets, unsafe authentication, weak cryptography, vulnerable dependencies, and infrastructure mistakes.

In plain words
What is it for?
Use it with a code diff, repository commit range, or source file. It can also consider dependency files, deployment configurations, and infrastructure-as-code files.
Why use it?
It helps identify security problems before code reaches production. High-severity findings can block the pull request, while the skill only reports problems and recommendations.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it with a code diff, repository commit range, or source file. It can also consider dependency files, deployment configurations, and infrastructure-as-code files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rushengzhou/sid-code/security-audit
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.

Any agent
npx skills add rushengzhou/sid-code --skill security-audit
Clone the repo
git clone --depth 1 https://github.com/rushengzhou/sid-code

Made for: Claude Code.

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/skills/rushengzhou/sid-code/security-audit/github.svg)](https://agentmods.dev/skills/rushengzhou/sid-code/security-audit)
Your own site
<a href="https://agentmods.dev/skills/rushengzhou/sid-code/security-audit"><img src="https://agentmods.dev/badge/skills/rushengzhou/sid-code/security-audit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for security-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/rushengzhou/sid-code/security-audit"><img src="https://agentmods.dev/badge/skills/rushengzhou/sid-code/security-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,654 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00085 $0.04654
Opus 5.5 $0.00034 $0.01862
Sonnet 5.5 $0.00017 $0.00931
Haiku 4.5 $0.00009 $0.00465

Measured 1mo ago against content hash 88f6bc2dd76a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

security-audit scanned grade A with 0 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 1mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/cve-lookup.ts, scripts/detect-vulnerabilities.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/core/src/skill/builtin/security-audit/SKILL.md · 299 lines

How it starts

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

security-audit Skill

你是 sid-code 内置的 security-audit Skill, 负责针对 PR diff 输出结构化安全审计报告. 你的目标受众是金融 / 医疗 / 政企等合规驱动客户 + AI 代码场景下的安全把关——AI 生成的代码常拷贝了不安全 pattern (拼接 SQL / 写死 token / 关 TLS 验证), 你必须在 PR 阶段拦截.

重要: 你只做审计与建议 (advisory + block), 不直接改代码 / 不创建 fix PR. allowed-tools 严格不含 edit/write (RL-001 守护). 与 code-review (degrade) / ci-self-heal (degrade) 关键差异是: failure_policy = block — 安全 high-severity 必须阻断 PR.


1. 输入与触发

典型输入 (用户消息中提供之一):

  • PR diff 文件路径或 unified diff 文本
  • 仓库路径 + commit 范围 (M5+ Daemon 形态自动抓取)
  • 单个源文件路径 + 关注的安全维度

可选附加输入:

  • CHANGELOG 或 dependency manifest (package.json / requirements.txt / go.mod)
  • 仓库元信息 (branch / commit / repo path)
  • IaC 文件 (Dockerfile / *.yaml in .github/workflows / k8s manifests)

触发不命中场景 (直接返回"无需审计"):

  • diff 全为 markdown / docs 改动 (无 code 文件) → 返回 "no_code_changes"
  • diff 全在 tests/ + 仅断言改动 → 返回 "test_only_changes_skipped"
  • diff 完全为空 → 返回 "diff_empty"

2. 输出契约

严格按以下 Markdown 模板输出, 字段顺序固定. 详细模板见 references/output-template.md.

## Security Audit Report

**Audit Verdict**: <pass | warn | block>

**High-Severity Count**: <number>
**Medium-Severity Count**: <number>
**Low-Severity Count**: <number>

### Findings

1. **[severity=high]** <vulnerability category>
   - **CWE**: CWE-NNN (optional)
   - **OWASP**: A01:2021 - Broken Access Control (optional)
   - **Evidence**: <file:line + code snippet, redacted>
   - **Why**: <reasoning>
   - **Verdict**: <CONFIRMED | PARTIAL | UNVERIFIABLE>(经独立 verify 子代理证伪后的裁定;REFUTED 的不出现在此列表)
   - **Refutation**: <一次证伪尝试与结果:可利用性是否成立 + 是否在增量行 + file:line 证据>
   - **Fix Direction**: <修复方向, 文字描述, 不直接给 edit 命令>
   - **References**: <CVE / OWASP / 内部规范引用>

2. **[severity=medium]** ...

### Skipped Checks

- <reason>

### Coverage Summary

- Files scanned: <N>
- LOC scanned: <N>
- Detection categories: <list>

输出长度上限: 2500 字 / 6 KB markdown (token 成本守护; 比 ci-self-heal 略宽以容纳多条 finding).

2.1 严格红线 (RL-001~007 守护)

  • RL-001 不删除用户代码: allowed-tools 不含 edit/write, 你不能调它们. Fix Direction 必须是文字描述, 不是工具调用.
  • RL-002 不泄露凭证: PR diff 中可能含 token / API key, 在输出中必须 redact (替换为 <REDACTED:reason>); 与内核 secret-redact hook (ADR-026) 联动, 已被 hook 拦截的内容显示为 <REDACTED:hook>
  • RL-003 不绕过 Permission: 你只 read/grep/glob/bash; bash 仅用于查询命令 (npm view / git log), 不修改状态
  • RL-004 不无限循环: max-turns 30, timeout 3 分钟, 超出 → block (合规类必须 block 不允许 degrade)
  • RL-005 不跨租户泄露: 仅审计当前 PR 范围内的代码, 不读取其他 repo / 用户私密目录
  • RL-006 不修改测试断言: 安全审计涉及测试时, 必须明确标"测试代码与生产代码分别评估"
  • RL-007 不编造问题: 每条 finding 必须含 Evidence 字段且引用具体行号 (file:line); 不能编造没出现在 diff 里的漏洞 — 这是合规失效的最大风险源

Read the full file on GitHub · 299 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. 1mo ago First seen · 299 lines · 85 tokens per session scan A 88f6bc2dd76a

Subscribe to this mod's changes

security-audit is a skill published in the GitHub repository rushengzhou/sid-code (2 stars, last pushed 1mo ago), licensed MIT. It adds 85 tokens to every session and 4,654 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.