CounterSteer: Suppressing Indirect Prompt Injection with Activation Steering
On the map: LLM agents and tool use → Agent threats, guardrails and governance
also in 1 more
Abstract (arXiv)
Indirect prompt injection makes an LLM agent treat untrusted retrieved text as instructions. We present CounterSteer, an inference-time defense that suppresses this behavior inside the model. Per model, a five-step recipe fits a residual-stream direction from paired episodes differing only in whether an embedded instruction is followed, and retains it only if it passes pre-specified causal and capability gates. At deployment, the direction is subtracted from every tool-result token during prefill. The edit is always on--there is no detection decision to evade--and requires no fine-tuning, auxiliary model, or added tokens, only white-box serving and tool-result span boundaries. Across five open-weights models (8B-106B, five vendor lineages), held-out attack success falls from 0.21-1.00 undefended to 0.00-0.17 defended, and AgentDojo compromise rate from 0.10-0.49 to 0.006-0.079, at 93-100% typography-normalized benign utility, with larger task-dependent costs when reasoning over steered content. A benchmark-level adaptive attacker reaching 0.67-0.73 undefended is held to roughly a quarter of that on the two most deeply evaluated models. Among the defenses we measured on capable models, those achieving lower compromise rates either lost 22-89% of benign utility or fine-tuned the served weights. White-box gradient attacks through the deployed vector compromise at most 2 of 52 episodes, and none of 2,052 replayed human red-team attacks succeeds. CounterSteer largely neutralizes instructional takeover: a black-box framing search cracks 3 of 18 development samples. Parameter manipulation--attacker-chosen arguments in otherwise legitimate calls--is only partially resisted (13 of 18); the decision becomes linearly readable at argument emission but not at the examined pre-generation sites, and is not removed by the tested prefill- or decode-time steering, motivating argument-provenance controls.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 49 of its 64 references that are in the map. First posted on arXiv 29 Sep 2026.
Builds on
49 of 64 references.
Closest ancestors · 10
Same direction, newest first
- 2026ROPE: Routed Origin Policy Enforcement against Indirect Prompt Injection27 Aug
- 2026Your Agentic LLMs Secretly Encode Indirect Prompt-Injection Exposure in Hidden States1 Aug
- 2026Defending against Adaptive Prompt Injection Attacks via Reasoning-enabled Task Alignment13 Jun
- 2026ICON: Indirect Prompt Injection Defense for Agents based on Inference-Time Correction24 Feb
- 2025Taxonomy, Evaluation and Exploitation of IPI-Centric LLM Agent Defense Frameworks19 Nov
- 2025DRIFT: Dynamic Rule-Based Defense with Injection Isolation for Securing LLM Agents13 Jun
- 2025Design Patterns for Securing LLM Agents against Prompt Injections10 Jun
- 2025Progent: Securing AI Agents with Privilege Control16 Apr
- 2025Defeating Prompt Injections by Design24 Mar
- 2025MELON: Provable Defense Against Indirect Prompt Injection Attacks in AI Agents7 Feb
Other references · 39
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2025Qwen3 Technical Reportcited by 8,195
- 2020Measuring Massive Multitask Language Understandingcited by 7,768
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2023Inference-Time Intervention: Eliciting Truthful Answers from a Language Modelcited by 1,259
- 2025gpt-oss-120b & gpt-oss-20b Model Cardcited by 1,258
- 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,239
- 2023Instruction-Following Evaluation for Large Language Modelscited by 1,143
- 2023Steering Llama 2 via Contrastive Activation Additioncited by 1,009
- 2024Refusal in Language Models Is Mediated by a Single Directioncited by 960
- 2023Steering Language Models With Activation Engineeringcited by 824
- 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 441
27 more
- 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 325
- 2024Improving Alignment and Robustness with Circuit Breakerscited by 302
- 2024Defending Against Indirect Prompt Injection Attacks With Spotlightingcited by 233
- 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 179
- 2024Analyzing the Generalization and Reliability of Steering Vectorscited by 130
- 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attackscited by 124
- 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injectionscited by 108
- 2025The Geometry of Refusal in Large Language Models: Concept Cones and Representational Independencecited by 104
- 2023Jatmo: Prompt Injection Defense by Task-Specific Finetuningcited by 89
- 2024Attention Tracker: Detecting Prompt Injection Attacks in LLMscited by 82
- 2023Is This the Subspace You Are Looking for? An Interpretability Illusion for Subspace Activation Patchingcited by 75
- 2024Can LLMs Separate Instructions From Data? And What Do We Even Mean By That?cited by 70
- 2024Instructional Segment Embedding: Improving LLM Safety with Instruction Hierarchycited by 62
- 2024Get my drift? Catching LLM Task Drift with Activation Deltascited by 61
- 2026AgentDyn: Are Your Agent Security Defenses Deployable in Real-World Dynamic Environments?cited by 45
- 2025Defending Against Prompt Injection with DataFiltercited by 30
- 2025Defending Against Prompt Injection With a Few DefensiveTokenscited by 26
- 2024Do LLMs "know" internally when they follow instructions?cited by 25
- 2025ASIDE: Architectural Separation of Instructions and Data in Language Modelscited by 21
- 2025LLMail-Inject: A Dataset from a Realistic Adaptive Prompt Injection Challengecited by 20
- 2026Prompt Injection as Role Confusioncited by 11
- 2026Tool Calling is Linearly Readable and Steerable in Language Modelscited by 9
- 2025ARGUS: Defending Against Multimodal Indirect Prompt Injection via Steering Instruction-Following Behaviorcited by 6
- 2025CachePrune: Teaching LLMs What Not to Follow via KV-Cache Editingcited by 2
- 2026Security--Fidelity Tradeoffs: The Hidden Cost of Prompt Injection Defensecited by 2
- 2026Steering Instruction Hierarchies at Inference Timecited by 2
- 2026COPA: Continual Preference Optimization for Adaptive Prompt Injection Defensecited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Mitigating Indirect Prompt Injection via Instruction-Following Intent Analysis
- 2026AgentSentry: Mitigating Indirect Prompt Injection in LLM Agents via Temporal Causal Diagnostics and Context Purification
- 2026AttriGuard: Defeating Indirect Prompt Injection in LLM Agents via Causal Attribution of Tool Invocations
- 2026Defusing Explosive Prompts: Understanding and Preventing Trigger-Based Prompt Injections in LLM Agents
- 2026AgentDrift: A Step-Labeled Benchmark of Injection-Hijacked LLM Agent Trajectories
- 2026ClawGuard: A Runtime Security Framework for Tool-Augmented LLM Agents Against Indirect Prompt Injection
- 2026CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal Attribution
- 2026Silent Failures in Agentic Security Evaluation: A Validated Harness for Tool-Call Mediation Under Indirect Prompt Injection