StateFence: Task-State Protection Against Evidence-Chain Contamination in Blue-Team LLM Agents
Organizations: The University of Nottingham Ningbo China Ningbo, China
Abstract
Indirect prompt injection creates a distinctive risk for blue-team Large Language Model (LLM) agents in Security Operations Centers (SOCs). Malicious instructions can be embedded in telemetry, tickets, retrieval results, or memory and then propagate through alert triage, incident summarization, response recommendation, and Indicator of Compromise (IOC) extraction as locally plausible intermediate decisions. We characterize this failure mode as evidence-chain contamination of protected task state. The main challenge is task dependent: a suspicious string may be malicious control text for summarization but essential evidence for IOC extraction. To address this challenge, we propose StateFence, a task-aware evaluation and defense framework that treats severity labels, incident narratives, response policies, and IOC sets as protected states. StateFence maps indirect prompt-injection attacks into explicit, stealth, multi-hop, and persistent SOC evidence attacks, records observable propagation traces, and routes defenses according to the attacked state. Across controlled SOC cases and public-SOC validation cases, StateFence lowers attack success and reduces failures that appear only after evidence is poisoned, while preserving task utility and avoiding the indicator loss caused by task-mismatched filtering. Our findings indicate that robust blue-team LLM agents require mechanisms that preserve task-critical state under untrusted evidence.
Figures & tables
| Task | Protected state | Intervention and utility requirement |
|---|---|---|
| Triage | Severity label | Calibrate severity; retain compromise cues. |
| Summary | Incident narrative | Filter control text; retain incident-point coverage. |
| Response | Action set | Filter and constrain actions; retain useful allowed responses. |
| IOC | Indicator set | Preserve source-linked candidates before filtering facts. |
| Alert Triage | Summarisation | Response | IOC Extraction | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | Defense | TS (%) | AS (%) | PD (%) | TS (%) | AS (%) | TS (%) | AS (%) | TS (%) | AS (%) | Rec. (%) |
| Claude | No defense | 46.88 | 53.12 | 21.88 | 76.56 | 23.44 | 87.50 | 12.50 | 98.44 | 1.56 | 99.00 |
| Best public | 62.50 | 37.50 | 12.50 | 92.19 | 7.81 | 93.75 | 6.25 | 100.00 | 0.00 | 100.00 | |
| StateFence | 87.50 | 12.50 | 4.69 | 93.75 | 6.25 | 95.31 | 4.69 | 98.44 | 1.56 | 98.44 | |
| Gemini | No defense | 65.62 | 34.38 | 18.75 | 89.06 | 10.94 | 90.62 | 9.38 | 60.94 | 39.06 | 62.00 |
| Best public | 79.69 | 20.31 | 7.81 | 95.31 | 4.69 | 92.19 | 7.81 | 95.31 | 4.69 | 95.00 | |
| Model | Defense | TS (%) | AS (%) | PD (%) |
|---|---|---|---|---|
| Claude | No defense | 46.88 | 53.12 | 21.88 |
| Sanitize-only | 26.56 | 73.44 | 29.69 | |
| Policy-only | 82.81 | 17.19 | 7.81 | |
| StateFence | 87.50 | 12.50 | 4.69 | |
| Gemini | No defense | 65.62 | 34.38 | 18.75 |
| Sanitize-only | 50.00 | 50.00 | 28.12 |
| Defense | End-to-end TS (%) | End-to-end AS (%) | IOC Rec. (%) |
|---|---|---|---|
| No defense | 57.81 | 42.19 | 78.13 |
| Best public | 70.31 | 29.69 | 92.19 |
| Full firewall | 46.88 | 53.13 | 62.50 |
| Structured extraction | 65.63 | 34.38 | 81.25 |
| StateFence | 89.06 | 10.94 | 96.88 |
| Defense | TS (%) | AS (%) | Rec. (%) | PD (%) |
|---|---|---|---|---|
| PromptArmor | 84.38 | 15.62 | 92.00 | 15.62 |
| DataFilter | 86.72 | 13.28 | 94.50 | 12.50 |
| LLM Guard | 83.59 | 16.41 | 93.50 | 17.19 |
| StateFence | 91.41 | 8.59 | 94.00 | 4.69 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Threshold | No defense | Full firewall |
|---|---|---|
| Coverage | 82.8 | 93.8 |
| Coverage | 75.0 | 92.2 |
| Coverage | 70.3 | 90.6 |
| Threshold | No defense | Full firewall |
|---|---|---|
| At least 1 allowed action | 89.1 | 96.9 |
| At least 2 allowed actions | 82.8 | 90.6 |
| Threshold | No defense | DataFilter | Full firewall |
|---|---|---|---|
| Rec. | 70.3 | 96.9 | 43.8 |
| Rec. | 62.5 | 93.8 | 40.6 |
| Average Rec. (%) | 62.5 | 93.8 | 53.1 |
| Matcher | No defense PD | StateFence PD | Gap |
|---|---|---|---|
| Exact match | 18.8 | 1.6 | 17.2 |
| Normalized label match | 17.2 | 1.6 | 15.6 |
| Semantic bucket match | 18.8 | 0.0 | 18.8 |
| Model | Defense | TS (%) | AS (%) | Rec. (%) |
|---|---|---|---|---|
| Claude | No defense | 98.44 | 1.56 | 99.00 |
| Full firewall | 57.81 | 42.19 | 75.00 | |
| StateFence (IOC-preserving) | 98.44 | 1.56 | 98.44 | |
| Gemini | No defense | 60.94 | 39.06 | 62.00 |
| Full firewall | 40.62 | 59.38 | 52.00 | |
| StateFence (IOC-preserving) | 90.63 | 9.38 | 93.75 |
| Slice | Metric | Comparison | (%) | 95% CI | |
|---|---|---|---|---|---|
| Triage / Claude | AS | None SG | 39.06 | [23.44, 54.69] | |
| Triage / Gemini | PD | None SG | 15.63 | [6.25, 26.56] | 0.006 |
| Response / Claude | AS | None FW | 12.50 | [4.69, 20.31] | 0.008 |
| IOC / Qwen | AS | None FW | -51.56 | [-64.06, -39.06] |
| Task | Raw TS | Matched TS | |
|---|---|---|---|
| Triage | 4 | 75.00% | 100.00% |
| Summary | 4 | 100.00% | 100.00% |
| Response | 4 | 100.00% | 100.00% |
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 530 papers