FATH: Authentication-based Test-time Defense against Indirect Prompt Injection Attacks
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
Large language models (LLMs) have been widely deployed as the backbone with additional tools and text information for real-world applications. However, integrating external information into LLM-integrated applications raises significant security concerns. Among these, prompt injection attacks are particularly threatening, where malicious instructions injected in the external text information can exploit LLMs to generate answers as the attackers desire. While both training-time and test-time defense methods have been developed to mitigate such attacks, the unaffordable training costs associated with training-time methods and the limited effectiveness of existing test-time methods make them impractical. This paper introduces a novel test-time defense strategy, named Formatting AuThentication with Hash-based tags (FATH). Unlike existing approaches that prevent LLMs from answering additional instructions in external text, our method implements an authentication system, requiring LLMs to answer all received instructions with a security policy and selectively filter out responses to user instructions as the final output. To achieve this, we utilize hash-based authentication tags to label each response, facilitating accurate identification of responses according to the user's instructions and improving the robustness against adaptive attacks. Comprehensive experiments demonstrate that our defense method can effectively defend against indirect prompt injection attacks, achieving state-of-the-art performance under Llama3 and GPT3.5 models across various attack methods. Our code is released at: https://github.com/Jayfeather1024/FATH
Key facts. Cited by 19 papers in the map (data through 7 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 21 of its 35 references that are in the map. First posted on arXiv 28 Oct 2024.
Builds on
21 of 35 references.
Closest ancestors · 8
Same direction, newest first
- 2024Defending Against Indirect Prompt Injection Attacks With Spotlighting20 Mar
- 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar
- 2024StruQ: Defending Against Prompt Injection with Structured Queries9 Feb
- 2023Benchmarking and Defending Against Indirect Prompt Injection Attacks on Large Language Models21 Dec
- 2023Assessing Prompt Injection Risks in 200+ Custom GPTs20 Nov
- 2023Tensor Trust: Interpretable Prompt Injection Attacks from an Online Game2 Nov
- 2023Prompt Injection attack against LLM-integrated Applications8 Jun
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection23 Feb
Other references · 13
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
- 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,880
- 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,302
- 2018Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examplescited by 1,259
- 2023Mind2Web: Towards a Generalist Agent for the Webcited by 1,210
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2024A New Era in LLM Security: Exploring Security Concerns in Real-World LLM-based Systemscited by 74
- 2024Can LLMs Separate Instructions From Data? And What Do We Even Mean By That?cited by 70
1 more
- 2024WIPI: A New Web Threat for LLM-Driven Web Agentscited by 50
Built on by
Citing papers per year: 2024: 1; 2025: 9; 2026: 9.
19 papers.
Sort:
By area:
- 2024The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agentscited by 89
- 2025Safety at Scale: A Comprehensive Survey of Large Model and Agent Safetycited by 63
- 2025AgentArmor: Enforcing Program Analysis on Agent Runtime Trace to Defend Against Prompt Injectioncited by 39
- 2025Defending against Indirect Prompt Injection by Instruction Detectioncited by 25
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysiscited by 25
- 2026Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systemscited by 16
- 2025System Prompt Poisoning: Persistent Attacks on Large Language Models Beyond User Injectioncited by 14
- 2025CommandSans: Securing AI Agents with Surgical Precision Prompt Sanitizationcited by 12
- 2025Invisible Prompts, Visible Threats: Malicious Font Injection in External Resources for Large Language Modelscited by 9
- 2026Reframing LLM Agent Security as an Agent-Human Interaction Problemcited by 8
- 2025Taxonomy, Evaluation and Exploitation of IPI-Centric LLM Agent Defense Frameworkscited by 7
- 2026LLM-enabled Applications Require System-Level Threat Monitoringcited by 2
7 more
- 2025OET: Optimization-based prompt injection Evaluation Toolkitcited by 1
- 2025Prompt-in-Content Attacks: Exploiting Uploaded Inputs to Hijack LLM Behaviorcited by 1
- 2026Isolation as a First-Class Principle for LLM-Agent System Safety: Concepts, Taxonomy, Challenges and Future Directionscited by 1
- 2026ShadowMerge: A Novel Poisoning Attack on Graph-Based Agent Memory via Relation-Channel Conflictscited by 0
- 2026PsychoPass: Geometric Profiling of Multi-Turn Adversarial LLM Conversationscited by 0
- 2026SkillShield: Prompt-Space Security Skills for LLM Coding Agentscited by 0
- 2026ActGuard: Pre-execution Action Auditing against Indirect Prompt Injection in LLM Agentscited by 0
- 2026ActGuard: Pre-execution Action Auditing against Indirect Prompt Injection in LLM Agents14 Sep 2026
- 2026SkillShield: Prompt-Space Security Skills for LLM Coding Agents26 Aug 2026
- 2026Isolation as a First-Class Principle for LLM-Agent System Safety: Concepts, Taxonomy, Challenges and Future Directions14 Jul 2026
- 2026PsychoPass: Geometric Profiling of Multi-Turn Adversarial LLM Conversations2 Jun 2026
- 2026Reframing LLM Agent Security as an Agent-Human Interaction Problem23 May 2026
- 2026ShadowMerge: A Novel Poisoning Attack on Graph-Based Agent Memory via Relation-Channel Conflicts9 May 2026
- 2026LLM-enabled Applications Require System-Level Threat Monitoring23 Feb 2026
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis11 Feb 2026
- 2026Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systems11 Jan 2026
- 2025Taxonomy, Evaluation and Exploitation of IPI-Centric LLM Agent Defense Frameworks19 Nov 2025
- 2025CommandSans: Securing AI Agents with Surgical Precision Prompt Sanitization9 Oct 2025
- 2025Prompt-in-Content Attacks: Exploiting Uploaded Inputs to Hijack LLM Behavior25 Aug 2025
7 more
- 2025AgentArmor: Enforcing Program Analysis on Agent Runtime Trace to Defend Against Prompt Injection2 Aug 2025
- 2025Invisible Prompts, Visible Threats: Malicious Font Injection in External Resources for Large Language Models22 May 2025
- 2025System Prompt Poisoning: Persistent Attacks on Large Language Models Beyond User Injection10 May 2025
- 2025Defending against Indirect Prompt Injection by Instruction Detection8 May 2025
- 2025OET: Optimization-based prompt injection Evaluation Toolkit1 May 2025
- 2025Safety at Scale: A Comprehensive Survey of Large Model and Agent Safety2 Feb 2025
- 2024The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agents21 Dec 2024
- 2024The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agentscited by 89
- 2025AgentArmor: Enforcing Program Analysis on Agent Runtime Trace to Defend Against Prompt Injectioncited by 39
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysiscited by 25
- 2025CommandSans: Securing AI Agents with Surgical Precision Prompt Sanitizationcited by 12
- 2026Reframing LLM Agent Security as an Agent-Human Interaction Problemcited by 8
- 2025Taxonomy, Evaluation and Exploitation of IPI-Centric LLM Agent Defense Frameworkscited by 7
- 2026Isolation as a First-Class Principle for LLM-Agent System Safety: Concepts, Taxonomy, Challenges and Future Directionscited by 1
- 2026SkillShield: Prompt-Space Security Skills for LLM Coding Agentscited by 0
- 2026ActGuard: Pre-execution Action Auditing against Indirect Prompt Injection in LLM Agentscited by 0
- 2026ActGuard: Pre-execution Action Auditing against Indirect Prompt Injection in LLM Agents14 Sep 2026
- 2026SkillShield: Prompt-Space Security Skills for LLM Coding Agents26 Aug 2026
- 2026Isolation as a First-Class Principle for LLM-Agent System Safety: Concepts, Taxonomy, Challenges and Future Directions14 Jul 2026
- 2026Reframing LLM Agent Security as an Agent-Human Interaction Problem23 May 2026
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis11 Feb 2026
- 2025Taxonomy, Evaluation and Exploitation of IPI-Centric LLM Agent Defense Frameworks19 Nov 2025
- 2025CommandSans: Securing AI Agents with Surgical Precision Prompt Sanitization9 Oct 2025
- 2025AgentArmor: Enforcing Program Analysis on Agent Runtime Trace to Defend Against Prompt Injection2 Aug 2025
- 2024The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agents21 Dec 2024
- 2026Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systemscited by 16
- 2025System Prompt Poisoning: Persistent Attacks on Large Language Models Beyond User Injectioncited by 14
- 2025Invisible Prompts, Visible Threats: Malicious Font Injection in External Resources for Large Language Modelscited by 9
- 2025OET: Optimization-based prompt injection Evaluation Toolkitcited by 1
- 2026PsychoPass: Geometric Profiling of Multi-Turn Adversarial LLM Conversationscited by 0
- 2026PsychoPass: Geometric Profiling of Multi-Turn Adversarial LLM Conversations2 Jun 2026
- 2026Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systems11 Jan 2026
- 2025Invisible Prompts, Visible Threats: Malicious Font Injection in External Resources for Large Language Models22 May 2025
- 2025System Prompt Poisoning: Persistent Attacks on Large Language Models Beyond User Injection10 May 2025
- 2025OET: Optimization-based prompt injection Evaluation Toolkit1 May 2025