cs.CRSep 5, 2026

Structurally Close, Temporally Distant: Measuring Security Exposure in Long-Horizon LLM Agents

Authors: Md Jafrin Hossain, Nur Al Hasan Haldar

Organizations: The University of Western Australia

Abstract

Long-horizon LLM agents interact with untrusted content, persistent memory, external state, and sensitive tools. Existing analyses often characterize attacks by the number of execution steps between malicious input and a downstream action. We show that temporal remoteness can overstate security separation in stateful agents. We introduce a provenance-aware execution graph linking agent events through deterministic state, identifier, and tool provenance, and define influence distance \DI\DI as the shortest structural path from an untrusted source to a sensitive action. We compare it with sequence distance \DT\DT, the shortest injection--sink path in the ordered trajectory. Since the influence graph contains every sequence edge, \DI≤\DT\DI \leq \DT; \Gap=\DT−\DI\Gap=\DT-\DI measures the separation hidden by step count. Across 454 injection--sink pairs from 360 long-horizon AgentDojo trajectories over OpenAI's gpt-4o-mini and gpt-4o and Claude's Haiku 4.5 and Sonnet 4.6, \Gap>0\Gap>0 for 96.9% of pairs, with a median gap of 9 hops; 91.0% remain decoupled after removing the largest provenance-only edge class. On AgentDojo's banking suite, 33.8% of 231 pairs from 377 trajectories decouple through different provenance mechanisms. Among 274 OpenAI pairs, \Gap\Gap does not independently predict attack success after controlling for \DT\DT, attack family, and backend (β\Gap=0.066β_{\Gap}=0.066, p=.088p=.088). At matched thresholds k=2,3k=2,3, a deterministic \DI\DI-based pre-execution gate blocks five attack sinks missed by a sequence-only gate with no additional benign blocking, although the paired gain is not significant (p=.0625p=.0625). Execution structure therefore reveals proximity hidden by step count and can support targeted runtime intervention. We measure candidate influence pathways rather than causal attribution.

Figures & tables

Appendix figures & tables7 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Agent-Sentry: Bounding LLM Agents via Execution Provenance

    Mar 24, 2026Rohan Sequeira, Stavros Damianakis, Umar Iqbal +1Computer-Use Agent SafetyAI Agent Security

  2. Kairos: Transactional Security Enforcement at the System Boundary for LLM Agents

    Oct 13, 2026Kristoffer Hempel, Nils Loose, Lorenzo Cavallaro +1LLM Agent SecurityRuntime Enforcement for AI Agents

  3. PROVISO: Provenance-Informed Action Selection for Secure LLM Agents

    Oct 19, 2026Bo Yan, Qi Zhang, Ziwen Kan +2LLM Agent SecurityLLM Agents