owasp/secure-agent-playbook

prompt-injection-test

Test LLM-integrated applications against known prompt injection techniques, evasion methods, and attack intents using the Arcanum PI Taxonomy.

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/owasp/secure-agent-playbook --skill prompt-injection-test

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Prompt Injection Testing

Systematically test an LLM application's prompt injection defenses by following the full procedure in plays/prompt-injection-testing.md.

Based on the Arcanum PI Taxonomy by Jason Haddix (Arcanum Information Security). CC BY 4.0.

Steps

  1. Scope and Input Surface Mapping — Identify all paths where attacker-controlled content reaches the LLM: direct (chat, API params) and indirect (file uploads, web fetches, RAG docs, tool outputs, MCP resources).
  1. Test by Attack Intent (13 intents) — For each authorized intent, attempt to achieve the attacker's goal:
  • INT-01 System Prompt Leak, INT-02 Jailbreak, INT-03 Tool Enumeration
  • INT-04 API Enumeration, INT-05 Get Prompt Secret, INT-06 Attack Users
  • INT-07 Data Poisoning, INT-08 Denial of Service, INT-09 Discuss Harm
  • INT-10 Multi-Chain Attacks, INT-11 Generate Image, INT-12 Test Bias
  • INT-13 Business Integrity
  1. Test by Attack Technique (18 techniques) — Apply known payload construction methods:
  • Framing, Narrative Smuggling, Cognitive Overload, Meta-Prompting
  • Russian Doll, Memory Exploitation, Act as Interpreter, Contradiction
  • End Sequences, Inversion, Rule Addition, Variable Expansion
  • Link Injection, Puzzling, Anti-Harm Coercion, ASCII/Spatial
  • Binary Streams, Spatial Byte Arrays
  1. Apply Evasion Layers (20 evasions) — When techniques are blocked, retry with obfuscation:
  • Encoding: base64, hex, morse, cipher, reverse
  • Language: alt language, fictional language, phonetic substitution, emoji
  • Structural: JSON/XML wrapping, markdown, metacharacter confusion, whitespace, splats
  • Advanced: steganography, link smuggling, graph nodes, waveforms, case changing
  1. Execute Test Matrix — Combine intents x techniques x evasions. Prioritize: high-impact intents first, indirect surfaces second, evasion sweeps against defenses that blocked direct attempts.
  1. Assess Results — For each successful injection, document: severity, attack path (intent + technique + evasion + surface), exact payload, detection gap, and remediation.
  1. Defense Validation — Check the 5-layer defense checklist: ecosystem hardening, model guardrails, prompt-layer defenses, data-layer controls, application-layer validation.

Output

Test results summary table (intent / technique / evasion / surface / result / severity), detailed findings using templates/finding.md, defense coverage checklist with gaps highlighted, and prioritized recommendations.

OWASP References

  • LLM01: Prompt Injection
  • LLM05: Improper Output Handling
  • LLM06: Excessive Agency
  • LLM07: System Prompt Leakage

按任务相关推荐

来自同一仓库

更多 Skills

全部 Skills
owasp
社区

web-security-review

Review web applications against the OWASP Top 10 for Web Applications (2021). Use when auditing web apps, reviewing server-side code, or assessing web frameworks for the classic OWASP Top 10 risks including injection, broken auth, and XSS.

1小时安装量
2
GitHub Stars
209
最近更新
10月15日
owasp
社区

api-security-review

Comprehensive API security review against OWASP API Security Top 10 (2023). Use when reviewing OpenAPI/Swagger specs, auditing REST/GraphQL/gRPC implementations, testing authentication mechanisms, or checking API gateway configurations. Covers BOLA/IDOR, broken auth, mass assignment, rate limiting, SSRF, and more with real-world attack scenarios.

1小时安装量
1
GitHub Stars
204
最近更新
10月15日
owasp
社区

code-review-security

Security-focused code review mapped to OWASP Top 10 and ASVS. Use when reviewing pull requests, auditing files or modules for vulnerabilities, or performing pre-merge security gate checks. Covers injection, auth, authorization, cryptography, data exposure, misconfiguration, and deserialization.

1小时安装量
1
GitHub Stars
184
最近更新
9月25日
owasp
社区

llm-risk-assess

Comprehensive LLM security assessment against OWASP Top 10 for LLM Applications 2025. Use when reviewing LLM-integrated applications, RAG pipelines, chatbots, AI agents, or GenAI features. Covers prompt injection, data poisoning, supply chain, excessive agency, and more with real-world attack scenarios and testing methodologies.

1小时安装量
1
GitHub Stars
184
最近更新
9月25日