English

Spectral Guardrails for Agents in the Wild: Detecting Tool Use Hallucinations via Attention Topology

Machine Learning 2026-02-10 v1 Artificial Intelligence Signal Processing

Abstract

Deploying autonomous agents in the wild requires reliable safeguards against tool use failures. We propose a training free guardrail based on spectral analysis of attention topology that complements supervised approaches. On Llama 3.1 8B, our method achieves 97.7\% recall with multi-feature detection and 86.1\% recall with 81.0\% precision for balanced deployment, without requiring any labeled training data. Most remarkably, we discover that single layer spectral features act as near-perfect hallucination detectors: Llama L26 Smoothness achieves 98.2\% recall (213/217 hallucinations caught) with a single threshold, and Mistral L3 Entropy achieves 94.7\% recall. This suggests hallucination is not merely a wrong token but a thermodynamic state change: the model's attention becomes noise when it errs. Through controlled cross-model evaluation on matched domains (N=1000N=1000, T=0.3T=0.3, same General domain, hallucination rates 20--22\%), we reveal the ``Loud Liar'' phenomenon: Llama 3.1 8B's failures are spectrally catastrophic and dramatically easier to detect, while Mistral 7B achieves the best discrimination (AUC 0.900). These findings establish spectral analysis as a principled, efficient framework for agent safety.

Keywords

Cite

@article{arxiv.2602.08082,
  title  = {Spectral Guardrails for Agents in the Wild: Detecting Tool Use Hallucinations via Attention Topology},
  author = {Valentin Noël},
  journal= {arXiv preprint arXiv:2602.08082},
  year   = {2026}
}

Comments

32 pages, 2 fgures, 18 tables