Joe-B-Security/awesome-prompt-injection

Learn about a type of vulnerability that specifically targets machine learning models

639

68 commits

updated Sep 11, 2026

See the code

README

Awesome Prompt Injection Awesome

A curated list of resources on prompt injection, the vulnerability that lets attacker-controlled text act as instructions to an LLM.

Contents

Introduction

Prompt injection is a vulnerability in applications built on large language models. The model receives instructions and data in the same channel, as one stream of text, and has no reliable way to tell which is which. Anyone who can get text in front of the model can therefore try to issue it instructions.

The direct form is a user typing something that overrides the developer's intent. The form that matters more in practice is indirect: the attacker never talks to the model at all, and instead plants text where the model will read it. A web page the agent browses, a document it summarises, an email in the inbox it triages, a tool description it loads, an issue on a repository it has been pointed at. The model follows the planted instructions because, from inside the context window, they are indistinguishable from legitimate ones.

Severity tracks capability rather than cleverness. A chatbot that can only produce text can be made to say something unintended. An agent that reads private data, calls tools and acts on the outside world can be made to leak that data or take actions on the attacker's behalf, which is why the problem has grown alongside agent adoption rather than being solved.

It also has no known general fix. Filters and classifiers raise the cost of an attack without closing the gap, and published defences have repeatedly fallen to adaptive attacks. The approaches that hold up best constrain what a compromised model is able to do, rather than trying to detect bad input.

This repository collects resources for understanding, testing and mitigating these attacks.

Introduction Resources

  • OWASP GenAI LLM Top 10 (2026) - The canonical community reference for LLM application risk, with prompt injection at number one. Supersedes the 2025 edition; the per-risk 2025 pages remain online as an archive.
  • Agents Rule of Two: A Practical Approach to AI Agent Security - Meta's Oct 2025 framework stating that agents must satisfy no more than two of: (A) processing untrustworthy inputs, (B) access to sensitive data, (C) ability to change state externally, a deterministic architectural approach to bounding blast radius.
  • OWASP Top 10 for Agentic Applications (2026) - Companion list for autonomous and agentic systems, released Dec 2025 with input from over 100 contributors. Covers the agent-specific failure modes that the LLM list does not reach, including tool misuse and agent hijacking.

Articles and Blog posts

Tutorials

Research Papers

  • Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection - This paper explores the concept of Indirect Prompt Injection attacks on Large Language Models (LLMs) through their integration with various applications. It identifies significant security risks, including remote data theft and ecosystem contamination, present in both real-world and synthetic applications.
  • Universal and Transferable Adversarial Attacks on Aligned Language Models - This paper introduces a simple and efficient attack method that enables aligned language models to generate objectionable content with high probability, highlighting the need for improved prevention techniques in large language models. The generated adversarial prompts are found to be transferable across various models and interfaces, raising important concerns about controlling objectionable information in such systems.
  • The Landscape of Prompt Injection Threats in LLM Agents (SoK) - Feb 2026 systematization-of-knowledge paper with a unified taxonomy covering attack payload strategies (heuristic vs. optimisation-based) and defense intervention stages (text, model, execution). Introduces the AgentPI benchmark for context-dependent agent tasks that all prior benchmarks ignored.
  • The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt Injections - Oct 2025 paper systematically breaking 12 published defenses using gradient descent, RL, random search, and human-guided exploration. Most defenses originally claimed near-zero attack success rates; adaptive attacks exceeded 90% against all of them.
  • Prompt Injection 2.0: Hybrid AI Threats - Jul 2025 paper showing how prompt injections now combine with XSS, CSRF, AI worm propagation, and multi-agent infections to evade traditional WAFs entirely. Evaluates Preamble's classifier, data-tagging, and RL-based defenses against these hybrid scenarios.
  • Securing AI Agents Against Prompt Injection Attacks - Nov 2025 benchmark of 847 adversarial test cases across 5 attack categories against 7 LLMs. The combined defense framework reduces attack success from 73.2% to 8.7% while retaining 94.3% of baseline task performance.
  • ToolHijacker: Prompt Injection Attack to Tool Selection in LLM Agents - Apr 2025 paper introducing a no-box attack that injects a malicious tool document into an agent's tool library to consistently hijack tool selection. Finds that StruQ, SecAlign, DataSentinel, and perplexity detection are all insufficient defenses.
  • Attention Tracker: Detecting Prompt Injection Attacks in LLMs - NAACL 2025 Findings paper detecting prompt injection by tracking attention distribution shifts, with no modification to the underlying model required, making it deployable as a wrapper on any LLM.
  • Safety in Embodied AI: Risks, Attacks, and Defenses - A comprehensive survey of 500+ papers covering prompt injection and other attack vectors in embodied AI systems across the full pipeline (perception, cognition, planning, action, agentic). Includes a 5-layer threat taxonomy mapping where new capabilities introduce new attack surfaces.
  • Jailbreaking LLMs' Safeguard with Universal Magic Words for Text Embedding Models - Discovers that text embedding models have severely biased output distributions, and exploits this to find universal adversarial suffixes ("magic words") that bypass embedding-based LLM safeguards. Attacks transfer across models and languages; a train-free debiasing defense is also proposed.
  • FinAgent Red-Team: A Benchmark for Regulatory-Control Bypass in Financial LLM Agents - Aug 2026 benchmark measuring whether indirect prompt injection can drive financial LLM agents past regulatory controls (sanctions screening, payment-structuring thresholds, dual-approval, data exfiltration, confused-deputy payee redirection). Replays 48 scenarios under three control postures (none/advisory/enforced) with deterministic state-predicate scoring rather than an LLM grader. Finds a frontier model (GPT-4o) bypasses controls 71% of the time with no stated policy, while hard tool-layer enforcement drives attack success to 0% for every model tested.

