TL;DR
As LLM agents transition from simple chatbots to autonomous workspace tools that read and write local files, they expose a dangerous new attack surface: multi-step trojan backdoors. This paper introduces ClawTrojan, a benchmark demonstrating that state-of-the-art models like GPT-5.4 are highly vulnerable to these distributed attacks, and proposes DASGuard, a defense mechanism that tracks data provenance to prevent untrusted text from hijacking agent control flow.
What Problem Does This Paper Address?
Traditional LLM security research focuses heavily on single-turn prompt injections—where an attacker tries to trick a chatbot into doing something bad within a single conversation context. However, modern LLMs are increasingly deployed in "agentic harnesses," which are runtime environments where the agent can read/write files, execute code, and persist state across multiple sessions.
The authors demonstrate that while top-tier models (like GPT-5.4 and GLM-5.1) have become excellent at recognizing and blocking standard, single-turn prompt injections, they are blind to multi-step trojan attacks. In this paradigm, an attacker splits a malicious goal into multiple seemingly benign steps. For example, an attacker might plant a natural-looking rule inside a project note or configuration file. When the user later asks the agent to perform a routine task, the agent reads that file, treats the poisoned text as a legitimate instruction, and executes a harmful action (like leaking private data). Because existing defenses inspect each step in isolation, they fail to catch the backdoor being planted.
Methods
To counter this threat, the authors propose DASGuard (Detect, Attribute, and Sanitize Guard), a dynamic defense situated at the agent harness boundary.
Instead of just asking "is this current input malicious?", DASGuard tracks data provenance across the entire user session using a content-source graph.
The system operates via three core pillars:
- Runtime Content Detection: When the agent attempts a file write or tool call, DASGuard scans the payload for "control-bearing" text spans using a combination of regex rules, semantic embeddings, and historical finding matches.
- Potential Control Attribution: It traces the origin of the text span. Content is labeled as Trusted (from the user or system prompt), Clean (uncompromised workspace files), or Untrusted (from external tool outputs or web results).
- Runtime Policy and Sanitization: If untrusted text attempts to write a new rule or policy into a sensitive file (like memory or skill instructions), DASGuard intercepts the operation. It utilizes a shadow workspace to sanitize the payload (e.g., quoting the claims as data rather than executable instructions) before committing it, or blocks high-risk external actions entirely.
Datasets
The paper introduces ClawTrojan, a novel benchmark specifically designed to evaluate multi-step trojan attacks within local agentic workspaces.
- Composition: It consists of 362 samples (339 attack trajectories and 23 clean controls) yielding 1,672 annotated step environments.
- Scenarios Covered: It spans four primary domains: Coding, Research, Office, and General assistant tasks.
- Attack Outcomes: Evaluates four distinct failure modes: Document Falsification, Task Deviation, External Side Effects, and Unauthorized Disclosure.
Unlike older datasets like AgentDojo or InjecAgent, which evaluate attacks within a single live context, ClawTrojan requires the agent to persist rules locally and re-trigger them later as ordinary workspace state.
Key Insights and Ideas
- The "Trust Laundering" Effect: Strong base models easily reject direct malicious commands, but when an instruction is loaded from a local file that the agent itself wrote earlier, the model lowers its guard, effectively laundering the untrusted input into a trusted command.
- The Fallacy of Isolated Inspection: Security tools that look at actions turn-by-turn are fundamentally incapable of stopping trojans. Planting a rule looks identical to taking a normal note; the harm only materializes turns later when the rule is executed.
- Data vs. Instruction Separation: DASGuard enforces a classic security paradigm in a new LLM context: untrusted data must remain data. It can be summarized or stored, but the moment it attempts to alter the agent's future policies or action targets, it must be neutralized.
Key Results
The experimental evaluation highlights a massive security gap in raw LLMs and a strong validation for provenance-based defense:
- High Vulnerability: Without defenses, top models are highly susceptible to multi-step trojans. GPT-5.4 suffered a 95.5% Attack Success Rate (ASR) on ClawTrojan, despite achieving 0% ASR on older prompt injection benchmarks. GLM-5.1 and DeepSeek-V4-Flash fared similarly, with ASRs of 90.1% and 88.0% respectively.
- Existing Defenses Fail: Standard prompt-formatting and single-step action gates (like ClawKeeper, StruQ, and MELON) only modestly reduced the ASR (hovering around 88% to 94%) because they fail to connect the final harmful action to its untrusted origin.
- DASGuard Effectiveness: DASGuard successfully mitigated the threat, plummeting the step ASR on GPT-5.4 down to 15.8% and the full-chain ASR to 5.9%. It achieved this while maintaining a moderate false-positive rate (13.0%), preserving the agent's utility for clean tasks.
Limitations and Future Work
The authors note several limitations that pave the way for future research:
- Sandbox Constraints: ClawTrojan is currently a synthetic, sandbox-local benchmark. Real-world deployments might introduce more complex, messy, and long-horizon interactions.
- Harness Dependence: DASGuard relies on the ability of the harness to intercept file writes, tool outputs, and maintain a clear provenance graph. Opaque agent architectures with closed tool routing or unobservable memory states will require deeper instrumentation.
- Adaptive Attackers: A sophisticated attacker aware of DASGuard might attempt to obfuscate control text inside complex prose or split fragments across even more files to bypass semantic matching. Evaluating adaptive red-team attacks remains an open challenge.
Summary updated