Attnlocate accurately localizes malicious instruction spans in LLM agents
Attnlocate can detect behavior-guiding malicious context with high precision and low false positives
arXiv 25 Aug 2026 Defense Prototype evidence
Published as “What Guides the Agent? Adjudicating Unauthorized Behavior via Localizing Behavior-Guiding Instructions”
Why it matters
Enables fine-grained, provenance-aware policy enforcement for LLM agents, allowing systems to block unauthorized tool invocations that stem from malicious external content.
Summary
AttnLocate localizes behavior-guiding instruction spans in LLM agent contexts and adjudicates them based on provider authority, achieving a mean IoU of 0.743, an average AUROC of 0.956, and a 0.934 true-positive rate at a 0.067 false-positive rate. It works across ten agent configurations from six model families and transfers to unseen models without retraining. The evaluation shows mIoU values between 0.692 and 0.858 and AUROC up to 0.989, though false-positive rates vary by model. The evidence comes from benchmark datasets MCPTox and InjecAgent compared against several baselines.
What they found 2
- AttnLocate achieves high localization and adjudication performance overall.
“AttnLocate achieves a mean IoU of 0.743, an average AUROC of 0.956, and a 0.934 truepositive rate at 0.067 false-positive rate.”
- Span overlap (mIoU) is consistently strong across models.
“AttnLocate yields consistently strong span overlaps, with mIoU spanning from 0.692 to 0.858.”
Caveats 1
- LLaMA-2-7B 0.739 0.813 0.697 0.936 0.883 0.120 0.950
What’s new here 4
- Fine-grained span localization of behavior-guiding instructions using attention-based object detection.
- Authority-based adjudication that rejects unauthorized tool calls based on the provider of the localized span.
- Runtime monitoring that requires only white-box access to attention matrices, without modifying the agent workflow.
- Cross-model generalization and policy-adaptation without retraining the detection model.