Tools

  • Garak - Automate looking for hallucination, data leakage, prompt injection, misinformation, toxicity generation, jailbreaks, and many other weaknesses in LLM's.
  • OWASP Agent Memory Guard - Open-source scanner for AI agent memory poisoning attacks (OWASP ASI06). Detects prompt injection payloads, memory manipulation patterns, and data exfiltration attempts in agent memory stores. Available as a Python package (pip install agent-memory-guard) and GitHub Action.
  • PIC Standard - Protocol to block unauthorized or unproven agent actions via intent + provenance checks. Mitigates prompt injection & side-effect risks. Open-source (Apache 2.0).
  • Agent Threat Rules (ATR) - Open detection standard for AI agent threats (prompt injection, tool poisoning, MCP attacks, skill compromise), using Sigma/YARA-style YAML rules. 330 rules across 9 attack categories with full mapping to OWASP Agentic Top 10 (10/10), MITRE ATLAS (100/113), NIST AI RMF (100%), and SAFE-MCP (78/85). 97.1% recall on the garak probe set (193 probes) and 0% false-positive on 53,577 real-world MCP skills. Shipped in production at Cisco AI Defense and Microsoft agent-governance-toolkit. Apache-2.0.
  • Augustus - Feb 2026 open-source tool from Praetorian. A single Go binary with 210+ vulnerability probes across 47 attack categories, 28 LLM providers, 90+ detectors, and 7 payload transformation buffs. Built for penetration testing workflows without Python/npm dependencies.
  • InjecGuard - Open-source prompt guard with published training data; achieves +30.8% over prior state-of-the-art on the NotInject benchmark, specifically addressing overdefense false positives that break legitimate use cases.
  • brood-box - Hardware-isolated microVM sandbox for running coding agents (Claude Code, Codex, OpenCode) with workspace snapshot isolation, DNS-aware egress control, and MCP authorization profiles to contain damage from prompt injection attacks.
  • prompt-shield - Self-learning prompt injection detection engine with novel cross-domain techniques: Smith-Waterman sequence alignment (bioinformatics), stylometric discontinuity detection (forensic linguistics), and adversarial fatigue tracking (materials science). 27 detectors, 6 output scanners, 10 languages, benchmarked on 6 public datasets. Research paper: arXiv:2604.18248. Apache-2.0.
  • Guard Bands - Cryptographic data boundary for LLM applications: untrusted content is wrapped in HMAC-SHA256 or Ed25519 signed markers that bind provenance, lifetime and application context, and the verifier reconstructs that context from trusted state before a protected path proceeds. Tamper, replay, expiry and context mismatch fail closed, so enforcement sits in application code rather than in a model asked to classify inputs. Published protocol spec with conformance vectors, plus FastAPI and MCP adapters. MIT.

