Decoding Guardrails: XAI-Guided Perturbation Analysis of Prompt Injection Detection

Fernando Outeda, Gustavo Betarte, Juan Diego Campo, Fiorella Cravero
9/21/2026
cs.CRcs.AI

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) are increasingly deployed in production systems, raising concerns about their exposure to adversarial manipulation through prompt injection and jailbreak attacks. Classifier-based guardrails, such as Prompt Guard 2, are widely used as a first line of defense against such attacks, but their internal decision logic is largely opaque to both defenders and attackers.

Show full abstract

This paper presents an exploratory case study that applies explainable artificial intelligence (XAI) techniques to analyze how Prompt Guard 2 distinguishes malicious from benign prompts. We conduct four experiments to probe this question empirically. Guided by Vanilla Gradient and SHAP attributions, we find that Prompt Guard 2's decisions rely on the cumulative contribution of many tokens rather than a few dominant ones, yet saliency-guided synonym substitution and sentence-level paraphrasing can flip its predictions while altering only a moderate fraction of the text, in some cases yielding a successful jailbreak against the underlying LLM. A dataset-scale saliency analysis further shows that undetected injection prompts systematically lack the lexical markers the classifier relies on. We discuss the implications of these findings for the design and evaluation of classifier-based guardrails, and argue that explanation methods intended to support transparency can simultaneously lower the cost of constructing successful adversarial bypasses.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{outeda2026decoding,
  title  = {Decoding Guardrails: XAI-Guided Perturbation Analysis of Prompt Injection Detection},
  author = {Fernando Outeda and Gustavo Betarte and Juan Diego Campo and Fiorella Cravero},
  year   = {2026},
  eprint = {2609.24801},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.24801v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.24801.svg)](https://codeofpaper.com/paper/2609.24801)

Discussion