TL;DR
StateFence is a task-aware defense framework designed to protect blue-team LLM agents from "evidence-chain contamination"—a sophisticated form of indirect prompt injection. By routing untrusted security evidence through task-specific guards, it prevents attackers from manipulating critical security decisions (like incident severity) while ensuring vital forensic data (like Indicators of Compromise) isn't accidentally deleted by over-eager filters.
What Problem Does This Paper Address?
Large Language Model (LLM) agents are increasingly integrated into Security Operations Centers (SOCs) to automate tasks like triaging alerts, summarizing incidents, and extracting Indicators of Compromise (IOCs). However, these agents are vulnerable to indirect prompt injection. An attacker can embed malicious instructions within telemetry logs, support tickets, or even memory summaries.
The authors identify a specific failure mode called evidence-chain contamination. Because SOC workflows are multi-step, a poisoned piece of evidence can propagate through the chain, corrupting intermediate "task states." For example, a malicious string in a log might trick an agent into downgrading a "Critical" alert to "Low," causing a real breach to be ignored.
The core challenge is that defense is task-dependent. A suspicious-looking PowerShell command is a threat to a summarization task (where it might be executed or misinterpreted as a command), but it is essential evidence for an IOC extraction task. Generic "one-size-fits-all" filters often fail by either letting attacks through or destroying the very data the agent needs to find.
Methods
The authors propose StateFence, which moves away from simple text filtering toward protecting the protected task state.
Key components include:
- Task-Aware Routing: StateFence identifies the specific task (Triage, Summary, Response, or IOC Extraction) and routes evidence through a corresponding defense mechanism.
- Severity Guard (for Triage): A deterministic post-processor that checks evidence for high-risk patterns (like token abuse or finance-host compromise). If these patterns are present, it "locks" the severity to Critical or High, overriding any LLM attempts to downgrade the label due to injected instructions.
- Full Firewall (for Summarization/Response): A "sanitize-and-structure" route that scans for instruction-like fragments, decodes suspicious base64 segments, and removes matched control text before the LLM sees it.
- IOC-Preserving Filter (for Extraction): Instead of deleting suspicious strings, this route normalizes them (e.g., converting
hxxptohttp) and presents them to the model as explicit candidates for extraction, ensuring the "evidence" isn't lost during sanitization. - Propagation Traces: The system records metadata about the evidence source, trust tier, and which protected state was affected, allowing for auditable security traces.
Datasets
The researchers evaluated StateFence using two main suites:
- Controlled Formal Benchmark: A newly developed set covering four SOC tasks and four attack families (explicit, stealth, multi-hop, and persistent). It uses 64 attacked cases per task-model condition, adapted from existing benchmarks like AgentHarm and ASB to reflect SOC-specific scenarios.
- Public SOC Validation Set: Uses real-world telemetry-style evidence from sources including Wazuh documentation, CSLE, Precinct6 logs, and a subset of Splunk BOTS.
Key Insights and Ideas
- State vs. String: The paper argues that we shouldn't just protect the output string, but the intermediate state that drives decisions. If the "Severity State" is corrupted, the entire downstream response fails.
- The Filtering Paradox: The authors prove that "Universal Filtering" is a trap. In their tests, broad firewalls intended to stop injections actually caused IOC extraction recall to plummet (from ~99% down to ~53% in some cases) because the filter couldn't distinguish between a malicious command and a malicious URL that needed to be reported.
- Multi-Hop Vulnerability: Attacks don't have to be a single "ignore all previous instructions" block. "Multi-hop" attacks distribute adversarial cues across multiple logs or tickets, which appear benign in isolation but combine to corrupt the agent's logic.
Key Results
StateFence was tested across several top-tier models (Claude 3.5, Gemini 1.5 Flash, Grok, Qwen, and GPT-5.4).
- Robustness: On public SOC evidence, StateFence achieved 91.41% task success with only 8.59% attack success.
- Utility Preservation: Unlike generic filters, StateFence maintained high IOC recall (~94-98%).
- Triage Protection: In the most difficult triage cases, StateFence reduced "Paired Degradation" (failures specifically caused by poisoning) from 25% down to less than 5% for the most fragile models.
Limitations and Future Work
- Manual Policy Definition: Currently, the "task contracts" and specific lexical predicates (the rules for the guards) are manually defined. The authors suggest that future work could involve automatic state-discovery or policy-induction algorithms.
- Structured Dependency: StateFence works best in instrumented environments with structured outputs and observable traces. Adapting it to "chatty," less structured deployments might require significant integration effort.
- Fixed Benchmarks: While the results are strong, the authors acknowledge that absolute performance numbers might shift when applied to different task distributions or novel operational data sources.
Summary updated