CTF

  • PromptTrace - Free AI security training platform with 7 hands-on prompt injection labs and a 15-level CTF (the Gauntlet) with progressively harder defenses, from prompt-level rules to code guards to LLM classifiers. Unique feature: Context Trace shows the full prompt stack (system prompt, RAG documents, tool definitions, user input) in real-time so you can see exactly how attacks work. Uses real LLMs from OpenAI, Anthropic, Google, Groq, and Cerebras.
  • Gandalf - Your goal is to make Gandalf reveal the secret password for each level. However, Gandalf will level up each time you guess the password, and will try harder not to give it away. Can you beat level 7? (There is a bonus level 8).
  • Damn Vulnerable LLM Agent - A sample chatbot powered by a ReAct agent, implemented with Langchain. It's designed to be an educational tool for security researchers, developers, and enthusiasts to understand and experiment with prompt injection attacks in ReAct agents.
  • AI/LLM Exploitation Challenges - AI, ML, and LLMs CTF Challenges.
  • CrowdStrike AI Unlocked - Released Feb 2026, designed to train security, developer, and AI teams on prompt injection against increasingly capable agents. Built by CrowdStrike's Counter Adversary Operations team.
  • ai-prompt-ctf by c-goosen - One of the few CTFs that tests indirect injection against tool-calling agents, spanning RAG, function calling, and ReAct agent scenarios using LlamaIndex, ChromaDB, GPT-4o, and Llama 3.2.
  • LLMVault - Self-hosted CTF-style training range for the OWASP LLM Top 10, with 25 labs across three tiers. Play Mode uses scripted assistants so flags reproduce every time; Live Mode points the same attacks at a real model on your own machine with the secret regenerated per session, so there is no flag to look up. Each lab pairs the attack with the defense that would have stopped it. MIT, Docker.

Community

  • Learn Prompting - Discord server from Learn Prompting.
  • OWASP Gen AI Security Project - The standards body behind the LLM and Agentic Top 10 lists, with working groups, cheat sheets and guidance updated continuously by practitioners across the industry.
  • Simon Willison's Blog - The most consistent independent tracker of real-world prompt injection incidents, new papers, and tooling across the field.
  • r/llmsecurity - The most active subreddit dedicated to LLM security research; a good early-warning channel for real-world incidents and new disclosures.
  • MITRE ATLAS - MITRE's adversarial ML threat matrix formally cataloging direct and indirect prompt injection as core adversary techniques, enabling integration into enterprise threat modelling and purple team exercises.

Contributing

Contributions are welcome! Please read the contribution guidelines first.

awesome
awesome-list

Contributors

Joe-B-Security

34 commits

hazanasec

20 commits

AtlasPA

1 commits

churik5

1 commits

Joe-B-Security/awesome-prompt-injection

Learn about a type of vulnerability that specifically targets machine learning models

639

68 commits

updated Sep 11, 2026

See the code

README

Awesome Prompt Injection Awesome

A curated list of resources on prompt injection, the vulnerability that lets attacker-controlled text act as instructions to an LLM.

Contents

Introduction

Prompt injection is a vulnerability in applications built on large language models. The model receives instructions and data in the same channel, as one stream of text, and has no reliable way to tell which is which. Anyone who can get text in front of the model can therefore try to issue it instructions.

The direct form is a user typing something that overrides the developer's intent. The form that matters more in practice is indirect: the attacker never talks to the model at all, and instead plants text where the model will read it. A web page the agent browses, a document it summarises, an email in the inbox it triages, a tool description it loads, an issue on a repository it has been pointed at. The model follows the planted instructions because, from inside the context window, they are indistinguishable from legitimate ones.

Severity tracks capability rather than cleverness. A chatbot that can only produce text can be made to say something unintended. An agent that reads private data, calls tools and acts on the outside world can be made to leak that data or take actions on the attacker's behalf, which is why the problem has grown alongside agent adoption rather than being solved.

It also has no known general fix. Filters and classifiers raise the cost of an attack without closing the gap, and published defences have repeatedly fallen to adaptive attacks. The approaches that hold up best constrain what a compromised model is able to do, rather than trying to detect bad input.

This repository collects resources for understanding, testing and mitigating these attacks.

Introduction Resources

  • OWASP GenAI LLM Top 10 (2026) - The canonical community reference for LLM application risk, with prompt injection at number one. Supersedes the 2025 edition; the per-risk 2025 pages remain online as an archive.
  • Agents Rule of Two: A Practical Approach to AI Agent Security - Meta's Oct 2025 framework stating that agents must satisfy no more than two of: (A) processing untrustworthy inputs, (B) access to sensitive data, (C) ability to change state externally, a deterministic architectural approach to bounding blast radius.
  • OWASP Top 10 for Agentic Applications (2026) - Companion list for autonomous and agentic systems, released Dec 2025 with input from over 100 contributors. Covers the agent-specific failure modes that the LLM list does not reach, including tool misuse and agent hijacking.

Articles and Blog posts

