Skip to content

Bypassing prompt injection detectors through evasive injectionBypassing Prompt Injection Detectors through Evasive Injections

arXiv· arXiv:2602.00750· IJCNN 2026· Md Jahedur Rahman, Ihsen Alouani·Indexed by this site · 2026-10-12· Originally publishedSelected AttacksSelectedAttention42

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

A universal suffix simultaneously fools all probes of both Phi-3 3.8B and Llama-3 8B, with ASR of 93.91% and 99.63%.

Threat modelAn adaptive adversary controls the RAG data channel, can place secondary instructions in retrieved text and append an adversarial suffix, causing linear probes at each layer to classify the input as benign while keeping the injection effective. The adversary cannot modify the user's primary instruction, LLM parameters, or the detector. A baseline adversary only injects secondary instructions.

Questions
In RAG, untrusted retrieved text can carry secondary instructions that divert the LLM from the user's task. Linear probes trained on hidden-layer activation differences can detect such task drift, but whether they are robust to adaptive adversaries, the authors say, remains unstudied.
Methods
Appending suffix after input containing secondary instruction, injecting gradients of each layer probe loss into LLM backward pass, using modified GCG to find a universal suffix that makes all probes classify as benign. Defense is randomly appending multiple such suffixes and retraining probes, also trying PGD perturbation-activation training.
Experiments and results
Universal suffix makes all-five-probes simultaneously fooled ASR 93.91% and 99.63% for Phi-3 and Llama-3 (Table III, table title does not specify subset). Suffix augmentation evaluated only on Phi-3; authors claim 80–100% on unseen suffixes, Table VI all-five-probes lowest 79.79%.
Limitations and future work
Paper does not specifically discuss limitations. Probe evasion reported on Phi-3 3.8B and Llama-3 8B, defense only on Phi-3. Behavior analysis authors call preliminary; paper does not report its sample size, nor quantitative success rate of injected task completion.
Experimental setupPhi-3 3.8B、Llama-3 8B · TaskTracker · ASR、probe accuracy et al.
Evaluated models
Phi-3 3.8BLlama-3 8B
Benchmarks
TaskTracker
Metrics
ASRprobe accuracyprobe agreement
AI summaryand selection rationaleThe researchers propose a multi-probe evasion attack that appends a GCG-optimized universal adversarial suffix to poisoned inputs, fooling activation drift detectors at all layers simultaneously, with attack success rates of 93.91% on Phi-3 3.8B and 99.63% on Llama-3 8B. The method builds on the task drift detection framework of Abdelnabi et al., adapting the GCG algorithm originally used for jailbreaks to jointly optimize the suffix against the losses of per-layer linear probes, causing activations to be misclassified as clean inputs. The authors also propose a random-suffix augmentation defense, generating activations with multiple adversarial suffixes and retraining the linear probes, achieving detection accuracy of 80% to 100% on unseen suffixes, and direct attacks against the hardened probes also struggle to succeed.

The researchers propose a multi-probe evasion attack that appends a GCG-optimized universal adversarial suffix to poisoned inputs, fooling activation drift detectors at all layers simultaneously, with attack success rates of 93.91% on Phi-3 3.8B and 99.63% on Llama-3 8B. The method builds on the task drift detection framework of Abdelnabi et al., adapting the GCG algorithm originally used for jailbreaks to jointly optimize the suffix against the losses of per-layer linear probes, causing activations to be misclassified as clean inputs. The authors also propose a random-suffix augmentation defense, generating activations with multiple adversarial suffixes and retraining the linear probes, achieving detection accuracy of 80% to 100% on unseen suffixes, and direct attacks against the hardened probes also struggle to succeed.

