Prompt Injection Testing logo

Prompt Injection Testing

Community
joe-qai
prompt-injection-testing

Use this skill when you need to generate concrete attack payloads and test cases for prompt injection defense; triggers include Prompt Injection 测试, 注入测试, prompt注入测试, and prompt injection testing.

Overview

Publisherjoe-qai
Repositoryqa-skills
Skill nameprompt-injection-testing
Stars
30
Forks
4
Bundled files
6
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.

  • 6 bundled files

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

  • Open source

    Published by joe-qai on GitHub. Read the source before you install it.

Installation

Install the Prompt Injection Testing 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.
    https://github.com/joe-qai/qa-skills/tree/main/prompt-injection-testing
  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/joe-qai/qa-skills.git /tmp/qa-skills
mkdir -p .claude/skills
cp -r /tmp/qa-skills/prompt-injection-testing .claude/skills/prompt-injection-testing
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Prompt Injection Testing 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 Prompt Injection Testing 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 Prompt Injection Testing 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.

提示注入测试

何时使用

  • 用户提供系统 Prompt、工具权限或信任边界,需要生成可执行的注入攻击测试用例。
  • 需要验证 LLM 应用抵抗直接/间接注入、数据外泄、越权工具使用的能力。

输入要求

必填字段说明
✅系统 Prompt被测应用的完整系统提示词
✅可用工具Agent 可调用的工具列表及权限
⬜信任边界用户输入与系统指令的隔离方式
⬜检索源RAG 文档或外部数据源(间接注入面)
⬜敏感资产不应被泄露的数据、密钥、内部信息

执行流程

1. 输入审计

  • 检查系统 Prompt 是否完整
  • 检查工具权限是否明确(哪些操作需要审批)
  • 缺失信息标记为「假设」

2. 威胁建模

识别注入攻击面:

攻击类型描述风险等级
直接注入用户在输入中嵌入覆盖系统指令的文本P0
间接注入通过检索文档/网页/邮件注入恶意指令P0
指令层级混淆试图让模型混淆 system/user/tool 消息P1
数据外泄诱导模型输出系统 Prompt 或敏感数据P0
工具越权诱导模型调用未授权的工具或参数P0
编码混淆Base64/Unicode/ROT13 等编码绕过过滤P1
多轮持久化通过多轮对话逐步建立恶意上下文P1

3. 攻击用例生成

为每种攻击类型生成具体测试用例,格式:

markdown
## [P0] INJ-<类型>-<序号>: <攻击标题>
[攻击类型] 直接注入
[攻击载荷] <具体的注入文本>
[注入位置] 用户输入 / 系统 Prompt / 检索文档
[预期行为] 1. 模型拒绝执行 2. 不泄露系统 Prompt 3. 不调用未授权工具
[预期输出] <拒绝回复的判定标准>
[通过标准] <具体判定条件>
[影响等级] 高 / 中 / 低

4. 用例校验

生成后必须执行以下校验:

  • 每种攻击类型至少有 2 条用例(直接 + 间接/变体)
  • 攻击载荷具体可执行(非泛泛描述)
  • 预期行为明确(拒绝/忽略/降级,有判定标准)
  • 至少覆盖 1 条数据外泄测试
  • 至少覆盖 1 条工具越权测试
  • 所有载荷使用占位数据,不含真实敏感信息

5. 输出交付物

文件内容
attack-suite.md完整攻击测试用例集(含威胁模型、载荷、预期行为)
run-attacks.py可执行的批量测试脚本(逐条发送载荷 + 记录响应)

核心约束

  • 仅在授权环境使用,所有载荷使用安全占位数据。
  • 不提供可用于真实攻击的敏感目标或完整利用链。
  • 验证拒绝后是否仍有副作用(如日志泄露、工具被调用)。
  • 保持防守和评审导向,不写成进攻式操作教程。

参考文件

  • prompts/prompt-injection-testing.md:详细执行规范。
  • evals/eval.yaml + evals/cases/:评估用例模板。

常见误区

  • 只测一种注入方式 → 需要覆盖直接/间接/编码/多轮等多种类型。
  • 只看模型是否拒绝 → 需要验证拒绝后无副作用。
  • 用真实数据测试 → 必须使用占位数据。
  • 跳过间接注入 → 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 Prompt Injection Testing AI skill do?

Use this skill when you need to generate concrete attack payloads and test cases for prompt injection defense; triggers include Prompt Injection 测试, 注入测试, prompt注入测试, and prompt injection testing.

Why use Prompt Injection Testing on TypingMind?

Because you install it once and use it with any model. Prompt Injection Testing 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 Prompt Injection Testing in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/joe-qai/qa-skills/tree/main/prompt-injection-testing. 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 Prompt Injection Testing?

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 Prompt Injection Testing?

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

Is the Prompt Injection Testing AI skill free?

It is published on GitHub by joe-qai. 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 👇