Tutorials

Research Papers

  • Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection - This paper explores the concept of Indirect Prompt Injection attacks on Large Language Models (LLMs) through their integration with various applications. It identifies significant security risks, including remote data theft and ecosystem contamination, present in both real-world and synthetic applications.
  • Universal and Transferable Adversarial Attacks on Aligned Language Models - This paper introduces a simple and efficient attack method that enables aligned language models to generate objectionable content with high probability, highlighting the need for improved prevention techniques in large language models. The generated adversarial prompts are found to be transferable across various models and interfaces, raising important concerns about controlling objectionable information in such systems.
  • The Landscape of Prompt Injection Threats in LLM Agents (SoK) - Feb 2026 systematization-of-knowledge paper with a unified taxonomy covering attack payload strategies (heuristic vs. optimisation-based) and defense intervention stages (text, model, execution). Introduces the AgentPI benchmark for context-dependent agent tasks that all prior benchmarks ignored.
  • The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt Injections - Oct 2025 paper systematically breaking 12 published defenses using gradient descent, RL, random search, and human-guided exploration. Most defenses originally claimed near-zero attack success rates; adaptive attacks exceeded 90% against all of them.
  • Prompt Injection 2.0: Hybrid AI Threats - Jul 2025 paper showing how prompt injections now combine with XSS, CSRF, AI worm propagation, and multi-agent infections to evade traditional WAFs entirely. Evaluates Preamble's classifier, data-tagging, and RL-based defenses against these hybrid scenarios.
  • Securing AI Agents Against Prompt Injection Attacks - Nov 2025 benchmark of 847 adversarial test cases across 5 attack categories against 7 LLMs. The combined defense framework reduces attack success from 73.2% to 8.7% while retaining 94.3% of baseline task performance.
  • ToolHijacker: Prompt Injection Attack to Tool Selection in LLM Agents - Apr 2025 paper introducing a no-box attack that injects a malicious tool document into an agent's tool library to consistently hijack tool selection. Finds that StruQ, SecAlign, DataSentinel, and perplexity detection are all insufficient defenses.
  • Attention Tracker: Detecting Prompt Injection Attacks in LLMs - NAACL 2025 Findings paper detecting prompt injection by tracking attention distribution shifts, with no modification to the underlying model required, making it deployable as a wrapper on any LLM.
  • Safety in Embodied AI: Risks, Attacks, and Defenses - A comprehensive survey of 500+ papers covering prompt injection and other attack vectors in embodied AI systems across the full pipeline (perception, cognition, planning, action, agentic). Includes a 5-layer threat taxonomy mapping where new capabilities introduce new attack surfaces.
  • Jailbreaking LLMs' Safeguard with Universal Magic Words for Text Embedding Models - Discovers that text embedding models have severely biased output distributions, and exploits this to find universal adversarial suffixes ("magic words") that bypass embedding-based LLM safeguards. Attacks transfer across models and languages; a train-free debiasing defense is also proposed.
  • FinAgent Red-Team: A Benchmark for Regulatory-Control Bypass in Financial LLM Agents - Aug 2026 benchmark measuring whether indirect prompt injection can drive financial LLM agents past regulatory controls (sanctions screening, payment-structuring thresholds, dual-approval, data exfiltration, confused-deputy payee redirection). Replays 48 scenarios under three control postures (none/advisory/enforced) with deterministic state-predicate scoring rather than an LLM grader. Finds a frontier model (GPT-4o) bypasses controls 71% of the time with no stated policy, while hard tool-layer enforcement drives attack success to 0% for every model tested.

