ai-secrecy-guard
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "ai-secrecy-guard" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-41f2383c29a51a93eeacf40f396d30bbd97edb563fbf28ca92cd4c145ff5a688. Verify the upstream source and version against https://skillhub.cn/skills/user_638e256a/ai-secrecy-guard before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
AI secrecy monitoring, filtering, and alert engine. Monitors AI conversations and outputs for sensitive information (people, parameters, prices, locations, organizations, etc.), supports classification of secrecy levels, contextual correlation monitoring, and custom rule sets; performs graded alerts, redaction/filtering, and blocking, and records full audit logs. Triggered for needs such as secrecy monitoring, sensitive detection, data redaction, classification of secrecy levels, secrecy filtering, leak prevention, and sensitive information detection.
Introduction source: third_party · user_638e256a · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: ai-secrecy-guard
description: AI保密监测过滤报警引擎。监测AI对话和输出中的涉密信息(人员、参数、价格、位置、机构等),自动分级告警、脱敏过滤、阻断拦截,并记录完整审计日志。支持密级推断(公开/内部/秘密/机密)、上下文关联监测、自定义规则库。当用户提到保密监测、涉密检测、信息脱敏、密级分类、保密过滤、泄密防护、敏感信息检测、数据防泄漏等需求时使用此技能。AI保密监测过滤报警引擎
守门员:不让涉密信息从AI管道泄漏出去。
核心理念
AI辅助工作的场景越来越普遍,但AI对话和输出中没有保密守门员。一段装备参数、一个标底价、一条涉密人员信息,都可能通过AI对话被无意泄露。本引擎做三件事:发现涉密内容 → 拦截或脱敏 → 留痕审计。
工作流程
第一步:监测扫描
对输入文本逐句分析,三级检测管线:
第一道:规则引擎(硬匹配,零延迟)
- 关键词匹配:预设的涉密关键词库(军网代号、密级标识词、标底相关词等)
- 正则匹配:身份证号、手机号、银行卡号、GPS坐标、IP地址等格式化敏感数据
- 规则库文件:
data/rules/目录下按场景组织
第二道:实体识别(NER)
- 人员:姓名+职务组合
- 机构:涉密单位名称
- 参数:装备型号、技术指标、性能数据
- 金额:标底价、报价、预算
- 位置:部署地点、设施坐标
- 项目代号:军网/政府采购项目编号
第三道:上下文关联
- 单条信息可能不涉密,但跨轮次组合后涉密
- 维护上下文窗口,关联历史信息推断整体密级
- 示例:前文提军网项目代号 + 本轮出参数 → 密级升级
调用 main.py scan <文本> 执行监测,返回检测结果。
第二步:密级推断
根据检测结果推断整体密级:
| 密级 | 判定条件 | 代号 |
|---|---|---|
| 公开 | 无任何敏感实体命中 | PUBLIC |
| 内部 | 命中内部关键词或一般性商业信息 | INTERNAL |
| 秘密 | 命中军网/政府采购涉密关键词,或包含项目代号+技术参数 | SECRET |
| 机密 | 命中核心军事参数,或批量泄漏风险 | TOP_SECRET |
推断规则:
- 取所有命中实体中的最高密级
- 组合加成:命中2个以上SECRET级实体 → 升级为TOP_SECRET
- 上下文加成:历史对话中已有SECRET级内容 + 新增相关实体 → 升级
第三步:分级处置
根据密级执行不同处置策略:
| 密级 | 处置 | 说明 |
|---|---|---|
| PUBLIC | 放行 | 无需处理 |
| INTERNAL | 标记+记录 | 内容放行,但记录到审计日志 |
| SECRET | 脱敏后输出+告警 | 涉密部分替换为脱敏文本,通知用户 |
| TOP_SECRET | 阻断+立即告警 | 完全拦截输出,紧急通知,留痕取证 |
脱敏替换规则:
- 人员姓名 →
[相关人员] - 具体数值 →
[相关参数] - 地名/坐标 →
[某地] - 金额 →
[相关金额] - 项目代号 →
[相关项目]
调用 main.py filter <文本> [--level <强制密级>] 执行过滤。
第四步:报警通知
报警级别与密级对应:
| 报警级别 | 触发 | 动作 |
|---|---|---|
| LOW | INTERNAL级信息 | 标记日志 |
| MEDIUM | SECRET级信息 | 脱敏+告警+日志 |
| HIGH | TOP_SECRET级信息 | 阻断+紧急告警+日志+取证 |
| CRITICAL | TOP_SECRET+批量泄漏 | 全面拦截+邮件告警+审计锁定 |
调用 main.py alert <报警信息> 触发报警流程。
第五步:审计日志
所有监测结果和处理动作记录到审计日志:
{
"timestamp": "2026-06-17T18:00:00+08:00",
"event_id": "uuid",
"level": "SECRET",
"action": "desensitize",
"entities_found": [
{"type": "project_code", "value": "XXX-2026-001", "level": "SECRET"}
],
"context_summary": "包含军网项目代号",
"original_hash": "sha256...",
"handled": true
}
调用 main.py audit 查询审计日志。
调用 main.py report [--period daily|weekly|monthly] 生成合规报告。
命令参考
main.py scan <文本> # 扫描文本,返回检测结果和密级
main.py filter <文本> [--level <密级>] # 过滤文本,返回脱敏后内容和处置结果
main.py alert <报警信息> # 触发报警(通常由filter自动调用)
main.py audit [--level <密级>] [--limit N] # 查询审计日志
main.py report [--period daily|weekly|monthly] # 生成合规报告
main.py rules list # 查看当前规则库
main.py rules add --type <类型> --pattern <模式> --level <密级> # 添加自定义规则
规则库结构
data/rules/
├── default.json # 通用规则(身份证、手机号、银行卡等)
├── military.json # 军网采购场景规则
├── government.json # 政府采购场景规则
├── enterprise.json # 企业招标场景规则
└── custom.json # 用户自定义规则(优先级最高)
每条规则格式:
{
"id": "rule_001",
"type": "keyword|regex|ner",
"pattern": "标底|底价|预算金额",
"entity_type": "price",
"level": "INTERNAL",
"description": "标底价格相关关键词"
}
进化引擎联动
当「AI知错进化引擎」已安装时,保密监测引擎自动联动:
- 误判回流 — 用户标记误判(正常内容被拦或涉密内容漏检)时,将误判案例记录到进化引擎,优化规则精准度
- 规则进化 — 进化引擎中的纠偏规则反向影响监测规则库,持续提升检测准确率
- 审计进化 — 定期分析审计日志中的误判模式,自动沉淀为规则优化建议
联动通过 main.py feedback 命令实现。
边界与约束
- 本地运行 — 所有文本分析在本地完成,不向外部API发送原文,避免二次泄漏
- 规则优先 — 硬规则(关键词/正则)是第一道防线,NER和上下文推断只做补充
- 宁可误报不可漏报 — 默认策略偏保守,漏检涉密信息的代价远大于误报
- 用户可覆盖 — 被拦截的内容用户可选择强制放行(需二次确认),误报不阻塞工作流
- 审计不可篡改 — 审计日志只追加不删除,保证合规可追溯
文件结构
skills/ai-secrecy-guard/
├── SKILL.md # 本文件
├── main.py # 核心引擎脚本
├── requirements.txt # Python依赖
└── data/ # 运行时数据目录
├── rules/ # 规则库
│ ├── default.json
│ ├── military.json
│ ├── government.json
│ ├── enterprise.json
│ └── custom.json
├── audit_log.json # 审计日志
└── context_window.json # 上下文窗口(跨轮次关联用)Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决 AI 对话中涉密信息泄漏的实际痛点,功能闭环完整
- 支持密级推断、上下文关联、自定义规则库,具备高实用价值
Highlights
- 触发词覆盖全面,边界清晰,无歧义
Areas to improve
-
description写错位置 Reported severity: Minor
顶层 frontmatter 中 description 为空,实质描述内容在 skill_body 内部
Recommendation: 将 description 内容移至顶层 frontmatter 字段
Highlights
- 工具来源明确,参数定义清晰,覆盖主要异常场景
- 不可逆操作有确认机制,审计日志不可篡改
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.