Meta-SecAlign is proposed for utility-preserving defense by (1) randomized injection position during training to avoid shortcut learning and (2) self-generated responses as high-quality in-distribution training labels as high-quality in-distribution training labels.
Abstract
Prompt injection attacks, where untrusted data contains an injected prompt to manipulate the system, have been listed as the top security threat to AI agents. By fine-tuning on simulated prompt injections, SecAlign, a leading open defense, reports LLMs with good test-time robustness and negligible benign utility drop. By scaling up training and evaluations, however, we find that SecAlign actually suffers from significant utility degradation, especially in agentic tasks where the threat of prompt injection is prominent. Motivated by this, we propose Meta-SecAlign for utility-preserving defense by (1) randomized injection position during training to avoid shortcut learning and (2) self-generated responses as high-quality in-distribution training labels. Across general knowledge, instruction following, and agentic workflows (on tool-calling and web-navigation), Meta-SecAlign maintains almost all the undefended LLM's utility while achieving better overall security than SecAlign against various static and GCG adaptive attacks. Experiments use Llama-3.1-8B, Llama-3.3-70B, Llama-4-Scout, Qwen3-4B, and Qwen3.6-27B on 6 prompt injection benchmarks including AgentDojo, InjecAgent, WASP, and SEP. Below are links for the code (https://github.com/facebookresearch/Meta_SecAlign), Meta-SecAlign-70B (https://huggingface.co/facebook/Meta-SecAlign-70B), and Meta-SecAlign-8B (https://huggingface.co/facebook/Meta-SecAlign-8B) models.
CoDeL is presented, a defense that hardens agent against an attack distribution it reshapes as it trains, and reduces attack success rate (ASR) by 88.5% and outperforms other baselines largely (+38.0%).
RAISED substantially reduces the attack success rate of prompt injections in tool responses while, unlike prior training-based defenses, preserving utility on both agentic and general-purpose benchmarks.
Mohamed Dhouib, Clément Elliker, Alexi Canesse et al.· 1 citation
An idealized reference model---an injection-invariant, utility-preserving oracle---can nevertheless be approximated, as its output distribution in training is interestingly accessible, which motivates a theoretically principled SecPO loss.
Si-Zhe Chen, Yi-Bo Peng, Jaewon Chang et al.· 2 citations
Heads of Security (HoS), a prompt injection defense that enforces instruction-data separation via a small set of learned per-head attention gates, is introduced and shows that prompt injection robustness can be achieved and improved through targeted attention interventions.
Igor Shilov, Xiao-Xue Yang, Alexander Panfilov et al.· 1 citation
Large language models (LLMs) increasingly power agents that access sensitive information, use external tools, and modify software repositories. Although these capabilities offer substantial benefits, they also create security risks such as jailbreaks, prompt injection, and vulnerable code generation. Existing defenses...
M. Le, Nisarga Gondi, Yi-Bo Peng et al.· arXiv.org· 0 citations
An exploratory case study that applies explainable artificial intelligence techniques to analyze how Prompt Guard 2 distinguishes malicious from benign prompts finds that Prompt Guard 2's decisions rely on the cumulative contribution of many tokens rather than a few dominant ones, yet saliency-guided synonym substituti...
Fernando Outeda, Gustavo Betarte, J. Campo et al.· arXiv.org· 0 citations