Tools

  • Garak - Automate looking for hallucination, data leakage, prompt injection, misinformation, toxicity generation, jailbreaks, and many other weaknesses in LLM's.
  • OWASP Agent Memory Guard - Open-source scanner for AI agent memory poisoning attacks (OWASP ASI06). Detects prompt injection payloads, memory manipulation patterns, and data exfiltration attempts in agent memory stores. Available as a Python package (pip install agent-memory-guard) and GitHub Action.
  • PIC Standard - Protocol to block unauthorized or unproven agent actions via intent + provenance checks. Mitigates prompt injection & side-effect risks. Open-source (Apache 2.0).
  • Agent Threat Rules (ATR) - Open detection standard for AI agent threats (prompt injection, tool poisoning, MCP attacks, skill compromise), using Sigma/YARA-style YAML rules. 330 rules across 9 attack categories with full mapping to OWASP Agentic Top 10 (10/10), MITRE ATLAS (100/113), NIST AI RMF (100%), and SAFE-MCP (78/85). 97.1% recall on the garak probe set (193 probes) and 0% false-positive on 53,577 real-world MCP skills. Shipped in production at Cisco AI Defense and Microsoft agent-governance-toolkit. Apache-2.0.
  • Augustus - Feb 2026 open-source tool from Praetorian. A single Go binary with 210+ vulnerability probes across 47 attack categories, 28 LLM providers, 90+ detectors, and 7 payload transformation buffs. Built for penetration testing workflows without Python/npm dependencies.
  • InjecGuard - Open-source prompt guard with published training data; achieves +30.8% over prior state-of-the-art on the NotInject benchmark, specifically addressing overdefense false positives that break legitimate use cases.
  • brood-box - Hardware-isolated microVM sandbox for running coding agents (Claude Code, Codex, OpenCode) with workspace snapshot isolation, DNS-aware egress control, and MCP authorization profiles to contain damage from prompt injection attacks.
  • prompt-shield - Self-learning prompt injection detection engine with novel cross-domain techniques: Smith-Waterman sequence alignment (bioinformatics), stylometric discontinuity detection (forensic linguistics), and adversarial fatigue tracking (materials science). 27 detectors, 6 output scanners, 10 languages, benchmarked on 6 public datasets. Research paper: arXiv:2604.18248. Apache-2.0.
  • Guard Bands - Cryptographic data boundary for LLM applications: untrusted content is wrapped in HMAC-SHA256 or Ed25519 signed markers that bind provenance, lifetime and application context, and the verifier reconstructs that context from trusted state before a protected path proceeds. Tamper, replay, expiry and context mismatch fail closed, so enforcement sits in application code rather than in a model asked to classify inputs. Published protocol spec with conformance vectors, plus FastAPI and MCP adapters. MIT.

CTF

  • PromptTrace - Free AI security training platform with 7 hands-on prompt injection labs and a 15-level CTF (the Gauntlet) with progressively harder defenses, from prompt-level rules to code guards to LLM classifiers. Unique feature: Context Trace shows the full prompt stack (system prompt, RAG documents, tool definitions, user input) in real-time so you can see exactly how attacks work. Uses real LLMs from OpenAI, Anthropic, Google, Groq, and Cerebras.
  • Gandalf - Your goal is to make Gandalf reveal the secret password for each level. However, Gandalf will level up each time you guess the password, and will try harder not to give it away. Can you beat level 7? (There is a bonus level 8).
  • Damn Vulnerable LLM Agent - A sample chatbot powered by a ReAct agent, implemented with Langchain. It's designed to be an educational tool for security researchers, developers, and enthusiasts to understand and experiment with prompt injection attacks in ReAct agents.
  • AI/LLM Exploitation Challenges - AI, ML, and LLMs CTF Challenges.
  • CrowdStrike AI Unlocked - Released Feb 2026, designed to train security, developer, and AI teams on prompt injection against increasingly capable agents. Built by CrowdStrike's Counter Adversary Operations team.
  • ai-prompt-ctf by c-goosen - One of the few CTFs that tests indirect injection against tool-calling agents, spanning RAG, function calling, and ReAct agent scenarios using LlamaIndex, ChromaDB, GPT-4o, and Llama 3.2.
  • LLMVault - Self-hosted CTF-style training range for the OWASP LLM Top 10, with 25 labs across three tiers. Play Mode uses scripted assistants so flags reproduce every time; Live Mode points the same attacks at a real model on your own machine with the secret regenerated per session, so there is no flag to look up. Each lab pairs the attack with the defense that would have stopped it. MIT, Docker.

Community

  • Learn Prompting - Discord server from Learn Prompting.
  • OWASP Gen AI Security Project - The standards body behind the LLM and Agentic Top 10 lists, with working groups, cheat sheets and guidance updated continuously by practitioners across the industry.
  • Simon Willison's Blog - The most consistent independent tracker of real-world prompt injection incidents, new papers, and tooling across the field.
  • r/llmsecurity - The most active subreddit dedicated to LLM security research; a good early-warning channel for real-world incidents and new disclosures.
  • MITRE ATLAS - MITRE's adversarial ML threat matrix formally cataloging direct and indirect prompt injection as core adversary techniques, enabling integration into enterprise threat modelling and purple team exercises.

Contributing

Contributions are welcome! Please read the contribution guidelines first.

awesome
awesome-list

Contributors

Joe-B-Security

34 commits

hazanasec

20 commits

AtlasPA

1 commits

churik5

1 commits