Abstract
With the development of customized large language model (LLM) agents, a new threat of black-box backdoor attacks has emerged, where malicious instructions are injected into hidden system prompts. These attacks easily bypass existing defenses that rely on white-box access, posing a serious security challenge. To address this, we propose SLIP, a Soft Label mechanism and key-extraction-guided CoT-based defense against Instruction backdoors in APIs. SLIP is designed based on two key insights. First, to counteract the model's oversensitivity to triggers, we propose a Key-extraction-guided Chain-of-Thought (KCoT). Instead of only considering the single trigger or the input sentence, KCoT prompts the agent to extract task-relevant key phrases. Second, to guide the LLM toward correct answers, our proposed Soft Label Mechanism (SLM) prompts the agent to quantify the semantic correlation between key phrases and candidate answers. Crucially, to mitigate the influence of residual triggers or misleading content in phrases extracted by KCoT, which typically causes anomalous scores, SLM excludes anomalous scores deviating significantly from the mean and subsequently averages the remaining scores to derive a more reliable semantic representation. Extensive experiments on classification and question-answer (QA) tasks demonstrate that SLIP is highly effective, reducing the average attack success rate (ASR) from 90.2% to 25.13% while maintaining high accuracy on clean data and outperforming state-of-the-art defenses.
The Threat of Instruction Backdoors
As LLM APIs become more accessible, developers are creating "customized agents" by embedding specific instructions into system prompts. To protect intellectual property, these prompts are often hidden from the end-user (black-box). This creates a massive security hole: an attacker can inject a "backdoor" into these hidden instructions (e.g., "If the input contains the word 'cf', always classify it as Negative").
Existing defenses struggle in this black-box environment. Some try to detect triggers by looking at perplexity, while others use Chain-of-Thought (CoT) to "self-reflect." However, once a backdoor is activated, the model's internal logic is often so compromised—a phenomenon the authors call cognitive override—that it cannot reason its way back to the truth. The challenge is not just identifying the poison, but successfully "neutralizing" it to produce the correct result.
Methodology: The SLIP Framework
SLIP (Soft Label mechanism and key-extraction-guided CoT-based defense) consists of two main components designed to break the model's oversensitivity to malicious triggers:
- Key-extraction-guided Chain-of-Thought (KCoT): Instead of asking the model for a direct answer (which triggers the backdoor), KCoT forces the model to first decompose the input into a list of task-relevant keywords and phrases. This shifts the model's focus from the malicious trigger to the actual semantic content of the text.
- Soft Label Mechanism (SLM): The authors discovered that backdoored models assign unnaturally high "correlation scores" to triggers, even if they are semantically unrelated to the target label. SLM exploits this by asking the model to score the semantic relationship of each extracted keyword to the possible labels (e.g., on a scale of 0-100). It then uses statistical clustering to identify and discard "outlier" phrases (the triggers) before averaging the remaining scores to determine the final classification.
Experimental Evaluation
The researchers evaluated SLIP across several diverse benchmarks, including classification tasks (SST2, AGnews, Amazon) and complex reasoning tasks (CSQA, MMLU). They tested against four state-of-the-art attacks: Word-level, Syntax-level, Semantic-level, and Badchain.
Key Results
SLIP significantly outperformed existing baselines like ONION and ZS-CoT:
- Attack Success Rate (ASR): SLIP reduced the average ASR from over 90% (no defense) to 25.13%.
- Clean Accuracy (CACC): While many defenses degrade the model's performance on normal inputs, SLIP maintained a high clean accuracy of 87.15%.
- QA Performance: In complex reasoning tasks (BadChain attack), SLIP reduced the attack success rate to 18.45%, whereas other prompt-based defenses remained highly vulnerable (often above 50% ASR).
Conclusion and Future Work
SLIP represents a significant step forward in securing black-box LLM APIs by focusing on recovery over detection. By forcing the model to quantify semantic relationships and filtering statistical outliers, SLIP allows agents to remain functional even when under attack.
Future work will focus on generalizing the Soft Label Mechanism to continuous output spaces (like open-ended generation) and improving robustness for extremely short inputs where keyword extraction is limited.
Summary updated