Abstract:As large language model (LLM)-driven agents evolve from text generation systems into compound systems capable of perceiving context, invoking tools, and executing terminal actions, their security risks are expanding from the content generation layer to the execution chain. This paper focuses on terminal-execution agents represented by OpenClaw and conducts execution-trajectory-based security evaluation and risk attribution across three typical security scenarios: prompt injection, malicious code execution, and privacy data leakage. The evaluation dataset covers 11 risk types. Based on seven mainstream foundation models with task planning and tool execution capabilities, the experiment constructs corresponding agents and obtains 70,616 valid execution trajectories, among which 7,396 are classified as unsafe at the trajectory level, yielding an overall unsafe rate of 10.47%. The results show significant differences in safety performance among agents built on different foundation models, with privacy data leakage tasks exhibiting a higher average risk. Unsafe samples mainly manifest as unconfirmed or over-authorized actions; their risk sources are dominated by malicious user instructions and jailbreak attacks, while the consequences are concentrated in security and system-integrity compromises, as well as privacy and confidentiality breaches. These findings indicate that agent security should move beyond isolated input-output screening toward execution-chain-level governance, establishing observable, assessable, and attributable protection mechanisms across key stages such as context organization, permission confirmation, tool invocation, and result disclosure.