Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents
summary
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…
In short
Researchers designed a Trojanized skill called Clawdrain to exploit modern AI agents like OpenClaw by forcing them into a multi-turn verification protocol. This attack can amplify token consumption significantly, reaching 6–9 times more than expected. The study shows that the impact of this drain is heavily influenced by how the agent uses tools, its recovery methods, and how it is being monitored.
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 used across episodes
This episode discusses
- Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents · Paper Radio
- 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 · Paper Radio
- Beyond Max Tokens: Stealthy Resource Amplification via Tool Calling Chains in LLM Agents
The paper
Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents · Read on arXiv
University of California, Merced
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.
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.
More episodes
- 2608.27496-ROPE: Routed Origin Policy Enforcement against Indirect Prompt Injection
- Daily Summary for 2026-11-19
- 2607.07085-Is Randomness Necessary for Adaptive Data Analysis?
- The day in conversation for 2026-11-19
- Daily Summary for 2026-11-19
- 2609.10601-Threshold Choice, Not Sample Size, Bounds Trustless Verification of Nondeterministic Compound AI Workflows
- 2610.38786-Adversarial Process Disturbances at a Deployable Alarm Budget: Detector Evaluation on a Simulator and a Real Plant
- 2511.08660-Binary and Multiclass Cyberattack Classification on GeNIS Dataset
- 2604.27302-Static Attribution of Android Residential Proxy Malware Using Graph Kernels
- Daily Summary for 2026-11-18