Ai Data Security logo

Ai Data Security

OrganizationPopular
wgpsec
ai-data-security

AI 系统数据安全测试方法论。当需要评估 LLM/AI 系统的数据泄露风险、训练数据安全、 或 RAG/向量库数据完整性时触发。覆盖: System Prompt 泄露(元 Prompt/角色扮演/关键字定位)、 训练数据推导与提取、成员推断攻击、模型反演攻击、RAG 数据投毒、API 信息泄露、 级联幻觉攻击、外部数据源信息泄露。

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill nameai-data-security
Stars
1.7K
Forks
242
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wgpsec on GitHub. Read the source before you install it.

Installation

Install the Ai Data Security AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/ai-security/ai-data-security .claude/skills/ai-data-security
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ai Data Security in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ai Data Security on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ai Data Security is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

AI 数据安全测试方法论

攻击面总览

阶段攻击类型目标
应用层System Prompt 泄露、API 信息泄露、PII 窃取配置/接口/用户数据
模型层训练数据推导、成员推断、模型反演训练数据/模型参数
部署层RAG 投毒、向量库越权、缓存泄露知识库/基础设施

与 prompt-leak 的边界

prompt-leak 专注 System Prompt 泄露的 6 类技巧(直接请求、格式化、间接诱导、反射、侧信道、多轮提取)。本 skill 将 Prompt 泄露作为应用层攻击面之一,重点覆盖训练数据、模型层、RAG 数据链路等更广泛的数据安全问题。需要深入 Prompt 泄露时直接调用 prompt-leak


Phase 0: 数据资产识别

测试前先摸清 AI 系统的数据资产边界:

  • 训练数据 — 预训练语料、微调数据集、RLHF 标注数据
  • RAG 知识库 — 文档库、向量数据库、检索索引
  • API 端点 — 推理接口、管理接口、内部调试端点
  • 缓存与日志 — 对话历史、中间推理结果、审计日志

Phase 1: 应用层数据泄露

  • System Prompt 泄露 — 详见 prompt-leak skill,此处不再展开
  • API 信息泄露 — 构造 prompt 诱导模型输出 API 端点、模型版本、参数配置;探测 /v1/models/debug/health 等常见端点暴露内部信息
  • 隐私数据窃取 — 利用对话上下文提取 PII(姓名、电话、邮箱);通过假定业务场景让模型复述其他用户的交互内容;关注多租户场景下的上下文隔离缺陷

Phase 2: 模型层数据攻击

  • 训练数据推导 — 前缀补全:提供训练数据的可能前缀让模型自动补全("我的社保号是...");Divergence 攻击:要求模型无限重复某个词,当模型偏离正常分布后可能吐出训练样本
  • 成员推断攻击 — 训练 Shadow Model 模仿目标模型行为;比较目标模型对"训练集内"与"训练集外"数据的输出概率差异;高置信度输出往往意味着数据曾出现在训练集中
  • 模型反演攻击 — 白盒场景下通过梯度优化从模型输出反推输入特征;黑盒场景下通过大量 API 查询重建输入分布(如人脸重建攻击)

Phase 3: 数据投毒与篡改

  • RAG 知识库投毒 — 向公开数据源注入恶意文档,等待 RAG 系统索引后影响检索结果;操纵 embedding 使恶意内容在语义上接近高频查询
  • 对话语料投毒 — 如系统使用用户反馈进行微调,注入特定对话模式污染训练集
  • 级联幻觉攻击 — 诱导模型生成错误信息,当下游系统依赖该输出时触发数据链路级错误

Phase 4: 部署层数据安全

  • 向量数据库未授权访问 — 检测 Milvus / Pinecone / Weaviate 等向量库的认证配置、网络暴露面
  • 备份/日志/缓存泄露 — 对话历史明文存储、推理日志包含敏感 prompt、模型快照未加密存放

检测清单

  • System Prompt 是否可通过任意方法泄露
  • API 端点是否暴露模型版本/参数/内部配置
  • 模型是否在输出中泄露训练数据片段
  • 多租户场景下对话上下文是否隔离
  • RAG 数据源是否可被外部投毒
  • 向量数据库是否有认证与访问控制
  • 日志/缓存是否包含敏感数据且未加密

深入参考

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ai Data Security AI skill do?

AI 系统数据安全测试方法论。当需要评估 LLM/AI 系统的数据泄露风险、训练数据安全、 或 RAG/向量库数据完整性时触发。覆盖: System Prompt 泄露(元 Prompt/角色扮演/关键字定位)、 训练数据推导与提取、成员推断攻击、模型反演攻击、RAG 数据投毒、API 信息泄露、 级联幻觉攻击、外部数据源信息泄露。

Why use Ai Data Security on TypingMind?

Because you install it once and use it with any model. Ai Data Security is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ai Data Security in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/ai-security/ai-data-security. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ai Data Security?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ai Data Security?

As many as you like. As long as a model supports skills, you can use Ai Data Security with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ai Data Security AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