Skip to content

CounterSteer: Suppressing Indirect Prompt Injection with Activation Steering

Sep 2026 · 0 citations · 64 references
Computer Science

TL;DR

CounterSteer largely neutralizes instructional takeover: a black-box framing search cracks 3 of 18 development samples, and Parameter manipulation--attacker-chosen arguments in otherwise legitimate calls--is only partially resisted.

Abstract

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.

View source

Similar papers

Preprint Aug 2026

Recognition Without Enforcement: Configuration-Dependent Failures in LLM Agent Instruction Arbitration and External Control

This work treats model self-arbitration as a capability rather than a security boundary and implements an external reference monitor combining authenticated source routing with capability-gated tool execution, deterministically rejects all tested forged, tampered, replayed, and unsigned requests while preserving legiti...

Jun Wen Leong · 0 citations
#artificial intelligence Preprint Oct 2026

Readable Before Actionable: Causal Tracing of Indirect Prompt Injection

Indirect prompt injection causes LLM agents to follow commands embedded in external data. A probe may distinguish instructions from data without identifying a state edit that changes the next action. We study this gap through counterfactual role probes, component-wise activation patching, and separate interventions on...

Zhen-Qiang Yu, Wen-Peng Xing, Xing-Xing Yang et al. · 0 citations
Preprint Aug 2026

SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillation

This paper proposes Secure On-Policy Distillation (SecOPD) that provides token-level feedback to guide defensive fine-tuning, and generalizes to domains completely unseen in training.

Yibo Peng, Long Lian, David A. Wagner et al. · 5 citations · ⚡1

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.