Pii Checker
使用 agent-sec-cli 检查文本、UTF-8 文件或日志中的个人信息与凭证,报告脱敏证据,并按需生成脱敏文本。当用户要求检查敏感信息、查找泄露的密钥或对内容脱敏时使用;查询已发生的安全事件使用 security-observability。
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use Pii Checker when an AI agent needs a reusable SKILL.md workflow for this job: 使用 agent-sec-cli 检查文本、UTF-8 文件或日志中的个人信息与凭证,报告脱敏证据,并按需生成脱敏文本。当用户要求检查敏感信息、查找泄露的密钥或对内容脱敏时使用;查询已发生的安全事件使用 security-observability。
When not to use it
Skip Pii Checker when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/pii-checker # Save SKILL.md to ~/.claude/skills/pii-checker/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/pii-checker/SKILL.md. For a shared project, commit the folder at .claude/skills/pii-checker/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Pii Checker skill for this task: Use Pii Checker when this documented workflow matches the task. Confirm any required inputs or files before making changes.
What supports this recommendation?
69/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 73/100
- Practical detail
- 68/100
- Source evidence
- 63/100
- Source signals
- 70/100
Model compatibility evidence
- claudeuntested
No model-specific signal or recorded compatibility test was found.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# PII Checker
复用已安装的 `agent-sec-cli scan-pii` 检测个人信息和凭证。 V2 需要预先运行的 Rust daemon 和 `AGENT_SEC_DAEMON_SOCKET`;不自动启动或回退到 Python。 支持邮箱、中国手机号、身份证号、银行卡号、API Key、Bearer Token、JWT、 私钥及自定义规则。仅检查用户指定的内容,不主动扩大到整个目录或历史会话。
## 调用
已知文件路径时直接扫描文件,无需先将原文读取到对话中:
```bash agent-sec-cli scan-pii --input /absolute/path/to/input.txt --source manual --format json ```
用户要求脱敏时追加 `--redact-output`:
```bash agent-sec-cli scan-pii --input /absolute/path/to/input.txt --source manual --format json --redact-output ```
内容来自文本或上游工具时,通过工具的标准输入接口或已有数据流传给下面的命令; 不要启动无人提供输入的交互式读取:
```bash agent-sec-cli scan-pii --stdin --source manual --format json ```
- `--input` 只接受单个 UTF-8 文本文件,不解析目录、PDF、图片或压缩包。 - `--input`、`--stdin`、`--text` 三者必须且只能选一个。敏感正文优先走文件或 stdin,避免放入命令参数;不要将待扫描文本拼接为 shell 代码。 - 替换路径时优先使用参数数组;必须经 shell 时,对整个路径使用可靠的 shell quoting(例如 `shlex.quote`),不能只在任意路径两侧加单引号。 - 普通主动检查使用 `--source manual`。此标签用于审计,不会更改输入或 Hook 策略。 - `--include-low-confidence` 可用于用户要求的更广泛复核,包含默认被过滤的低置信度 命中;这些分值是启发式评分,不是经过校准的概率。 - 默认扫描完整输入。只有明确限定范围时才设置正整数 `--max-bytes`,并报告截断。 - CLI 不可用、不支持 `scan-pii`、输入不可读或命令失败时,报告未完成检查; 不以模型自行猜测代替扫描结果,不安装软件或更改安全配置来绕过失败。
## 解释结果
解析 JSON 的 `ok`、`verdict`、`summary`、`findings`;不能只看退出码。 `warn` 和 `deny` 也可能返回退出码 0,表示扫描完成。
| 字段 / 值 | 解释与处理 | |---|---| | `ok=false` 或 `verdict=error` | 扫描失败,本次未完成检查 | | `verdict=pass` | 在本次规则、置信度过滤和扫描范围内未检出问题 | | `verdict=warn` | 存在告警级命中,没有 `deny` 级命中 | | `verdict=deny` | 存在 `deny` 级命中;这是扫描判定,不代表已经阻断或撤销凭证 | | `summary.truncated=true` | 只扫描了部分输入,不能给出全文结论 | | `summary.findings_truncated=true` | 返回的命中明细或证据有省略;使用 `summary.total` / `summary.by_type` 报告统计,不能将返回的 `findings` 当作完整位置清单 | | `summary.redacted_text_omitted=true` | 响应省略了完整脱敏正文;`redacted_text` 是整段占位符,不能作为完整脱敏产物使用 | | `summary.custom_rules.status=invalid` | 自定义规则未生效,内置规则的结果仍可报告 | | `summary.custom_rules.runtime_error_count>0`、`budget_exhausted=true` 或 `truncated=true` | 自定义规则执行或结果不完整,必须说明覆盖限制 |
未配置自定义规则(`status=absent`)是正常状态,不算扫描失败。 JSON 缺失、解析失败、关键字段缺失或出现未知 verdict 时,报告无法取得有效判定。 `pass` 只表示未检出,不能承诺不存在敏感信息或内容可以安全外发。
报告实际扫描范围、判定、`summary.total` / `summary.by_type` 的命中统计, 必要时列出 finding 的 `type`、`severity`、`span` 和 `evidence_redacted`。 不要使用 `--raw-evidence`,也不要从原文或对话历史补回已脱敏的值。
## 脱敏与审计
只在用户要求脱敏时返回 `redacted_text`,并先检查 `summary.redacted_text_omitted`。 该标记为 `true` 时,即使扫描成功且覆盖完整,也没有可交付的完整脱敏正文; 应说明输出大小限制,并报告扫描判定与统计。不得把 `[REDACTED: output size limit]` 占位符作为完整脱敏文本交付、保存或覆盖原文件,也不要用省略后的 `findings` 重建全文。 该标记为 `false` 或不存在时,`redacted_text` 在实际扫描范围内替换检出的内容。 如果扫描或自定义规则不完整,要说明脱敏结果也不完整,不能把截断的片段当作全文。 `--redact-output` 不修改原文件;仅在用户要求保存或替换文件时执行对应写入。
扫描会记录经过脱敏的 `pii_scan` 安全事件。此 Skill 不调整 Hook 开关、阻断策略 或自定义规则配置;历史安全事件的查询与复盘由 `security-observability` 处理。
Intended uses
- Use Pii Checker when this documented workflow matches the task.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.