CounterSteer is an inference-time defense against indirect . For each target model, it learns a direction in activation space from paired episodes that differ only in whether an embedded instruction is followed, then validates it with causal and capability gates. At deployment the direction is subtracted from every tool-result token during prefill, so there is no detection step to evade and no fine-tuning, auxiliary model, or added tokens.
Across five open-weights models, held-out attack success fell 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, while benign utility stayed at 93-100%. The main limitation is parameter manipulation: attacker-chosen arguments in otherwise legitimate tool calls are only partially resisted, which the authors say motivates argument-provenance controls.