Why it was selectedThe paper gives the success rate of a universal suffix attack against activation drift detectors, and verifies that suffix-enhanced training can restore the detection rate to above 80%.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Can an adaptive suffix simultaneously fool activation-drift probes across layers, with the authors also retraining the detector using random suffix augmentation?

    Can a single universal adversarial suffix fool activation-drift linear probes across layers while the underlying prompt injection remains effective?

    • Scenario: The authors frame the problem in RAG. Retrieved data can come from untrusted sources like email. The authors claim that even if an attacker controls only a small portion of retrieved data, they may cause the model to execute injected instructions, citing customer service, code generation, and enterprise search.
    • Existing gaps: The authors claim input filtering, instruction hierarchy, and perplexity detection often fail against sophisticated attacks or impose usability constraints. Abdelnabi et al. train logistic regression probes on multi-layer activation differences, achieving high accuracy on standard injections without modifying the LLM; the authors claim robustness under adaptive adversaries remains unstudied.
    • Observation: The authors argue the objective can be decomposed. The poisoned prompt is responsible for hijacking behavior; the suffix only pushes the monitored layer activations into the probe's benign region, without needing to change the injection's semantics.
    • Proposal: This paper presents a multi-probe evasion attack, using a modified GCG to jointly optimize a universal suffix; it also uses random suffix augmentation followed by probe retraining as a defense.
    • Threat model:
      • Victim system: A general RAG LLM, with the same setup as Abdelnabi et al. The user gives a primary instruction, and the model retrieves external data; data is divided into clean and poisoned (containing secondary instructions).
      • Capabilities: The attacker controls the data channel and can write secondary instructions. Both malicious and benign secondary instructions count as violating data-instruction separation. The attacker cannot modify the primary instruction, LLM parameters, or the detector.
      • Two tiers: A baseline attacker only seeks to make the model execute secondary instructions. An adaptive attacker additionally appends a suffix optimized to fool the linear probes.
      • Success: Inputs containing secondary instructions are classified as benign by all or a majority of drift detectors. The adaptive setting also requires the injection to remain effective. The defender must detect task drift when secondary instructions appear.
  2. What related research exists?

    Work builds on task-drift probes by Abdelnabi et al., and adapts GCG from jailbreaking to fooling detectors.

    Background discussion is organized around prompt injection, detection defenses, and adversarial suffixes, with no separate Related Work section.

    Prompt injection and retrieval

    • Perez and Ribeiro (2022): Prompt attacks against language models. The paper uses this to illustrate attackers appending or embedding instructions in inputs.
    • Greshake et al. (2023): Indirect prompt injection against real applications interfacing with LLMs. The paper uses this to show external data can be controlled by attackers.
    • Lewis et al. (2020), Jiang et al. (2023): Retrieval-augmented generation and its active retrieval variant. The paper bases the threat surface of untrusted retrieved data on these, without separately criticizing either work.

    Detection and defense

    • Liu et al. (2024): Formalizes and benchmarks prompt injection attacks and defenses. The paper categorizes this as input filtering: detecting and removing suspicious patterns before entering the model.
    • Instruction hierarchy and perplexity detection: The paper does not name specific works. The former trains models to prioritize certain instruction sources; the latter flags inputs deviating from expected distributions. The authors claim these defenses often fail against sophisticated attacks or impose usability constraints.
    • Abdelnabi et al. (2025): Trains logistic regression probes on activation differences at multiple hidden layers to distinguish clean from poisoned. The paper explicitly contrasts: they evaluate direct prompt injection, while this paper asks whether the same type of linear probe can be bypassed by suffix optimization.

    Adversarial examples and suffixes

    • Goodfellow et al. (2014): Visual adversarial examples. The paper uses this to illustrate that adversarial perturbation on discrete tokens is harder and must preserve semantics.
    • Zou et al. (2023)'s GCG: Iteratively replaces suffix tokens to jailbreak aligned models. The paper states it adapts this, shifting the goal from forcing harmful generation to fooling the detector.
    • The paper also lists synonym substitution, paraphrasing, character-level perturbation, and suffix-based attacks, without naming further works or comparing each.

    Baselines and data: The attacked probes are those reported by Abdelnabi et al., attached to layers 0, 7, 15, 23, 31 of Phi-3 3.8B and Llama-3 8B. The data is TaskTracker reconstructed with the same split. Defense baselines include probes without adversarial training and probes trained on PGD-perturbed activations.

    The authors state the paper builds directly on that probe framework and frame the contribution as the first systematic evaluation of activation-based prompt injection detectors under an adaptive threat model.

  3. How does the paper address this problem?

    Modify GCG with multi-probe loss gradients to find a universal suffix that makes all probes classify as benign.

    Multi-probe evasion attack treats the suffix appended to poisoned inputs as a discrete variable, using a modified GCG to inject each layer's probe loss into LLM backpropagation, seeking a universal suffix that makes all probes classify inputs containing secondary instructions as benign.

    Problem setup and joint objective

    • A logistic regression probe is attached at each layer in the set P. The paper writes z as the weight transpose times the layer activation plus bias, with output probability sigmoid(z). The true class is 1, and the target label y_t is set to 0.
    • The joint objective is a weighted sum of each layer's probe loss. x is the original prompt containing the injected text, and ⊕ denotes concatenation:

    Ltotal(s)=∑l∈ Pλlℓ(l)(h(l)(x⊕ s),yt) That is, the suffix must make each layer classify the concatenated input as y_t.

    • The authors tried different λ_l for different layers to emphasize deeper probes. The authors claim that setting all λ_l to 1 already fools all probes simultaneously, so weighted gradients are not used.

    How gradients are injected

    • When backpropagating L_total, at each probed layer, the extra term from the probe loss is added to the hidden activation gradient. The paper's recurrence (Eq. 2) is: the gradient from the next layer, plus λ_l·(p−y_t)·W when that layer is in P.
    • Figure 1 caption: solid lines are forward pass, dashed lines are probe loss gradients entering the shared gradient path, then backpropagated to update the suffix.
    • The design intent is that the suffix need not change the injection semantics, only push the monitored layer activations into the linear probe's benign region.

    Curriculum-style optimization of the universal suffix

    Algorithm 1 does not compute gradients over the full training set at once, but gradually expands the active set A:

    1. Start from a fixed token sequence s_init, with A initially containing only one seed prompt.
    2. For each prompt in A, compute token-coordinate gradients per Eq. 2, accumulating into matrix G.
    3. Use GCG-style top-k replacement sampling to generate candidate suffixes, keeping the candidate that minimizes the sum of L_total over A.
    4. Only if the current suffix's success rate on A is at least τ_exp, add the next training prompt in order.
    5. Stop when the full training set is evaded with success rate at least τ, or when reaching the iteration cap K.

    Specific choices in the text: suffix length is fixed to the initial suffix length. On Llama-3, variable length was allowed; the authors claim results were comparable, but it became too long after several iterations, so it was fixed. Start with the first of randomly selected training prompts; add the next prompt when all classifiers misclassify the current prompt at some confidence threshold, with 0.7 as an example. After one iteration, if 80% or more prompts are misclassified, add the next prompt. The plan is at most 500 iterations; the authors claim typically at most 100–120 iterations suffice to get a suffix effective on many prompts. The paper does not give values for candidate count, top-k, τ, τ_exp, or the initial suffix content.

    How attack and defense success are measured

    • Attack: fool all probes simultaneously; fool a majority of probes; fool the last four probes. The authors state the first layer is unreliable and often errs even without a suffix, so the last four are listed separately.
    • Defense is done only on Phi-3, with criteria of all, majority, or last four classifiers correct. Two training routes: one is PGD from Madry et al. (2017), using perturbed poisoned activations, plus clean and poisoned activations to train logistic regression, without seeing suffixes during training; the other is random suffix augmentation, generating multiple suffixes with the Section IV algorithm on the baseline model, splitting into train, validation, test, and during training and validation randomly appending one from the corresponding set, forward-passing to get what the authors call adversarially poisoned activations, then training with clean and poisoned activations. Testing uses unseen suffixes and attempts direct attacks on the retrained probes to find new suffixes. The paper does not state the number of suffixes in the pool, nor the number of PGD steps or perturbation magnitude.
  4. What experiments did the paper conduct?

    All-five-probes ASR is 93.91% for Phi-3 and 99.63% for Llama-3; suffix augmentation evaluated only on Phi-3.

    Experimental Setup

    • Models: Phi-3 3.8B and Llama-3 8B. Probes are logistic regression, layers 0, 7, 15, 23, 31, settings same as Abdelnabi et al. No separate LLM judge.
    • Data: Reconstructed TaskTracker, split same as that paper. Training subset 418,110 examples; test poisoned subset 31,134 examples. Includes clean and poisoned with secondary instructions.
    • Attack: Modified GCG, fixed suffix length. Curriculum expands the active set. Planned 500 iterations; authors say suffixes effective for many prompts are usually obtained within 100–120 iterations. The paper does not report the number of repetitions, nor how many training prompts were actually used for optimization.
    • Attack metrics: ASR, by three criteria: all five probes, last four probes, majority (≥3). Also distribution of misclassification counts and per-layer misclassification. Table III title does not specify the subset.
    • Defenses: Done only on Phi-3. Baselines are baseline probes, PGD-trained probes, suffix-augmented probes. Tables IV and V specify clean and poisoned test sets without suffixes; Table VI is adversarial suffixes on the test set, listing 10 suffix indices.
    • Generation analysis: Two models, multiple inputs from the test set, with and without suffix, qualitatively whether the main and secondary instructions are answered. The paper does not report the number of examples.

    Main Results

    CriterionPhi-3 3.8BLlama-3 8B
    All five probes93.91%99.63%
    Last four probes95.28%99.63%
    Majority (≥3)99.79%99.99%

    Per Table III. The table title does not specify the evaluation subset.

    • The authors claim a single universal suffix transfers across thousands of different poisoned prompts, and claim >99% evasion under majority voting. In the text of Fig. 2 and Fig. 3, the proportion misclassified by all probes after adding the suffix is the same as the all-five-probes row in the table.
    • No-suffix control is not in Table III. The authors' description of Fig. 2: Phi-3 has 56.56% flagged by all probes, 41.83% flagged by four probes. For Fig. 3: Llama-3 has 0.17% fooling all probes, 59.59% correctly detected by all probes. Table II test-set poisoned all-five-probes agreement is Phi-3 56.54%, Llama-3 59.76%; the paper does not state whether this is the same computation as those two figures.
    • The authors claim that after the attack, Phi-3's per-deep-layer misclassification rate exceeds 95%, and Llama-3's per-layer rates are 99–100% (text of Fig. 4 and Fig. 5; the per-point bar heights are not visible in the given text). The authors claim that before the attack, Phi-3's misclassification rates on poisoned at layers 7, 15, 23, 31 are below 1%, and Llama-3's error rates are below 6% except the first layer. Table I test-set poisoned accuracy: Phi-3 layer 7 98.54%; Llama-3 layer 7 83.53%, layer 31 94.59%. The paper does not convert accuracy to error rate, nor explain the relationship to the above claims.

    Probe Performance Before the Attack

    • Table I (test set): Layer 0 is weak for both models. Phi-3 poisoned at layers 7, 15, 23, 31 is 98.54%, 99.46%, 99.91%, 99.37%. Llama-3 poisoned is 83.53%, 96.67%, 97.94%, 94.59%. The authors claim deeper probes have >95% accuracy on poisoned, which is inconsistent with Llama-3 layers 7 and 31.
    • Table II (test-set agreement): Phi-3 poisoned all-five-probes 56.54%, last-four-probes 97.80%; Llama-3 59.76% and 79.38%. The authors claim Phi-3's last four probes have high agreement on poisoned, so they list the last four probes as a separate criterion, and claim the first layer is unreliable.
    • On clean, all-five-probes agreement is lower: Phi-3 48.27%, Llama-3 60.84% (Table II).

    Defense Evaluation (Phi-3 only)

    Swipe horizontally to read the table

    SubsetCriterionBaselinePGDSuffix-augmented
    cleanAll probes47.92%0%0.13%
    cleanLast four probes67.77%0%73.04%
    cleanMajority ≥394.32%18.42%85.25%
    poisoned, no suffixAll probes56.53%99.04%94.94%
    poisoned, no suffixLast four probes97.78%99.04%95.49%
    poisoned, no suffixMajority ≥399.74%99.98%99.47%

    Per Table V.

    • The authors claim suffix augmentation is comparable to baseline on clean, with the exception that the first layer is poor, and attribute the all-probes degradation to the first layer. In Table IV, suffix-augmented clean layer 0 is 0.16%, layer 7 91.77% (baseline 97.39%), layer 15 88.14% (baseline 78.45%). In Table V, all-probes and majority are lower than baseline, last-four-probes higher than baseline. This is not consistent everywhere with the abstract and conclusion's "maintains performance on clean inputs."
    • PGD is lower on clean. Table IV: layers 0 and 7 are 0%, layer 31 29.21%. On poisoned without suffix, PGD layers 0 and 7 are 100%; suffix-augmented is close to baseline, e.g., layer 23 99.58% (baseline 99.91%).
    • Table VI (test set, 10 suffixes): baseline on all five probes is 0.00%–0.17%; the authors claim it fails under every criterion. Suffix-augmented all-five-probes is 79.79% (index 1) to 99.41% (index 4). The authors claim 80–100%; the lowest all-five-probes cell in the whole table is 79.79%. Majority is 98.81% (index 2) to 100.00%. PGD all-five-probes is 1.31% (index 6) to 49.49% (index 5), majority 49.10% (index 4) to 94.38% (index 5). Last-four-probes is identical row-by-row to all-five-probes in both retrained columns. The authors consider PGD poor, possibly because perturbed activations differ substantially from activations from actually appended suffixes run forward. When directly attacking the suffix-augmented probe, the authors claim it is hard to find a suffix even with different initial suffixes; the paper does not give the success rate of that attack.

    How the Suffix Changes Generation

    • What was tested: Two models, multiple inputs from the test set, with and without suffix, whether the main and secondary instructions are answered. The paper does not report the number of examples. Table III's ASR only counts whether the probe is fooled.
    • No suffix: Both models sometimes answer the secondary instruction, sometimes ignore it; all tested benign main instructions are answered, even when the secondary instruction is preceded by a trigger phrase instructing to ignore other instructions.
    • With suffix: Llama is only mildly affected, still answering all benign main instructions and some secondary instructions. Phi in most cases ignores the main instruction, with output driven mainly by keywords in the suffix. The authors call this analysis preliminary, and argue the suffix does not hinder the attacker's goal: for Phi the suffix itself changes behavior, for Llama the effect is limited; even if the secondary instruction is ignored (which also happens without the suffix), the attack can still count as successful if the main instruction is ignored or extra content appears alongside the main answer. The appendix gives one Phi-3 example: both the main and secondary tasks are benign; without the suffix both are executed, with the suffix all instructions are ignored and content driven by suffix tokens is produced.

    Other Ablations and Analyses

    • Layer weights λ_l: tried emphasizing deeper layers, then abandoned because all-1 already fools all simultaneously; no ASR with different weights.
    • Llama suffix longer vs. fixed length: the authors claim comparable effectiveness; longer becomes too long, so fixed. No corresponding ASR.
    • Curriculum condition: next prompt added only when misclassification reaches 80% or above; example confidence threshold for misclassification 0.7.
    • Iterations: planned cap 500; authors claim usually at most 100–120 iterations yield suffixes effective for many prompts. Not reported how many training prompts were covered.
    • Direct attack on suffix-augmented probe: authors claim hard to succeed, no success-rate number.
    • Table II and Table V baseline all-five-probes poisoned are 56.54% and 56.53%; the paper does not explain the difference.
  5. What are some points that can be further explored?

    Paper does not list limitations and future directions in a dedicated section or conclusion.

    Limitations and future directions noted by the authors

    The paper does not specifically discuss limitations. There is no dedicated Limitations or Future Work section. The Conclusion mentions a gap between detection on standard benchmarks and robustness under adaptive adversaries, and that defenses should target specific attack surfaces rather than relying only on general robust techniques; these sentences are not framed as shortcomings of the method or as future plans. Section VII has a sentence calling the behavioral analysis preliminary, but that sentence is not in Limitations, Discussion, Conclusion, Future Work, or the appendix's limitation notes.

    Experimental coverage

    • The tested LLMs are Phi-3 3.8B and Llama-3 8B; the probes are logistic regression, with layer numbers 0, 7, 15, 23, 31 (Section V, following the setup of Abdelnabi et al.).
    • The data is the reconstructed TaskTracker, with a training subset of 418,110 instances and a test poisoned subset of 31,134 instances, split as in that paper. Tables I, II, IV, V, VI are stated as test sets; Table III's title does not specify the subset.
    • Defense experiments are conducted on Phi-3, including PGD adversarial training and random suffix augmentation; Table VI gives three criteria—all five probes, last four probes, and majority vote—for 10 test suffixes.
    • Section VII compares generation with and without suffixes for both models; the authors call this analysis preliminary; the paper does not report sample sizes, automated evaluation, or number of repetitions.
    • The paper does not report the defense suffix pool size, suffix token length, GCG candidate count, values of τ and τ_exp, number of attack repetitions, or the quantitative proportion of injected tasks completed. The text states the expansion condition as misclassification of 80% or more, a confidence threshold example of 0.7, and an iteration plan of 500, typically at most 100–120 (Section V, Algorithm 1).
  6. Summarize the main content of the paper

    A universal adversarial suffix can simultaneously fool activation-drift probes of both models; random suffix augmentation raises detection on unseen suffixes.

    This work attacks prompt injection detectors attached to LLM hidden layers, not directly jailbreaking aligned models.

    • Problem: In RAG, an adversary can control retrieved data and write secondary instructions. Abdelnabi et al. use logistic regression probes on multi-layer activation differences to detect task drift. The authors ask: can an additional suffix be appended so that all probes classify the poisoned input as benign while the injection remains effective?
    • Approach: The adaptive adversary cannot modify the primary instruction, model parameters, or the detector. The method is multi-probe GCG: gradients from each layer's probe loss are added to backpropagation, the training prompt set is expanded curriculum-style, and a fixed-length universal suffix is optimized with the target label benign. There are two defenses, trained only on Phi-3: PGD perturbing poisoned activations, and randomly appending multiple adversarial suffixes before retraining the probes.
    • Evasion numbers: Table III's all-five-probe ASR is 93.91% for Phi-3 3.8B and 99.63% for Llama-3 8B; majority vote is 99.79% and 99.99%. The table title does not specify the subset. The authors claim this suffix transfers to thousands of different poisoned prompts. Table III only counts whether the probes are fooled.
    • Detector original performance: On the test set, layer 0 is weak. The authors claim deeper probes exceed 95% on poisoned inputs, but in Table I, Llama-3 layer 7 is 83.53% and layer 31 is 94.59%.
    • Defenses and generation: In Table VI, baseline probes' all-five-probe accuracy on test suffixes is as low as 0.00%; suffix augmentation ranges from 79.79% to 99.41%. The authors claim 80–100% on unseen suffixes and state that directly attacking the retrained probes makes it hard to find new suffixes. PGD degrades on clean inputs, with Table IV showing 0% at layers 0 and 7. With suffixes, Llama still answers the benign primary instruction, while Phi mostly ignores the primary instruction and follows the suffix keywords. The authors still consider this not to hinder the attack objective.

    The authors conclude that reporting detection performance only on standard injections does not reveal resilience to adaptive suffixes; defenses should target this attack surface. The authors present random suffix augmentation as more robust to both known and unseen suffixes.

Related papers

Read originalIJCNN 2026