Large language model based agents increasingly rely on external tools to invoke services and interact with web resources. These tools can evolve through software updates, yet agentic frameworks may continue trusting them without re-verifying their safety after implementation changes. This tool update gap creates a supply-chain vulnerability in agentic systems: because updated tool code executes outside the LLM's context window, malicious functionality embedded in tool updates can bypass defenses centered on model-visible interactions, leaving agents exposed to stealthy, persistent threats that existing in-context defenses can hardly address. To thoroughly investigate this threat, we introduce ETUDE (Exploiting Tool Updates for Direct Execution), an attack that embeds malicious functionality into updates of initially benign tools to produce compromised tools, while preserving their legitimate tool functionality. Unlike prompt-based attacks, ETUDE operates entirely outside the LLM's context and requires no adversarial instructions, thereby bypassing defenses restricted to model-visible content. We evaluate ETUDE across three representative attack workloads and seven widely used commercial and open-source agentic frameworks, including Gemini CLI, Codex CLI, and Claude Code. The results show that ETUDE achieves a 97.6% ASR while maintaining a 95.9% legitimate task completion rate. We further examine existing defenses and find that they provide insufficient protection against this threat. These findings expose a fundamental blind spot in current agent security practices: trust established for a tool does not necessarily remain valid after its implementation updates.
Figures & tables
Figure 1. The tool update gap. A malicious update preserves the tool’s legitimate functionality while introducing unauthorized operations that execute directly within the tool’s runtime environment.
P-direct
P-ctx
executed by tool code
induced via model context
E1
Malicious implementation
Poisoned tools or skills
at admission
present at admission ( Hu et al., 2026 )
before adoption ( Wang et al., 2025a ; Qu et al., 2026 )
E2
ETUDE (this work)
Rug-pull updates to
via adopted update
update-time direct execution
descriptions or outputs ( Beurer-Kellner and Fischer, 2025 )
Table 1. Attack taxonomy along two dimensions: delivery timing (E1: admission; E2: subsequent update) and execution path (P-direct: code-level execution; P-ctx: model-context execution). ETUDE targets E2 × P-direct.
Framework
Developer
Public release
Source
Evaluated version
Gemini CLI
Google
2025
Open
0.62.0
Codex CLI
OpenAI
2025
Open
0.159.3
Claude Code
Anthropic
2025
Closed
2.1.284
DeepSeek Harness
DeepSeek
2026
Open
0.2.0-rc.2
OpenCode
Anomaly
2025
Open
1.18.34
Pi
Mario Zechner / Earendil Works
2025
Open
0.86.1
Table 2. Overview of the seven evaluated agent frameworks.
Figure 2. ASR and final-output TCR across seven frameworks. Each marker averages the three five-round workload means.
Condition
File change (%)
Specified content (%)
ETUDE
100.0
100.0
P-ctx × E2
42.4
14.4
Table 3. W3 research-note modification and specified-content attainment (%). Only the latter counts toward ASR.
Figure 3. Backend and tool sensitivity. (a) ETUDE ASR with W1/Markdown fixed. (b) W3 actual file modification and final-output TCR, averaged across four frameworks per tool. A seven-by-four heatmap displays backend ASR, and adjacent grouped horizontal bars display ASR and TCR for three tool utilities averaged across their evaluated contexts.
Figure 4. Target blocking and legitimate-update rejection as TLSH thresholds vary. Controlled strata and public history use separate denominators. Step curves show target blocking and false-positive rates for small, functional, and public-history updates against TLSH threshold.
Form
Route
DSR (%)
ASR (%)
TCR (%)
Compl. B
Original
ETUDE
98.3 ± 3.7
0.0
0.0
0/1200
Protected
ETUDE
6.7 ± 7.0
85.0 ± 10.9
84.3 ± 10.8
1020/1200
Original
P-direct × E1
93.3 ± 7.0
0.0
0.0
0/1200
Protected
P-direct × E1
0.0
96.7 ± 4.6
96.2 ± 4.5
1160/1200
Table 4. Static review and native execution for readable and PyArmor-protected code.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5. One normal call and an additional W2 order (protected code, OpenCode/GLM). The handler is schematic; both outcomes come from one saved audit. A normal Markdown-cleaning call returns the complete text while host and service records confirm an additional order created by the tool. The schematic shows the code added in the update; the actual runtime audit reports an alert.
W1
W2
W3
Framework
Condition
ASR
TCR
ASR
TCR
File change
Specified goal
TCR
Gemini CLI
ETUDE
100.0 ± 0.0
98.0 ± 4.5
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
98.0 ± 4.5
P-direct × E1
0.0
0.0
0.0
0.0
0.0
0.0
0.0
P-ctx × E1
0.0
0.0
0.0
0.0
20.0 ± 44.7
0.0
20.0 ± 44.7
P-ctx × E2
26.0 ± 37.1
100.0 ± 0.0
0.0
100.0 ± 0.0
19.0 ± 42.5
0.0
100.0 ± 0.0
Codex CLI
ETUDE
100.0 ± 0.0
98.0 ± 4.5
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
Appendix
Table 5. Framework results (%) with GLM-5.3-Flash and the Markdown cleaner. TCR uses the complete core body in all workloads; W3 separates actual file change from specified-goal attainment. Entries are five-round mean ± sample SD.
Framework
W1
W2
W3 †
ETUDE
P-direct × E1
P-ctx × E1
P-ctx × E2
ETUDE
P-direct × E1
P-ctx × E1
P-ctx × E2
ETUDE
P-direct × E1
P-ctx × E1
P-ctx × E2
Gemini CLI
98.0 ± 4.5
0.0 ± 0.0
0.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
0.0 ± 0.0
0.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
0.0 ± 0.0
0.0 ± 0.0
98.0 ± 4.5
Codex CLI
95.0 ± 5.0
0.0 ± 0.0
0.0 ± 0.0
99.0 ± 2.2
100.0 ± 0.0
0.0 ± 0.0
0.0 ± 0.0
80.0 ± 44.7
100.0 ± 0.0
0.0 ± 0.0
0.0 ± 0.0
100.0 ± 0.0
Claude Code
99.0 ± 2.2
0.0 ± 0.0
0.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
0.0 ± 0.0
20.0 ± 44.7
99.0 ± 2.2
98.0 ± 2.7
0.0 ± 0.0
0.0 ± 0.0
100.0 ± 0.0
OpenCode
100.0 ± 0.0
0.0 ± 0.0
0.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
0.0 ± 0.0
40.0 ± 54.8
100.0 ± 0.0
99.0 ± 2.2
0.0 ± 0.0
0.0 ± 0.0
100.0 ± 0.0
DeepSeek Harness
100.0 ± 0.0
0.0 ± 0.0
0.0 ± 0.0
100.0 ± 0.0
99.0 ± 2.2
0.0 ± 0.0
0.0 ± 0.0
99.0 ± 2.2
99.0 ± 2.2
0.0 ± 0.0
0.0 ± 0.0
93.0 ± 15.7
Appendix
Table 6. Full-task TCR (%), requiring correct input, prescribed tool use, tool output, and final delivery. W3 † uses a separate content-restricted condition.
W1
W2
W3
Framework
Tool
ASR
TCR
ASR
TCR
ASR
Core TCR
Codex CLI
Markdown cleaner
100.0 ± 0.0
95.0 ± 5.0
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
CSV statistics
80.0 ± 44.7
80.0 ± 44.7
79.0 ± 44.2
79.0 ± 44.2
68.0 ± 46.0
68.0 ± 46.0
ICS generator
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
99.0 ± 2.2
100.0 ± 0.0
100.0 ± 0.0
Claude Code
Markdown cleaner
99.0 ± 2.2
99.0 ± 2.2
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
100.0 ± 0.0
CSV statistics
100.0 ± 0.0
100.0 ± 0.0
60.0 ± 54.8
60.0 ± 54.8
99.0 ± 2.2
99.0 ± 2.2
Appendix
Table 7. ETUDE across tools and W1–W3 in four frameworks (GLM-5.3-Flash). Values are five-round ASR/TCR mean ± sample SD (%).
Condition
GLM-5.3- Flash
Qwen-3.8
DS-V4 OFF
DS-V4 ON
Framework: Gemini CLI
ETUDE
100.0 / 98.0
100.0 / 96.0
100.0 / 90.0
100.0 / 98.0
P-ctx × E2
26.0 / 100.0
21.0 / 100.0
0.0 / 99.0
0.0 / 100.0
Framework: Codex CLI
ETUDE
100.0 / 95.0
100.0 / 91.0
100.0 / 100.0
94.0 / 93.0
P-ctx × E2
40.0 / 99.0
0.0 / 100.0
0.0 / 100.0
0.0 / 100.0
Appendix
Table 8. Backend comparison for W1 with the Markdown cleaner. Each pair lists ASR and full-task TCR (%), respectively; both are five-round means.
Project
Actual/planned
t=30
t=145
t=233
AWS MCP
8/10
3/8
1/8
1/8
GitHub MCP Server
10/10
0/10
0/10
0/10
Appendix
Table 9. TLSH blocking of sampled historical updates, by project. Threshold columns show blocked/scorable pairs.
Scanner
Code
Target ( n=3 )
Legitimate ( n=20 )
SkillFortify
Readable
100.0%
100.0%
SkillFortify
Protected
0.0%
0.0%
SkillSpector
Readable
0.0%
0.0%
SkillSpector
Protected
100.0%
100.0%
Appendix
Table 10. Package rejection by two additional static scanners.
Source view
Form
BLOCK
UNK.
ALLOW
BLOCK (%)
Full
Raw
14
1
0
93.3 ± 14.9
Full
Protected
0
1
14
0.0 ± 0.0
2,000 chars
Raw
0
0
15
0.0 ± 0.0
2,000 chars
Protected
4
2
9
26.7 ± 36.5
Appendix
Table 11. Component diagnoses from full and 2,000-character source views, not admission decisions. Counts use 15 reviews per row; BLOCK rates report five-round mean ± sample SD (%).
Code form
Static
Audit allow
Audit effect
Replay effect
Raw
BLOCK
5/5
0/5
5/5
Protected
ALLOW
5/5
0/5
5/5
Appendix
Table 12. Separate outcomes from static review, runtime auditing, and ordinary replay of each frozen package. Each form has one static judgment and five runs per execution context.
Tool-using LLM agents increasingly rely on external tools to make consequential decisions, yet most existing agent-security benchmarks and defenses implicitly assume that tool feedback is trustworthy once a tool has been selected. We study a different failure mode, cognitive poisoning, in which a malicious tool behaves plausibly during exploration, accumulates trust through benign-looking feedback, and becomes harmful only when hidden state conditions align with the final executable action. To study this setting, we construct TRUST-Bench, a task-conditioned benchmark of 1,970 hidden-trigger tool-compromise episodes with matched safe controls, introduce an asymmetric penalty metric, GuardedJoint, to better reflect real deployment risk, and present VISTA-Guard, a backbone-agnostic framework for final-action risk scoring. The core idea is to abstract multi-step tool interaction into structured environment variables that encode trust-formation dynamics and then score the risk of the final executable action from this trajectory-conditioned representation. Experiments show that prompt-centric heuristics, scalarized features, and zero-shot judges fail in this regime, whereas trajectory-aware final-action scoring yields strong in-domain discrimination and remains effective under balanced out-of-distribution transfer. Under GuardedJoint, VISTA-Guard reaches 84.2 in-domain and 56.9 on balanced out-of-distribution evaluation, while methods that optimize only one side of the safety--utility tradeoff collapse to zero. These findings support a broader view of agent security in black-box tool ecosystems: the decisive defense target is not local prompt text or tool descriptors alone, but the way trust is formed across the interaction trajectory and committed through the final action.
Lecheng Yan, Ruizhe Li, Xicheng Han +5
Southern University of Science and Technology · University of Science and Technology of China · Zhejiang University +2
Tool-augmented Large Language Model (LLM) agents have demonstrated impressive capabilities in automating complex, multi-step real-world tasks, yet remain vulnerable to indirect prompt injection. Adversaries exploit this weakness by embedding malicious instructions within tool-returned content, which agents directly incorporate into their conversation history as trusted observations. To address these vulnerabilities, we introduce ClawGuard, a novel runtime security framework that enforces a user-confirmed rule set at every tool-call boundary, transforming unreliable alignment-dependent defense into a deterministic, auditable mechanism that intercepts adversarial tool calls before any real-world effect is produced. By automatically deriving task-specific access constraints from the user's stated objective prior to any external tool invocation, ClawGuard blocks all three injection pathways without model modification or infrastructure change. Experiments across five state-of-the-art language models on six injection benchmarks covering web, local, MCP, and skill channels, as well as three utility benchmarks covering OS, web, and code tasks, demonstrate that ClawGuard achieves robust protection against indirect prompt injection without compromising agent utility or introducing significant token overhead. This work establishes deterministic tool-call boundary enforcement as an effective defense mechanism for secure agentic AI systems. Code is publicly available at github.com/Claw-Guard/ClawGuard/.
AI agents are autonomous systems that combine LLMs with external tools to solve complex tasks. While such tools extend capability, improper tool permissions introduce security risks such as indirect prompt injection and tool misuse. We characterize these failures as unbalanced tool-driven agency. Agents may retain unnecessary permissions (excessive agency) or fail to invoke required tools (insufficient agency), amplifying the attack surface and reducing performance. We introduce AgenTRIM, a framework for detecting and mitigating tool-driven agency risks without altering an agent's internal reasoning. AgenTRIM addresses these risks through complementary offline and online phases. Offline, AgenTRIM reconstructs and verifies the agent's tool interface from code and execution traces. At runtime, it enforces per-step least-privilege tool access through adaptive filtering and status-aware validation of tool calls. Evaluating on the AgentDojo benchmark, AgenTRIM substantially reduces attack success while maintaining high task performance. Additional experiments show robustness to description-based attacks and effective enforcement of explicit safety policies. Together, these results show that AgenTRIM provides a practical, capability-preserving approach to safer tool use in LLM-based agents.
Roy Betser, Amit Giloni, Shamik Bose +4
Fujitsu Research of Europe (FRE) · Fujitsu Research of India Pvt. Ltd. (FRIPL)