๐ค AI Summary
This work addresses a novel multi-step Trojan attack against local agents, termed ClawTrojan, wherein adversaries achieve persistent control by injecting malicious instructions across sessions and in stages through files or tool outputsโevading current defenses. The study formalizes this attack paradigm for the first time, establishes a ClawTrojan benchmark, and demonstrates its effectiveness with a 95.5% success rate in a GPT-5.4 simulated environment. To counter this threat, the authors propose DASGuard, the first dynamic defense framework that integrates controlled-text recognition, provenance tracing, runtime interception, and workspace sanitization to precisely block untrusted-source instructions at execution time. DASGuard significantly outperforms existing approaches that rely solely on single-turn detection mechanisms.
๐ Abstract
LLM agents are evolving from conversational chatbots to operational tools in real-world workspaces. In local agentic harnesses, an LLM can read and write files, call tools, and reuse workspace state across sessions. While such capabilities enhance utility, they also expose a new attack surface for attackers. Attackers can embed a prompt injection within a file or tool output. Agents may read this hidden instruction, store it, and execute it later. In this multi-step trojan attack paradigm, no individual step appears malicious on its own, but these steps can collectively turn untrusted text into persistent control content. However, existing defenses often inspect each step in isolation. As a result, they can block a clear harmful action, but fail to detect the earlier write operation that plants the backdoor. To reveal this threat, we introduce ClawTrojan, a benchmark designed to identify multi-step trojan attacks in local agentic harnesses. In an OpenClaw-style simulated workspace with GPT-5.4, ClawTrojan reaches a 95.5% attack success rate (ASR), while existing single-turn prompt-injection attacks produce near-zero ASR on the same model. To address this threat, we propose DASGuard, which scans control-like text in sensitive local files, traces its origin, and removes control content that does not originate from a trusted source. Our results show that DASGuard achieves strong dynamic defense by combining runtime attack blocking with sanitized commits to the workspace.