Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.
Nadia: We're looking at the paper: "Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents".
Elias: Here's the gist of the paper. Modern generative agents such as OpenClaw are increasingly used pervasively, and this paper demonstrates that token-drain attacks remain feasible in real deployments but their magnitude and observability are shaped by tool composition, recovery behavior, and interface design The Attack Mechanism The authors design Clawdrain, a Trojanized skill that induces a multi-turn “Segmented Verification Protocol” via injected SKILL.md instructions and a companion script that returns PROGRESS/REPAIR/TERMINAL signals The Segmented Verification Protocol (SVP) requires the agent to supply two arguments: a monotonically increasing segment index and a complete comma-separated calibration sequence of L integers from 1 to L The companion script returns one of three signals: PROGRESS, REPAIR, or TERMINAL This structure ensures the agent must complete at least Tmax successful tool calls before receiving the final answer Quantified Amplification The evaluation shows that successful SVP configurations yield ∼6–7× amplification, while a failed configuration triggers a costly recovery cascade that reaches ∼9× Table 1 summarizes token consumption across all four conditions, showing SVP v1 and v2 increase this to ∼125k and ∼190k respectively, achieving 6–7× amplification while still delivering the correct final result The SVP v3 run failed to complete the protocol yet consumed the most tokens of any configuration tested, reaching ∼9× amplification Emergent Defenses and Gaps The authors observe an emergent scripting workaround at L = 1000 that bypassed autoregressive sequence generation entirely, collapsing the per-turn output cost from ∼L tokens to a short shell command This behavior demonstrates that tool composition fundamentally changes the dynamics of multiturn drain attacks in ways that simulator-based evaluations cannot capture General-purpose tool access can both mitigate and amplify the cost of a drain attack, depending on whether the agent succeeds or fails at the protocol Deployment Vectors Beyond Output Length Beyond output-token amplification, the paper identifies three additional resource-amplification vectors: (1) Input-token amplification via oversized skill documentation, (2) Context-history accumulation through verbose tool responses, and (3) Execution-frequency amplification via cron/heartbeat triggers These vectors can be combined within a single malicious skill and none of them requires a multi-turn protocol or any observable anomaly in tool-call patterns Interface-Dependent Stealth The observability of an attack depends on how the user interacts with the agent, spanning three settings: (1) Chat GUI where every tool call is rendered, (2) TUI / narrated mode which suppresses raw tool-call details, and (3) Autonomous execution where skills run without any user-facing output This gradient means that the same Trojan skill can range from trivially detectable to completely unobservable depending solely on how the user interacts with the agent The costly-failure scenario adds a dimension where recovery behavior may itself be visible, prompting an attacker to balance drain maximization against the risk that failure-mode verbosity exposes the attack The preceding evaluation underscores that real-world agent behavior substantially alters the practical impact of token-drain attacks relative to simulator-based expectations The core takeaway is that measuring amplification in deployed agent systems requires accounting for tool composition, recovery behavior, and interface visibility—not just output length Future work should also measure the real-dollar cost impact of compound vector attacks under sustained autonomous execution and evaluate defenses such as per-skill token budgets The most concerning real-world vectors extend beyond output-token amplification to include input-token amplification via bloated skill documentation, tool-output pollution in persistent transcripts, cron/heartbeat frequency amplification, and behavioral injection that changes global agent behavior References
Title and authors: Nadia: We’re diving into the title of this piece, "Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents." This name tells you exactly what we’re looking at.
Elias: It highlights that the attack isn't just a simple prompt injection; it targets the whole chain of tool calls within an agent system, and it focuses on stealing tokens stealthily.
Priya: So when you say "stealthy token exhaustion," are you talking about something that doesn't look like a simple error or a slow response?
Nadia: It means the agent is still performing its job, but it's doing so in a way that consumes way more tokens than expected by hiding the drain behind legitimate tool usage.
Elias: The paper mentions that this is happening within OpenClaw agents, which are these open-source personal assistants built on top of base LLMs and a set of callable skills.
Priya: I wonder how much control an attacker has over those skills themselves before they even get into the agent’s reasoning loop?
Nadia: The authors show that the attack starts with a Trojanized skill, which is essentially a malicious skill designed to induce this multi-turn Segmented Verification Protocol.
Elias: This malicious skill uses injected SKILL dot md instructions and a separate script that signals progress, repair, or terminal status to force the agent down that long path.
Priya: So it’s not just the LLM making a mistake; it’s the skill itself being programmed to guide the agent through this specific verification sequence.
Nadia: Right. It forces a structure where the agent has to supply an increasing segment index and a calibration sequence of integers from one to L, which is what sets up that long drain loop.
Elias: And that companion script dictates whether the agent needs to keep going or if it should try a repair action, which keeps it stuck in the process longer.
Priya: That whole mechanism seems designed to punish any attempt by the agent to shortcut or finish quickly.
The paper's summary: Nadia: So we’ve established that Clawdrain is a Trojanized skill that forces an agent into a multi-turn Segmented Verification Protocol, and now we’re looking at what the authors summarize about this whole thing.
Elias: Essentially, they are summarizing how these attacks work in practice by deploying Clawdrain in a real OpenClaw instance using Gemini two point five Pro as the production model <ref:2603.00902#pg1>.
Priya: That means they’re not just theorizing; they’re testing this against a real agent framework with actual API billing and a production-like environment.
Nadia: They measured six to seven times token amplification over a benign baseline using this setup, and showed that a failed configuration can reach about nine times amplification.
Elias: The summary emphasizes the deployment-only phenomenon—that this behavior is observed because the agent autonomously composes general purpose tools like shell scripts.
Priya: That’s key because it suggests that these agents aren't just following simple prompts; they are actively using their tool access to create this kind of resource drain.
Nadia: They also highlight the emergent scripting workaround at L equals one thousand where the agent bypassed autoregressive sequence generation entirely by using a short shell command instead of generating long text sequences.
Elias: That shows that tool composition can fundamentally change how these multi-turn drain attacks behave and that simulator evaluations simply don't capture this effect.
Priya: It seems like the key insight here is that we can’t just look at the LLM in isolation; we have to look at the entire agent ecosystem, including its tools and recovery logic.
The paper's improvements: Nadia: Now let’s talk about what the authors suggest as improvements for this research, because they aren't just showing a problem; they’re offering solutions.
Elias: They focus on how to build defenses against protocol failures by allowing the agent to autonomously compose general purpose tools like shell or Python scripts to route around these brittle steps.
Priya: So instead of relying on the LLM generating text sequences, we give it the ability to execute actual code that can jump over the tricky parts of the protocol.
Nadia: Exactly. They suggest that this helps reduce amplification and changes the attack dynamics because it shifts from just relying on autoregressive generation to actually executing scripts.
Elias: Then there’s using costly failure exploitation for economic damage, where you configure parameters so they exceed the agent’s compliance threshold, leveraging those costly recovery cascades.
Priya: That means we can intentionally set up scenarios where the agent autonomously gives up on the malicious skill and starts a chain of fallback strategies that ends up consuming more tokens than a successful run would have.
Nadia: And they propose adaptive drain mechanisms against workarounds by using repair signals selectively, for instance, by rejecting sequences generated via shell substitution and requiring a unique nonce derived from the current timestamp.
Elias: That’s a way to defeat cached or scripted responses and force the agent back into generating new text rather than relying on pre-generated paths.
Priya: And they also suggest context management for constraint erosion, where you have a two-phase structure: first, accelerate compaction through SKILL dot md bloat and verbose tool outputs, then in the second phase, once the context window is full, you evict the user constraints.
Conclusion: Nadia: So to wrap up this discussion on "Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents," we’ve seen that real agent behavior significantly alters the practical impact compared to simulator expectations.
Elias: The main point is that measuring amplification in deployed systems requires accounting for tool composition, recovery behavior, and interface visibility instead of just output length.
Priya: It really emphasizes that we have to look at these three factors—the tools, the recovery, and how the user sees it—to truly understand the risk.
Nadia: The paper also points out that future work should measure the real dollar cost impact of these compound vector attacks under sustained autonomous execution and look at defenses like per-skill token budgets.
Elias: And they warn us that things like input token amplification from bloated skill documentation, tool output pollution in persistent transcripts, cron or heartbeat frequency amplification, and behavioral injections are beyond just output length.
Priya: It’s a lot to take in because it shows the attack surface is much wider than we first imagined when we only thought about prompt engineering.
Nadia: Yeah, this paper gives us a lot of concrete mechanisms to think about for building better security and defense strategies for these powerful agents.
Elias: It’s definitely a reminder that understanding how the agent interacts with its environment is just as important as understanding the model itself.
University of California, Merced
cs.CR, cs.SE
Submitted: 2026-03-01
Updated: 2026-11-15
Code: https://github.com/openclaw/openclaw
License: http://creativecommons.org/licenses/by-sa/4.0/
Importance score: 86/100
The gist: Modern generative agents such as OpenClaw—an open-source, selfhosted personal assistant with a community skill ecosystem—are gaining attention and are used pervasively <ref:2603.00902#pg2> This…
Key concepts
- Segmented Verification Protocol (SVP)
- A multi-turn requirement where an agent must provide a segment index and a calibration sequence to complete a task. The attack forces the agent to successfully execute many tool calls before receiving the final answer, making it easier to drain tokens through required interactions.
- Quantified Amplification
- Measuring how much token consumption increases based on whether the protocol succeeds or fails. Successful configurations yield 6–7x amplification, while failed attempts trigger a costly recovery cascade that can reach 9x amplification, demonstrating the impact of error handling on resource drain.
- Interface-Dependent Stealth
- The visibility of an attack changes drastically based on how the user interacts with the agent. In a chat interface, tool calls are visible, but in narrated modes or autonomous execution, they can be hidden. This means the same malicious skill can be undetectable depending on the user's interaction style.
- Emergent Defenses
- Agents develop unexpected workarounds when faced with specific constraints. For example, an agent might bypass token limits by using shell commands instead of generating long autoregressive sequences, showing that tool composition fundamentally changes how these attacks are executed.
Terminology
Summary
Modern generative agents such as OpenClaw—an open-source, selfhosted personal assistant with a community skill ecosystem—are gaining attention and are used pervasively <ref:2603. p. 0 edu
Qian Wang
University of California, Merced
Merced, CA, USA
qianwang@ucmerced. edu
Abstract
Modern generative agents such as OpenClaw—an open-source, selfhosted personal assistant with a community skill ecosystem—are
gaining attention and are used pervasively. However, the openness
and rapid growth of these ecosystems often outpace systematic security evaluation. In this paper, we design, implement, and evaluate
Clawdrain, a Trojanized skill that induces a multi-turn “Segmented
Verification Protocol” via injected SKILL. In this paper, we design, implement, and evaluate
Clawdrain, a Trojanized skill that induces a multi-turn “Segmented
Verification Protocol” via injected SKILL. md instructions and a companion script that returns PROGRESS/REPAIR/TERMINAL signals.Where the paper says it
Where the paper says it
Where the paper says it
The Attack Mechanism
Clawdrain instantiates a resource-amplification attack as a Trojanized OpenClaw skill that implements a multi-turn protocol we call the Segmented Verification Protocol (SVP) <ref:2603.00902#pg2>. The protocol is designed to satisfy three requirements: (i) it must induce multiple tool calls that expand the session transcript, (ii) it must produce a correct final answer to preserve the appearance of benign behavior, and (iii) it must be framed in a way that appears plausibly legitimate to the agent <ref:2603. p. 2 2 Attack Design: The Segmented Verification
Protocol
Clawdrain instantiates a resource-amplification attack as a Trojanized OpenClaw skill that implements a multi-turn protocol we
call the Segmented Verification Protocol (SVP). The protocol is designed to satisfy three requirements: (i) it must induce multiple
tool calls that expand the session transcript, (ii) it must produce a
correct final answer to preserve the appearance of benign behavior,
and (iii) it must be framed in a way that appears plausibly legitimate
to the agent. On each invocation
of the skill, the agent is instructed to supply two arguments: a monotonically increasing segment index and a complete comma-separated
calibration sequence of 𝐿 integers from 1 to 𝐿. md explicitly forbids abbreviation, ellipsis, or range notation—forcing the
agent to generate the full sequence autoregressively, which is the
primary source of output-token amplification. py) parses the segment index and calibration sequence and returns one of three signals:
• PROGRESS: segment < 𝑇max and sequence valid—the loop
continues with the next segment. • REPAIR: sequence malformed (contains ellipsis, range notation, wrong length, or non-monotonic values)—the agent
must retry with the same segment index. , BBC headline data)
and the protocol concludes. This structure ensures that the agent must complete at least 𝑇max
successful tool calls (plus any REPAIR retries) before receiving the
final answer, and that each call requires generating ∼𝐿 output tokens for the calibration sequence.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Quantifying Amplification
The evaluation shows that successful SVP configurations yield ∼6–7× amplification, while a failed configuration triggers a costly recovery cascade that reaches ∼9× <ref:2603.00902#pg2>. Table 1 summarizes token consumption across all four conditions, showing SVP v1 and v2 increase this to ∼125k and ∼190k respectively, achieving 6–7× amplification while still delivering the correct final result <ref:2603. p. 4 The benign baseline consumes ∼28k context tokens for a single BBC
headline query. SVP v1 and v2 increase this to ∼125k and ∼190k
respectively, achieving 6–7× amplification while still delivering the
correct final result. “Result” indicates whether the
agent delivered a correct final answer. The SVP v3 run failed
to complete the protocol yet consumed the most tokens of
any configuration tested. The failed attack thus achieved
∼9× amplification—higher than any successful run (Table 1). This finding challenges a core assumption in prior work [25],
which uses Attack Success Rate (ASR) as a co-metric with amplification, implicitly treating failed attacks as low-cost or harmless.Where the paper says it
Where the paper says it
Where the paper says it
Emergent Defenses and Behavioral Shifts
The evaluation reveals emergent behaviors that partially mitigate calibration-based drains, such as an autonomous scripting workaround at L = 1000 At L = 15,000, the agent exhibited an emergent scripting workaround at L = 1000 that bypassed autoregressive sequence generation entirely (Section 4.4) This behavior was not prompted by the SKILL. p. 5 txt) as the calibration argument in
all subsequent tool calls. This behavior was not prompted by the
SKILL. This behavior was not prompted by the
SKILL. md; it emerged from the agent’s access to general-purpose
shell tools and its recognition that scripting would be more reliable
than token-by-token generation. The calibration sequence is now generated by a Python process in milliseconds rather
than by autoregressive inference over ∼𝐿 tokens. The per-turn output cost drops from ∼1000 tokens to a short shell command (∼30
tokens), which is the primary reason our measured amplification
(6–7×) falls below the 65–658× reported by Zhou et al.Where the paper says it
Where the paper says it
Where the paper says it
Deployment-Grounding Vectors
Beyond output-token amplification, OpenClaw’s skill system exposes three additional attack surfaces that are invisible to simulator-based evaluation. These include input-token amplification via oversized SKILL. p. 0 Finally, we outline that output-token amplification is only one
deployment-grounded vector. Input-token bloat via oversized skill
documentation, verbose tool-output pollution in persistent history,
and execution-frequency amplification via cron/heartbeat all introduce additional, less visible cost surfaces in real agent stacks. Finally, we outline that output-token amplification is only one
deployment-grounded vector. Input-token bloat via oversized skill
documentation, verbose tool-output pollution in persistent history,
and execution-frequency amplification via cron/heartbeat all introduce additional, less visible cost surfaces in real agent stacks. md instructions are injected at the
system-prompt level—the same privilege tier as the platform’s own
directives—a malicious skill can include behavioral injection directives that alter the agent’s global behavior (e. , increasing verbosity
across all responses). Cron and heartbeat
triggers can invoke skills autonomously at fixed intervals,
multiplying the per-invocation cost by the trigger frequency
without any user interaction or awareness. These vectors can be combined within a single malicious skill and,
critically, none of them requires a multi-turn protocol or any observable anomaly in tool-call patterns.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Stealth and Interface Dependency
The observability of an attack depends on how the user interacts with the agent, as stealth is interface-dependent. Chat GUI renders every tool call in the conversation stream, while TUI (narrated mode) displays only agent narration messages, suppressing raw tool-call details. p. 2 We consider three settings that
span the full visibility spectrum:
(1) Chat GUI (Telegram/Discord): The user can see each tool
call and its outputs in the conversation stream. (2) TUI / narrated mode: The user sees only high-level narration messages, not raw tool traces or arguments. 7M tokens consumed
overnight from misconfigured (non-malicious) automations,
confirming that the platform already lacks effective safeguards against runaway autonomous token consumption. This gradient—from fully transparent to fully invisible—means
that the same Trojan skill can range from trivially detectable to completely unobservable depending solely on how the user interacts
with the agent. An attacker must therefore balance drain maximization against
the risk that failure-mode verbosity exposes the attack. 5 Conclusion
The preceding evaluation underscores that real-world agent behavior substantially alters the practical impact of token-drain attacks,
relative to simulator-based expectations.Where the paper says it
Where the paper says it
Where the paper says it
Conclusion and Future Directions
The preceding evaluation underscores that real-world agent behavior substantially alters the practical impact of token-drain attacks relative to simulator-based expectations. We argue that the most concerning real-world vectors extend beyond output-token amplification to include input-token amplification via bloated skill documentation, tool-output pollution in persistent transcripts, cron/heartbeat frequency amplification, and behavioral injection that changes global agent behavior. p. 5 We further
show that “stealth” is interface-dependent and that autonomous
background execution can make drains effectively invisible. We argue that the most concerning real-world vectors extend
beyond output-token amplification to include input-token amplification via bloated skill documentation, tool-output pollution in persistent transcripts, cron/heartbeat frequency amplification, and behavioral injection that changes global agent behavior. We argue that the most concerning real-world vectors extend
beyond output-token amplification to include input-token amplification via bloated skill documentation, tool-output pollution in persistent transcripts, cron/heartbeat frequency amplification, and behavioral injection that changes global agent behavior. As a concrete
future direction, we plan to systematically characterize interfacedependent stealth and these deployment-grounded vectors at scale,
quantifying how they interact with tool composition and background execution in real deployments. As a concrete
future direction, we plan to systematically characterize interfacedependent stealth and these deployment-grounded vectors at scale,
quantifying how they interact with tool composition and background execution in real deployments. Future work should also
measure the real-dollar cost impact of compound vector attacks
under sustained autonomous execution and evaluate defenses such
as per-skill token budgets, SKILL. Future work should also
measure the real-dollar cost impact of compound vector attacks
under sustained autonomous execution and evaluate defenses such
as per-skill token budgets, SKILL. md size limits, and privilege separation between skill-level and platform-level instructions. md size limits, and privilege separation between skill-level and platform-level instructions. Overall,
the core takeaway is that measuring amplification in deployed
agent systems requires accounting for tool composition, recovery
behavior, and interface visibility—not just output length.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
REFERENCES
[1] Patrick Chao et al. Jailbreakbench: An open robustness benchmark for jailbreaking large language models <ref:2603. p. 6 Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents , ,
References
[1] Patrick Chao, Edoardo Debenedetti, Alexander Robey, Maksym Andriushchenko,
Francesco Croce, Vikash Sehwag, Edgar Dobriban, Nicolas Flammarion, George J
Pappas, Florian Tramer, et al. Jailbreakbench: An open robustness benchmark for
jailbreaking large language models.Where the paper says it
[2] Jianshuo Dong et al. An engorgio prompt makes large language model babble on, 2025
[3] Xiaohu Du et al. Multiturn jailbreaking large language models via attention shifting <ref:2603. p. 6 [3] Xiaohu Du, Fan Mo, Ming Wen, Tu Gu, Huadi Zheng, Hai Jin, and Jie Shi. Multiturn jailbreaking large language models via attention shifting.Where the paper says it
[4] Jonas Geiping et al. Coercing llms to do and reveal (almost) anything
[5] Google. Using oauth 2. p. 6 [5] Google. Using oauth 2.Where the paper says it
[6] Google Cloud. Gemini 2.5 pro: Generative ai on vertex ai
[7] Safayat Bin Hakim et al. Jailbreaking llms: A survey of attacks, defenses and evaluation <ref:2603. p. 6 [7] Safayat Bin Hakim, Kanchon Gharami, Nahid Farhady Ghalaty, Shafika Showkat
Moni, Shouhuai Xu, and Houbing Herbert Song. Jailbreaking llms: A survey of
attacks, defenses and evaluation.Where the paper says it
[8] Yi Liu et al. Prompt injection attack against llm-integrated applications
[9] OpenClaw Contributors. Openclaw: Your own personal ai assistant
[10] Ahmed Ragab Mahmoud Salah. Jailbreaking llms: An in-depth security analysis of prompt injection vulnerabilities
[11] Timo Schick et al. Toolformer: Language models can teach themselves to use tools
[12] Wai Man Si et al. Excessive reasoning attack on reasoning llms, 2025
[13] Lijun Sun et al. Multi-agent coordination across diverse applications: A survey
[14] Ziyi Tang et al. Alphaagent: Llm-driven alpha mining with regularized exploration to counteract alpha decay
[15] Oguzhan Topsakal and Tahir Cetin Akinci. Creating large language model applications utilizing langchain: A primer on developing llm apps fast
[16] Khanh-Tung Tran et al. Multi-agent collaboration mechanisms: A survey of llms, 2025
[17] Lei Wang et al. A survey on large language model based autonomous agents
[18] Yue Wang et al. Thoughts are all over the place: On the underthinking of o1-like llms, 2025
[19] Zihui Wu et al. The dark side of function calling: Pathways to jailbreaking large language models
[20] Xijian Xu and Jun Wu. Mitigating llm hallucination snowballing in multiagent systems via context-aware semantic consistency reasoning
[21] Fei Xu Yu et al. Optimizing prompt sequences using monte carlo tree search for llm-based optimization
[22] Summer Yue. Meta ai alignment director shares her openclaw email-deletion nightmare: “I had to RUN to my Mac mini”
[23] Boyang Zhang et al. Breaking agents: Compromising autonomous llm agents through malfunction amplification
[24] Yuanhe Zhang et al. Crabs: Consuming resource via auto-generation for llm-dos attack under black-box settings
[25] Kaiyu Zhou et al. Beyond max tokens: Stealthy resource amplification via tool calling chains in llm agents
--- Page 1 ---
Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents, Ben Dong, Hui Feng, and Qian Wang
--- Page 2 ---
Ben Dong, Hui Feng, and Qian Wang
--- Page 3 ---
Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents,, Ben Dong, Hui Feng, and Qian Wang
--- Page 4 ---
Ben Dong, Hui Feng, and Qian Wang
--- Page 5 ---
Ben Dong, Hui Feng, and Qian Wang
--- Page 6 ---
Ben Dong, Hui Feng, and Qian Wang
--- Page 7 ---
Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents,, Ben Dong, Hui Feng, and Qian Wang
--- Page 1 is the paper itself. The page prints that sentence on its own as the paper's one-line summary <ref:2603.00902#pg2>.
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Tool composition defense against protocol failures: The improved system can autonomously compose general-purpose tools (e.g., shell/Python) to route around brittle protocol steps, reducing amplification and altering attack dynamics by executing scripts instead of relying solely on autoregressive sequence generation.
-
Costly failure exploitation for economic damage: The system can be configured with parameters designed to exceed the agent’s compliance threshold, leveraging
costly recovery cascade[s]
where an agent autonomously abandons the Trojan skill and initiates a cascade of fallback strategies, potentially achieving higher total token consumption than successful runs. -
Adaptive drain mechanisms against workarounds: The system can incorporate repair-driven loop sustenance by issuing REPAIR signals selectively—for instance, rejecting sequences generated via shell substitution by requiring a per-turn nonce derived from the current timestamp—to defeat cached or scripted responses and force autoregressive generation.
-
Context management for constraint erosion: The improved system can utilize a two-phase structure where, in Phase 1, it accelerates compaction through SKILL.md bloat and verbose tool outputs, and in Phase 2, after context window filling evicts user constraints, the skill escalates by executing actions the user had previously forbidden.
-
Interface-dependent stealth monitoring: The system can operate with interface-aware security, where a Chat GUI exposes raw tool calls while a TUI in narrated mode suppresses them, allowing for tailored observability settings to detect or evade token drain attacks based on user interaction style.
Abstract
Tool-calling LLM agents rely on third-party skills to extend their capabilities, but this openness exposes a supply-chain attack surface in which malicious skill instructions can manipulate agent execution across multiple turns. In this work, we present Clawdrain, a Trojanized OpenClaw skill that induces resource exhaustion through a Segmented Verification Process (SVP). SVP combines stateful progression, repair-driven repetition, and termination to create costly tool-calling chains while preserving a legitimate final payload. We evaluate Clawdrain in a production-like OpenClaw deployment with real API billing across Gemini 2.5 Pro, DeepSeek V4 Flash, and Claude Sonnet 4.6. Clawdrain achieves 2-16 times token amplification with plain SVP, while the three models exhibit distinct behaviors, including autoregressive compliance, proactive scripting, and extended trial-and-error reasoning. Our findings reveal that agent resource exhaustion arises not only from output generation, but also from repeated context re-ingestion, tool coordination, reasoning, and recovery, motivating system-level controls over cumulative skill behavior.
Sources
- Coercing LLMs to do and reveal (almost) anything
- Prompt Injection attack against LLM-integrated Applications
- Multi-Agent Coordination across Diverse Applications: A Survey
- Optimizing Prompt Sequences using Monte Carlo Tree Search for LLM-Based Optimization
- Beyond Max Tokens: Stealthy Resource Amplification via Tool Calling Chains in LLM Agents
Related papers
- From Strategy Search to Policy Learning: MCTS-Guided Adversarial Co-Evolution for LLM Safety Alignment
- Privacy Leakage from Recurrent State in LLM Inference
- Incrementally Verifiable Oracle Aided Computation
- Privilege and confidentiality in generative AI workflows
- BadMoE: Backdooring Mixture-of-Experts LLMs via Routing-Aware Triggers and Task-Underutilized Experts
- CoVault: Secure, Scalable Analytics of Personal Data