Structurally Close, Temporally Distant: Measuring Security Exposure in Long-Horizon LLM Agents
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 as the shortest structural path from an untrusted source to a sensitive action. We compare it with sequence distance , the shortest injection--sink path in the ordered trajectory. Since the influence graph contains every sequence edge, ; 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, 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, does not independently predict attack success after controlling for , attack family, and backend (, ). At matched thresholds , a deterministic -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 (). 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
| Work | Long horizon | Provenance | Struct. distance | Runtime |
|---|---|---|---|---|
| AgentDojo ( Debenedetti et al., 2024 ) | ✓ | – | – | – |
| Long-horizon character. ( Yi et al., 2025 ) | ✓ | – | – | – |
| CaMeL ( Debenedetti et al., 2026 ) | – | ✓ | – | ✓ |
| FIDES ( Costa et al., 2025 ) | – | ✓ | – | ✓ |
| RTBAS ( Zhong et al., 2025 ) | – | ✓ | – | ✓ |
| Attention Tracker ( Hung et al., 2025 ) | – | – | – | ✓ |
| Suite | Pairs | Decoupled | Rate | Median | Max | Median |
|---|---|---|---|---|---|---|
| Long-horizon | 454 | 413 | 91.0% | 3 | 35 | 23 |
| Banking | 231 | 78 | 33.8% | 0 | 19 | 5 |
| Predictor | Coef. | SE | ||
|---|---|---|---|---|
| Intercept | ||||
| Sequence distance | ||||
| Structural gap | ||||
| Delayed attack family | ||||
| Backend B |
| Full graph | Conservative | |||
|---|---|---|---|---|
| Attack | Benign | Attack | Benign | |
| 2 | +5 | +0 | +5 | +0 |
| 5 | +23 | +3 | +7 | +1 |
| 8 | +48 | +15 | +21 | +5 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | LH pairs | LH rate | Bank pairs | Bank rate |
|---|---|---|---|---|
| GPT-4o-mini | 127 | 91.3% | 99 | 45.5% |
| GPT-4o | 147 | 98.0% | – | – |
| Haiku 4.5 | 91 | 100.0% | 54 | 18.5% |
| Sonnet 4.6 | 89 | 100.0% | 78 | 29.5% |
| Suite | Model | Successful / traces | ASR |
|---|---|---|---|
| Long-horizon | GPT-4o-mini | 45/90 | 50.0% |
| Long-horizon | GPT-4o | 62/90 | 68.9% |
| Long-horizon | Haiku 4.5 | 1/90 | 1.1% |
| Long-horizon | Sonnet 4.6 | 0/90 | 0.0% |
| Banking | GPT-4o-mini | 40/54 | 74.1% |
| Banking | Haiku 4.5 | 0/141 | 0.0% |
| Full graph | Conservative | |||
|---|---|---|---|---|
| Attack | Benign | Attack | Benign | |
| 2 | +5 | +0 | +5 | +0 |
| 3 | +5 | +0 | +5 | +0 |
| 5 | +23 | +3 | +7 | +1 |
| 8 | +48 | +15 | +21 | +5 |
| 10 | +71 | +34 | +36 | +14 |
| Field | Meaning |
|---|---|
| run_id | Stable trajectory identifier. |
| suite , backend , model_id | Domain and model provenance. |
| task_id , attack_id | User task and injection-task identifiers. |
| injection_id , sink_id | Event identifiers defining the measured pair. |
| d_t | Shortest-path length in the sequence graph. |
| d_i_full , d_i_con | Influence distances under full and conservative graphs. |
| Suite/model | Graph | Pairs | Dec. | Rate | Med. | Med. | Med. |
| LH GPT-4o-mini | Full | 127 | 116 | 91.3% | 23 | 8 | 12 |
| LH GPT-4o-mini | Conservative | 127 | 115 | 90.6% | 23 | 9 | 9 |
| LH GPT-4o | Full | 147 | 144 | 98.0% | 24 | 14 | 7 |
| LH GPT-4o | Conservative | 147 | 118 | 80.3% | 24 | 17 | 2 |
| LH Haiku 4.5 | Full | 91 | 91 | 100.0% | 23 | 14 | 9 |
| LH Haiku 4.5 | Conservative | 91 | 91 | 100.0% | 23 | 18 | 4 |
AI Agent Security
Artificial intelligence agent security studies attacks and safeguards for tool-using, persistent, and collaborative systems across digital and physical settings.
See all 517 papers