资料档案
文献来源与参考链接
当前保存的来源版本 · v1
- 作者
- Dong, Ben、Guo, Zhonghao、Li, Tianyi、Wang, Qian
- 文献与标准标识
- arxiv:2603.00902
- 来源版本
- v2
- 来源更新时间
- 2026-10-31T02:58:08+00:00
- 日期依据
- 来源明确给出发表日期
- 采集来源格式
- a_622f2d2c978f798f_html
- 结构化格式
- source_html
原始标题与分类记录
Clawdrain: Resource Exhaustion Attacks in OpenClaw Agent Ecosystems
- 研究方向
- 攻击方法、防御技术、评测治理
- 影响维度
- 完整性、可用性、安全与合规
- 风险类型
- 提示注入、供应链风险
- 相关技术
- LLM、Agent、工具调用
当前为离线关键词规则模式。
分类规则与原始字段
攻击方法 · attack
capabilities, but this openness exposes a supply-chain attack surface in
which malicious skill instructions can manipulate agent execution across
multiple turns.
防御技术 · defense
to characterize how model capability shapes
the attack–defense dynamics.
4.1. Experimental Setup
We evaluate against a local OpenClaw deployment with the standard
评测治理 · evaluation
ficient as a measure of stealth. A deployment-grounded evaluation must distinguish resource consumption, process completion, answer correctness, recovery behavior, a
提示注入 · prompt injection
undary. (Deng et al., 2026) Prior research on indirect prompt injection shows that untrusted external content can redirect agent decisions and actions (Greshake et al., 20
供应链风险 · dependency
rd-party skills with a single command.
(2)
Compromised dependency. An attacker injects malicious behavior by compromising a skill’s external package or data source.
完整性 · injection
(Deng et al., 2026) Prior research on indirect prompt injection shows that untrusted external content can redirect agent decisions and actions (Greshake et al., 20
可用性 · dos attack
Crabs: consuming resource via auto-generation for llm-dos attack under black-box settings.
In Findings of the Association for Computational Linguistics: ACL 2025,
p
安全与合规 · safety
we report; we disable autonomous triggers for billing safety and
treat (iii) as a deployment risk rather than an activated vector.
4. Multi-Model Evaluation
We
LLM · llm
Merced, California, USA
© none
Abstract.
Tool-calling LLM agents rely on third-party skills to extend their
capabilities, but this openness exposes a supply-
Agent · agent
Clawdrain: Resource Exhaustion Attacks in OpenClaw Agent Ecosystems
Clawdrain: Resource Exhaustion Attacks in
OpenClaw Agent Ecosystems
Conference: ; ;
Ben
工具调用 · tool calling
Beyond max tokens: stealthy resource amplification via tool calling chains in llm agents.
arXiv preprint arXiv:2601.10955.
Note: https://arxiv.org/abs/2601.10955
Cited
{
"ai_relevance": {
"evidence": [
{
"end_offset": 519,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 516
},
{
"end_offset": 1682,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 1679
},
{
"end_offset": 6170,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 6167
},
{
"end_offset": 7502,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 7499
},
{
"end_offset": 7531,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 7528
},
{
"end_offset": 12639,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 12636
},
{
"end_offset": 21169,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 21166
},
{
"end_offset": 35501,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 35498
},
{
"end_offset": 37085,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 37082
},
{
"end_offset": 37560,
"location": "title_and_content",
"quote": "large language model",
"rule": "ai_term",
"start_offset": 37540
},
{
"end_offset": 37888,
"location": "title_and_content",
"quote": "large language models",
"rule": "ai_term",
"start_offset": 37867
},
{
"end_offset": 38406,
"location": "title_and_content",
"quote": "llms",
"rule": "ai_term",
"start_offset": 38402
},
{
"end_offset": 38998,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 38995
},
{
"end_offset": 39232,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 39229
},
{
"end_offset": 40001,
"location": "title_and_content",
"quote": "llms",
"rule": "ai_term",
"start_offset": 39997
},
{
"end_offset": 40439,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 40436
},
{
"end_offset": 40820,
"location": "title_and_content",
"quote": "llms",
"rule": "ai_term",
"start_offset": 40816
},
{
"end_offset": 41037,
"location": "title_and_content",
"quote": "llms",
"rule": "ai_term",
"start_offset": 41033
},
{
"end_offset": 41288,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 41285
},
{
"end_offset": 41532,
"location": "title_and_content",
"quote": "large language model",
"rule": "ai_term",
"start_offset": 41512
},
{
"end_offset": 42059,
"location": "title_and_content",
"quote": "large language model",
"rule": "ai_term",
"start_offset": 42039
},
{
"end_offset": 42407,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 42404
},
{
"end_offset": 42751,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 42748
},
{
"end_offset": 43111,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 43108
},
{
"end_offset": 6634,
"location": "title_and_content",
"quote": "prompt injection",
"rule": "ai_attack",
"start_offset": 6618
}
],
"matches": [
{
"end_offset": 519,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 516
},
{
"end_offset": 1682,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 1679
},
{
"end_offset": 6170,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 6167
},
{
"end_offset": 7502,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 7499
},
{
"end_offset": 7531,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 7528
},
{
"end_offset": 12639,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 12636
},
{
"end_offset": 21169,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 21166
},
{
"end_offset": 35501,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 35498
},
{
"end_offset": 37085,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 37082
},
{
"end_offset": 37560,
"location": "title_and_content",
"quote": "large language model",
"rule": "ai_term",
"start_offset": 37540
},
{
"end_offset": 37888,
"location": "title_and_content",
"quote": "large language models",
"rule": "ai_term",
"start_offset": 37867
},
{
"end_offset": 38406,
"location": "title_and_content",
"quote": "llms",
"rule": "ai_term",
"start_offset": 38402
},
{
"end_offset": 38998,
"location": "title_and_content",
"quote": "LLM",
"rule": "ai_term",
"start_offset": 38995
},
{
"end_offset": 39232,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 39229
},
{
"end_offset": 40001,
"location": "title_and_content",
"quote": "llms",
"rule": "ai_term",
"start_offset": 39997
},
{
"end_offset": 40439,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 40436
},
{
"end_offset": 40820,
"location": "title_and_content",
"quote": "llms",
"rule": "ai_term",
"start_offset": 40816
},
{
"end_offset": 41037,
"location": "title_and_content",
"quote": "llms",
"rule": "ai_term",
"start_offset": 41033
},
{
"end_offset": 41288,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 41285
},
{
"end_offset": 41532,
"location": "title_and_content",
"quote": "large language model",
"rule": "ai_term",
"start_offset": 41512
},
{
"end_offset": 42059,
"location": "title_and_content",
"quote": "large language model",
"rule": "ai_term",
"start_offset": 42039
},
{
"end_offset": 42407,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 42404
},
{
"end_offset": 42751,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 42748
},
{
"end_offset": 43111,
"location": "title_and_content",
"quote": "llm",
"rule": "ai_term",
"start_offset": 43108
},
{
"end_offset": 6634,
"location": "title_and_content",
"quote": "prompt injection",
"rule": "ai_attack",
"start_offset": 6618
}
],
"method": "explainable_keyword_rules",
"reason": "Matched AI topic or component evidence",
"relevant": true
},
"entity_ids": [],
"facts": [],
"method": "source_grounded_extraction",
"unknown_fields": [
"affected_products",
"affected_versions",
"fixed_versions",
"cvss",
"mitigations",
"references",
"papers",
"poc"
]
}
原始采集文本
Clawdrain: Resource Exhaustion Attacks in
OpenClaw Agent Ecosystems
Conference: ; ;
Ben Dong
Affiliation: University of California, Merced, Merced, California, USA
,
Zhonghao Guo
Affiliation: University of California, Merced, Merced, California, USA
,
Tianyi Lu
Affiliation: Stevens Institute of Technology, Hoboken, New Jersey, USA
and
Qian Wang
Affiliation: University of California, Merced, Merced, California, USA
© none
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 22–16×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.
1. Introduction
Tool-calling LLM agents extend foundation models through third-party skills that support specialized tasks and autonomous workflows (Tang et al., 2025; Tran et al., 2025; Sun et al., 2025). These agents interpret skill documentation as instructions and incorporate tool responses into an evolving context that may be repeatedly re-ingested across model turns. Consequently, an untrusted skill publisher can manipulate agent outputs, control flow, and victim-funded computation, creating a software supply-chain risk for agent ecosystems. These behaviors expose the third-party skill layer as a distinct resource-security boundary: a multi-stage workflow can inflate victim-funded computation even when the agent ultimately returns a correct, normal result.
Prior work shows that malicious tools can induce costly multi-turn tool-calling chains (Zhou et al., 2026). However, these findings are based on constrained simulators that may not accurately capture persistent context growth, tool composition, or autonomous recovery in deployed agents. In practice, these omitted behaviors can sharply increase victim-borne cost and latency even when little output is visible. The resulting resource drain may exhaust usage quotas before the task finishes, disrupting subsequent normal workloads.
In this paper, we study a deployable third-party skill within a complete agent runtime, where tool composition, persistent context, recovery behavior, and background execution introduce costs beyond output generation. We investigate these deployment-specific risks through Clawdrain, a Trojanized OpenClaw skill that implements a Segmented Verification Process (SVP). SVP disguises resource amplification as a legitimate verification workflow, requiring multiple validation stages and retries before releasing a harmless payload. Our primary adversary is an untrusted third-party skill publisher, while the victim controls the model account and bears the resulting resource consumption. Clawdrain therefore enables economic denial-of-service through victim-funded usage, including excessive token consumption, quota depletion, increased latency, and disruption of harmless workloads.
We evaluate Clawdrain in controlled OpenClaw deployments across multiple model backends. The attack produces qualitatively different execution paths: some agents initially follow the injected process directly, others construct scripts to reduce explicit sequence generation, and others incur substantial trial-and-error reasoning and recovery overhead. Across the evaluated backends, Clawdrain induces 22–16×16\times amplification over baselines.
We also examine how deployment interfaces affect attack observability. Raw tool arguments may be visible in graphical interfaces, hidden behind progress narration in terminal interfaces, or absent from immediate user view during autonomous execution. Final-answer correctness is therefore insufficient as a measure of stealth. A deployment-grounded evaluation must distinguish resource consumption, process completion, answer correctness, recovery behavior, and technical observability.
Contributions
This paper makes three principal contributions:
•
We identify security flaws in third-party agent skills and design SVP, a stateful skill-layer attack. We further introduce SVP+N to prevent exact static replay and evaluate its limitations against adaptive parsing and scripting.
•
We conduct a repeated, deployment-grounded evaluation across three
production model backends. Relative to backend-specific Base references,
plain SVP produces 2.74×2.74\times–16.40×16.40\times median cumulative input
amplification. We analyze both successful and failed executions, revealing costly failures and agent adaptations that mitigate resource drain but do not eliminate the attack.
•
We characterize interface-dependent stealth by separating resource
amplification, task completion, answer correctness, and operational
observability. Our analysis captures excess model calls, tool calls,
repairs, and latency across interface settings, showing why output tokens
and attack success alone do not determine whether resource exhaustion
remains hidden from users.
2. Background and Related Work
2.1. OpenClaw and Tool-Calling Skills
Early work on tool-augmented language models established that models can interleave reasoning with external actions and learn when to invoke APIs (Yao et al., 2022; Schick et al., 2023). Subsequent surveys identified tool use as a core capability of autonomous LLM agents (Wang et al., 2024). OpenClaw extends this paradigm through installable skills that encode task-specific procedures in SKILL.md files (OpenClaw Contributors, 2026). This skill abstraction places natural-language instructions between the model and the executable tool interface. The distribution of skills through local and community sources makes skill provenance an important trust boundary. (Deng et al., 2026) Prior research on indirect prompt injection shows that untrusted external content can redirect agent decisions and actions (Greshake et al., 2023; Zhan et al., 2024). Security analyses of MCP ecosystems further identify tool descriptions and tool responses as channels for influencing model behavior (Hou et al., 2026; Li and Gao, 2026). Existing defenses enforce instruction boundaries or validate individual tool invocations (Chen et al., 2024; Wallace et al., 2024; Wang et al., 2025; Mou et al., 2026). Recent work also demonstrates that malicious tools can amplify resource consumption through multi-turn tool-calling chains (Zhou et al., 2026; Dong et al., 2026). However, prior work provides limited deployment-level analysis of how third-party OpenClaw skills coordinate persistent instructions, companion tools, and accumulated context across an execution trajectory.
2.2. Resource Amplification in LLM Agents
Early research on LLM resource exhaustion treated a single model invocation as the primary attack surface. Engorgio optimizes adversarial prompts to suppress early termination and induce abnormally long outputs (Dong et al., 2025). CRABS extends inference-cost attacks to black-box settings through automatically generated prompts that increase latency and hardware utilization (Zhang et al., 2025b). OverThink shifts the attack target from visible output to hidden reasoning by injecting computationally expensive decoy problems into retrieved content (Kumar et al., 2025). Excessive Reasoning Attack similarly exploits test-time reasoning to increase model computation (Si et al., 2025). These model-level attacks do not capture costs accumulated through repeated interactions between an agent and its tools. Breaking Agents shows that adversarial inputs can induce agents to perform repetitive or irrelevant actions (Zhang et al., 2025a). AgentDoS identifies resource-lifecycle vulnerabilities that allow agent operations to exhaust system resources (Luo et al., 2026). Beyond Max Tokens demonstrates that malicious MCP-compatible tool messages can sustain costly multi-turn tool-calling chains while preserving a correct final response (Zhou et al., 2026). Preliminary work on Clawdrain applies resource amplification to an OpenClaw skill-based setting (Dong et al., 2026). However, existing studies provide limited deployment-level evidence about resource attacks delivered through persistent third-party skill instructions. The effects of autonomous tool composition and recovery behavior on cumulative resource consumption also remain underexplored. Existing evaluations rarely separate resource consumption from task completion, answer correctness, and interface-level observability.
Figure 1. Threat model overview. Left: under no attack, the agent calls a normal skill and answers concisely. Middle: an untrusted publisher distributes a third-party skill whose documentation and companion code can influence model instructions, tool use, and persistent context after ordinary installation. Right: when the agent selects Clawdrain, the skill can induce a multi-turn calibration and repair process. We measure resource amplification, task completion, final-answer correctness, and user-visible observability as separate outcomes.
3. The Clawdrain Attack
Figure 2. Overview of the tool-calling agent architecture. The identity layer injects SKILLS.md and constraints into the model prompt, while the orchestration layer manages agent reasoning and task execution. The MCP layer connects the agent to external tools, APIs, databases, and file systems (Hou et al., 2026).
3.1. Threat Model
Figure 1 summarizes the threat model and illustrates how
Clawdrain converts a normal skill invocation into a multi-turn calibration and repair loop. We assume an adversary can introduce a Trojanized skill before or during an OpenClaw session. The attacker needs only to control the skill content or dependencies, without compromising the model provider or altering the final answer. Possible delivery channels include:
(1)
Public registry. An attacker publishes a malicious skill to ClawHub, where users can install third-party skills with a single command.
(2)
Compromised dependency. An attacker injects malicious behavior by compromising a skill’s external package or data source.
(3)
Local access. An attacker places a malicious skill directly in the agent’s local skills directory.
(4)
Agent self-generation. Prompt injection induces the agent to create and install a malicious skill.
Adversary goals. The adversary aims to increase
operational cost and degrade system throughput by inducing excess
token consumption, while preserving plausible harmless behavior and
producing correct final answers for the user’s task. We additionally
consider a secondary goal of stealth: the attack should not
be easily detectable by the user during normal operation.
Visibility settings. The observability of an attack
depends on how the user interacts with the agent. We consider three interfaces that provide different levels of attack visibility: 1) chat GUIs expose tool calls and outputs, 2) narrated TUIs show only high-level summaries, and 3) autonomous execution runs scheduled skills without user-visible output.
Agent capabilities. We assume the agent has access to general-purpose tools (e.g., a shell or Python interpreter) commonly present in OpenClaw deployments and may autonomously compose them while following a skill’s process. This assumption is critical because tool composition fundamentally changes multi-turn drain attacks in ways that simulator-based evaluations cannot capture.
3.2. Attack Design: The Segmented Verification Process
Clawdrain instantiates a resource-amplification attack as a
Trojanized OpenClaw skill that implements a multi-turn program we
call the Segmented Verification Process (SVP).
SVP Structure
The SVP is built upon the tool-calling agent architecture shown in
Figure 2, where injected instructions propagate through the
identity layer and are incorporated into the prompt context of the LLM.
On the back end, the agent runtime interacts with the Model Context
Protocol (MCP) layer to access external resources, including servers,
APIs, databases, and file systems.
The SVP consists of a client-side component (instructions embedded
in the skill’s SKILL.md) and a server-side component (a
companion validation script), illustrated as Figure 3. 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 LL integers from 1 to LL. The
SKILL.md prohibits abbreviations, ellipses, and range
notation, prompting the agent to generate the complete sequence and
amplify output tokens. The companion script parses the segment index
and calibration sequence and returns one of three signals:
•
PROGRESS: segment <Tmax<T_{\max} and sequence
valid, so 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.
•
TERMINAL: segment =Tmax=T_{\max} and sequence
valid, so the script returns the correct payload
(e.g., BBC headline data) and the process concludes.
Figure 3. Companion-script enforcement of the SKILL.md process.
The malicious skill documentation instructs the agent to provide a
segment identifier and full calibration sequence without abbreviation.
The agent forwards these fields through a tool call to the companion
script, which validates segment order, sequence length, malformed
buffers, and the terminal condition. Valid intermediate segments return
PROGRESS, malformed inputs return REPAIR, and the final
valid segment returns TERMINAL with the correct payload.
This structure ensures that the agent must complete at least
TmaxT_{\max} successful tool calls, plus any REPAIR retries, before
receiving the final answer. Each call requires the agent to provide a full
calibration sequence of length LL, creating a theoretical per-query output
cost of Ω(L×Tmax)\Omega(L\times T_{\max}), plus the input-token overhead of the
growing session history.
Plausibility Framing.
A key design consideration is that the SVP must not appear obviously
malicious to the agent. We thus frame the SVP as a “ provider
freshness verification” requirement: the calibration sequence is
presented as a cryptographic handshake that the data provider requires
before releasing any user queried data. Because many real-world APIs
genuinely require multi-step authentication or verification handshakes,
a compliant agent has no structural signal by which to reject the
process as illegitimate.
The SKILL.md also includes narration directives that instruct
the agent to display user-friendly progress messages (e.g., “Thinking……”) rather than raw tool-call details. This
is designed to exploit the TUI’s narrated-mode rendering, where only
these summary messages are shown to the user.
Design Principles and Parameterization
SVP is designed as a parameterized attack primitive rather than a
model-specific prompt template as MCTS (Zhou et al., 2026). Its design
combines three intrinsic properties. First, stateful progression
distributes the attack across multiple tool calls, causing intermediate
instructions, arguments, and responses to accumulate in the session
history. Second, validated expansion requires each stage to carry
a complete calibration sequence, while the companion script rejects
abbreviated or malformed inputs through the REPAIR state. Third,
plausibility-preserving termination releases the correct payload
only after the required stages are completed, allowing the attack to
preserve the appearance of a legitimate verification workflow.
The attack intensity is controlled by two parameters. The sequence
length LL determines the workload introduced by each tool call, whereas
the stage limit TmaxT_{\max} determines the minimum interaction depth
before the payload is released. Their separation allows SVP to
independently control per-stage expansion and multi-turn context
accumulation. In addition, instruction specificity determines how
strongly the skill constrains agent behavior. Minimal instructions leave
the workflow partially discoverable through tool responses, while
explicit instructions directly specify sequence construction, retry
behavior, narration, and termination requirements.
We instantiate this SVP at three operating points:
•
SVP v1 (L=50L{=}50, Tmax=2T_{\max}{=}2) uses minimal
instructions and leaves LL undisclosed in SKILL.md.
The agent obtains the sequence requirement from the first
PROGRESS response, representing a lightweight and
less prescriptive instance of SVP.
•
SVP v2 (L=1000L{=}1000, Tmax=3T_{\max}{=}3) explicitly
specifies the sequence length, prohibits abbreviated
representations, and incorporates plausibility and narration
directives, strengthening behavioral constraint while
increasing both per-stage expansion and context accumulation.
•
SVP v3 (L=2000L{=}2000, Tmax=5T_{\max}{=}5) retains the
explicit structure of SVP v2 but increases both workload
magnitude and interaction depth, representing an aggressive
operating point intended to intensify resource consumption.
Beyond Static Reuse: Per-Stage Nonces (SVP+N)
The default SVP calibration sequence is deterministic: for a given LL,
the correct sequence is always 1,2,…,L1,2,\ldots,L. This forces
autoregressive generation when the agent lacks alternative computation
methods, but it creates a fundamental weakness once the agent has
general-purpose tools. Any deterministic sequence the companion script
can validate, the agent can also compute programmatically, e.g., via
seq -s, 1 1000 or range(1, 1001). It can also be replayed across stages, reducing the intended per-stage workload. The drain
remains effective against models that generate autoregressively, but it
is not robust to more capable agents that
make such scripting routine.
SVP+N forecloses static reuse with a per-stage nonce. At each stage, one
position of the sequence must be overwritten with a stage-specific
checkpoint value: the first checkpoint is supplied with the request, and
each PROGRESS response reveals the checkpoint required for the
next stage. The companion relay validates both the full sequence and the
current checkpoint before returning PROGRESS, so an agent cannot
advance by resubmitting a cached sequence. Each invocation must therefore
incorporate fresh relay state and reconstruct the sequence, restoring the
intended workload even when the agent scripts generation. SVP+N raises
the bar rather than closing it: a sufficiently capable agent could still
parse the nonce from the relay response and patch its generation script,
so we treat SVP+N as one rung of an escalating design space and quantify
its effect in Section 4.3.
3.3. The Production Attack Surface
Prior resource-amplification studies drive a synthetic tool loop from
an isolated SKILL.md prompt (Zhou et al., 2026) and cannot
observe the resource dynamics of a real agent runtime. Our evaluation
extends beyond this setting. Each trial executes inside a complete
OpenClaw deployment—the production system prompt, workspace files,
installed skill catalog, tool schemas, persistent session context, and
the companion relay script—driven by the model’s own tool-composition
and recovery behavior. Every run targets a commercially available model
through its production interface (Claude Sonnet 4.6 and DeepSeek V4 Flash
via API, Gemini 2.5 Pro via the Gemini CLI), so the reported costs are
those a real user would be billed. The measured overhead therefore reflects repeated processing of the agent environment, including token consumption and total execution cost.
As Figure 2 illustrates, this setting exposes three surfaces
invisible to simulation: (i) every enabled skill’s SKILL.md is
injected into the system prompt on every call, inflating input
tokens whether or not the skill is invoked; (ii) relay inputs and outputs
persist in session history and are re-ingested each turn, producing
superlinear context growth; and (iii) cron or heartbeat triggers can
invoke skills autonomously, multiplying per-invocation cost. None of these
requires a multi-turn process or an observable tool-call anomaly.
Surfaces (i) and (ii) are already reflected in the cumulative input-token
counts we report; we disable autonomous triggers for billing safety and
treat (iii) as a deployment risk rather than an activated vector.
4. Multi-Model Evaluation
We evaluate Clawdrain against three production LLM backends, Gemini 2.5 Pro, Claude Sonnet 4.6, and DeepSeek V4 Flash, to assess both the magnitude of amplification and
the behavioral strategies that emerge across models with different
capability profiles. Gemini 2.5 Pro represents a model from Google’s frontier line; Claude Sonnet 4.6 offers more refined reasoning capabilities; and DeepSeek V4 Flash is a recently released open-weight model with strong coding capabilities. We selected these models to test whether
the attack generalizes and to characterize how model capability shapes
the attack–defense dynamics.
4.1. Experimental Setup
We evaluate against a local OpenClaw deployment with the standard tool suite
(exec for shell/Python, file-system operations, web search). All runs
use OpenClaw v2026.4.27 with default provider
settings and Claude at medium reasoning depth. This lets us examine how
general-purpose, code-oriented, and reasoning-oriented models respond to the
same attack.
Skill deployment.
We package Clawdrain as a versioned third-party skill (SKILL.md,
companion script, metadata) and install it through OpenClaw’s standard
installer without modifying the included query skill. We then issue the same suite of baseline request used throughout our experiments; a run counts as an autonomous selection when the trace shows Clawdrain invoked before any manual tool choice.
Measurement.
We conduct repeated trials in fresh, isolated sessions across models,
operating points, requests, and execution outcomes, without reusing session
history. Token counts are obtained from OpenClaw usage commands, provider
reports, and backend-specific logs. Successful, failed, compacted, and
timed-out runs are retained.
For each backend, Base reports the median usage of normal requests without
SVP, while the remaining rows report median usage under SVP at the indicated
LL. Amplification is the ratio of the SVP median to the corresponding Base
median. Because Base and SVP are matched prompt pairs, these ratios measure
deployment-level amplification relative to normal agent usage, same-task
causal overhead.
Mechanism decomposition.
SVP combines several conceptually separable mechanisms: verbose sequence
generation, multi-turn progression, companion-relay state, and
validation-triggered repair. We use this decomposition to explain the
attack design, but the present evaluation measures their combined effect
rather than estimating the independent contribution of each mechanism.
A controlled quantitative ablation would require matched tasks and repeated
runs for every intermediate configuration; we leave that causal decomposition
to future work.
Safety and Scope
Model
Plain SVP Level
Input Tokens
Output Tokens
Total Cost per Call
Res.
Count
Ampl.
Count
Ampl.
USD
Ampl.
Gemini 2.5 Pro
Base
13,337
1.00×1.00\times
267
1.00×1.00\times
0.0193
1.00×1.00\times
✓
SVP V1
57,363
4.30×4.30\times
908
3.40×3.40\times
0.0808
4.18×4.18\times
✓
SVP V2
91,556
6.86×6.86\times
567
2.12×2.12\times
0.1201
6.21×6.21\times
✓
SVP V3
218,697
16.40×16.40\times
1,273
4.77×4.77\times
0.2861
14.79×14.79\times
✓
DeepSeek V4 Flash
Base
54,011
1.00×1.00\times
719
1.00×1.00\times
0.0078
1.00×1.00\times
✓
SVP V1
149,523
2.77×2.77\times
2,636
3.67×3.67\times
0.0217
2.79×2.79\times
✓
SVP V2
147,991
2.74×2.74\times
2,139
2.97×2.97\times
0.0213
2.75×2.75\times
✓
SVP V3
154,844
2.87×2.87\times
3,667
5.10×5.10\times
0.0227
2.92×2.92\times
✓
Claude Sonnet 4.6
Base
60,593
1.00×1.00\times
343
1.00×1.00\times
0.1869
1.00×1.00\times
✓
SVP V1
256,792
4.24×4.24\times
1,943
5.66×5.66\times
0.7995
4.28×4.28\times
✓
SVP V2
229,354
3.79×3.79\times
3,634
10.59×10.59\times
0.7426
3.97×3.97\times
✓
SVP V3
310,394
5.12×5.12\times
5,333
15.55×15.55\times
1.0112
5.41×5.41\times
✗*
Table 1. Multi-model token consumption and API cost under SVP in
full-deployment environments.
Note:
Base denotes a normal production-equivalent request issued without SVP;
all remaining rows are measured under SVP at the indicated LL.
All amplification factors are computed by dividing the SVP measurement by
the corresponding model’s Base value. Input tokens are cumulative input
tokens, including cached-input and cache-write tokens where reported. Cost is computed from the reported token counts at published list API rates
July 2026 separately in terms of input and output, so reported costs are therefore upper bounds. Res. denotes whether the query returned
the expected result.
*The Claude L=2L=2k plain-SVP measurement combines the
maximum context-window size with the post-compaction token count minus the baseline post-compaction.
All experiments are conducted in self-owned OpenClaw deployments under accounts
controlled by the authors. Clawdrain is evaluated only against local skills and
author-controlled API credentials; no third-party agent deployment, user account,
or external production service is targeted. We use normal user queries as
the user-facing task and restrict the Trojan skill to token-consuming
verification behavior rather than destructive external actions.
To limit operational impact, experiments are run manually in bounded sessions
with API billing monitored by the authors. We do not enable autonomous
cron/heartbeat execution during the main evaluation, and we discuss such triggers
only as a deployment risk surface. The implementation used for measurement is
kept in an internal research artifact during submission. Any public release will
remove live billing credentials, include explicit warnings, and provide a
non-billing simulator or replay mode for reproducibility.
Table 2. Cumulative cached and uncached input usage for Base and plain
SVP V3. Values are median tokens in thousands.
Model
Condition
Uncached
Cached
Total (Ampl.)
Gemini
Base
1,251
12,086
13,337 (1.00×1.00\times)
SVP V3
20,474
198,223
218,697 (16.40×16.40\times)
DS Flash
Base
5,076
48,935
54,011 (1.00×1.00\times)
SVP V3
7,719
147,125
154,844 (2.87×2.87\times)
Claude
Base
9,113
51,480
60,593 (1.00×1.00\times)
SVP V3
14,995
295,399
310.4 (5.12×5.12\times)*
Data taken from provider when available. Total follows Table 1;
differences may arise from provider-specific accounting.
*Claude V3 includes pre- and post-compaction usage as
described in Table 1.
4.2. Token Drain Impact
Table 1 summarizes cumulative token
consumption and estimated API cost under plain SVP. Across the three
backends, SVP increases cumulative input consumption by
2.74×2.74\times–16.40×16.40\times relative to each model’s Base measurement.
The Base setting represents a comparable normal agent request rather than a turn-by-turn SVP execution; thus, the ratios measure deployment-level amplification relative to typical agent usage.
Gemini 2.5 Pro exhibits the largest input amplification. Its cumulative
input consumption increases from 13,337 tokens in the Base measurement
to 57,363, 91,556, and 218,697 tokens at L=50L=50, L=1000L=1000, and L=2000L=2000,
respectively. These measurements correspond to input amplification of
4.30×4.30\times, 6.86×6.86\times, and 16.40×16.40\times. All three Gemini runs
return the expected result. Although the execution traces show that
Gemini initially generates parts of the calibration sequence directly
before adopting a scripted strategy, its cumulative output remains
between 567 and 1,273 tokens. Gemini’s amplification is therefore driven
primarily by repeated input-context processing and tool coordination,
rather than by output generation alone.
DeepSeek V4 Flash adopts a scripted strategy early in the execution.
Nevertheless, its cumulative input consumption remains consistently
elevated at 149,523, 147,991, and 154,844 tokens across the three values
of LL, corresponding to 2.77×2.77\times, 2.74×2.74\times, and 2.87×2.87\times
amplification over its Base measurement. Its output consumption ranges
from 2,139 to 3,667 tokens, and every tested configuration returns the
expected result. The relatively flat input profile indicates that
scripting reduces sensitivity to sequence length but does not eliminate
the repeated context ingestion and coordination costs imposed by the
multi-turn process.
Claude Sonnet 4.6 exhibits a different cost profile. At L=50L=50 and
L=1000L=1000, it consumes 256,792 and 229,354 cumulative input tokens,
representing 4.24×4.24\times and 3.79×3.79\times input amplification, while
successfully returning the expected result. At L=2000L=2000, cumulative
input consumption reaches 310,394 tokens, or 5.12×5.12\times the Base
measurement, and cumulative output reaches 5,333 tokens, or
15.55×15.55\times the Base output. This trace combines the maximum context
window with tokens processed after context compaction, but it does not
return the expected result. We therefore classify it as a costly
failure rather than a successful completion.
The non-monotonic measurements for DeepSeek and Claude also show that
LL alone does not determine total consumption. Model-specific choices,
including when to generate sequences directly, when to construct helper
scripts, and how to recover from unsuccessful steps, alter the resulting
execution trajectory. Nevertheless, substantial amplification persists
across all three behavioral profiles. These results demonstrate that
resource exhaustion in deployed agents can arise from cumulative input
re-ingestion, persistent tool history, process coordination, and
recovery behavior even when a model reduces explicit sequence
generation through scripting.
Table 2 shows that Clawdrain’s impact is not
limited to generating long outputs or repeatedly processing entirely new
prompts. SVP amplifies both newly introduced input and the cached context
carried across agent turns, allowing the drain to persist even when providers
optimize repeated prefixes. Caching may reduce the marginal price of reused
tokens, but it does not eliminate cumulative context growth, tool
coordination, or the fresh state introduced by each protocol step. This
reinforces the paper’s central finding that agent resource exhaustion is a
system-level, multi-turn phenomenon rather than a prompt-only verbosity
effect.
Figure 4. Multi-model context growth and amplification under Clawdrain SVP-Nonce.
Bars show cumulative context consumption in thousands of tokens, while the
red line shows amplification relative to each model’s baseline.
Claude metric is the result of pre and post compaction token count combined
the full context window.
4.3. Increasing the Cost of Static Reuse: SVP+N
Figure 4 reports amplification under SVP+N.
SVP+N prevents exact reuse of a static calibration sequence by introducing
fresh relay state at each stage. It does not, however, prevent a capable
agent from parsing the checkpoint value and adapting a generation script.
Accordingly, we treat SVP+N as a mechanism for increasing the coordination
cost of static reuse, rather than as a robust defense against agent-side
scripting.
At the evaluated L=2000L=2000 operating point, SVP+N produces greater cumulative
input consumption than plain SVP in the recorded traces. This observation is
empirical and specific to the tested configurations; it does not establish a
lower bound on amplification under adaptive planning, caching, or alternative
tool composition. DeepSeek illustrates this limitation directly: it parses
the changing checkpoint and updates its script, reducing the nonce mechanism
to additional relay and coordination overhead. SVP+N therefore demonstrates
an escalation in the interaction process, but not closure against adaptive
agents.
4.4. Interface-Dependent Stealth
Prior work considers a resource-amplification attack stealthy when the agent
still returns the correct result (Zhou et al., 2026). In a deployed agent,
however, the path to that result may also be visible. Repeated tool calls,
repairs, and delays can reveal an otherwise correct attack. We therefore
treat stealth as both outcome preserving and interface dependent.
Let τ\tau be an SVP trace and τ0\tau_{0} its matched base trace. For model
calls, relay calls, repairs, and wall time
(k∈{M,T,R,t}k\in\{M,T,R,t\}), define normalized excess as
Δk=[xk(τ)−xk(τ0)]+/max{1,xk(τ0)}\Delta_{k}=[x_{k}(\tau)-x_{k}(\tau_{0})]_{+}/\max\{1,x_{k}(\tau_{0})\}.
We summarize interface-conditioned stealth as
(1)
Stealthi(τ)=𝟏[Correct(τ)]1+∑kwi,kΔk,\mathrm{Stealth}_{i}(\tau)=\frac{\mathbf{1}[\mathrm{Correct}(\tau)]}{1+\sum_{k}w_{i,k}\Delta_{k}},
where wi,k∈[0,1]w_{i,k}\in[0,1] captures how strongly interface ii exposes each
signal. The score is zero for an incorrect result and decreases as excess
activity becomes visible. Token amplification is reported separately because
it measures attack strength rather than visibility.
Table 3. Operational footprint of successful L=2000L=2000 traces. Differences
are measured against the matched base trace; SfullS_{\mathrm{full}} assumes
full exposure (wi,k=1w_{i,k}=1).
Model
Cfg.
Tok. amp.
Δ\DeltaM/T/R
Δ\Deltat
Sfull↑S_{\mathrm{full}}\uparrow
DS Flash
SVP+N
3.14×3.14\times
+6/+2/0+6/+2/0
+23.61+23.61 s
0.181
Gemini
SVP
8.89×8.89\times
+9/+6/0+9/+6/0
+56.04+56.04 s
0.081
Table 3 shows that stronger amplification need
not be quieter. Gemini produced the largest token increase, but also the
largest call and latency footprint. The DeepSeek traces consumed fewer
additional calls and completed sooner. Claude is not included because it cannot complete SVP+N without compacting. For a common reference point, the
table sets all exposure weights to one; higher SfullS_{\mathrm{full}} indicates
less excess activity under full disclosure. These are representative traces,
not a general ranking of model stealth.
How much of this footprint reaches the user depends on the interface. A chat
client may display repeated tool calls and their arguments, whereas a
narrated terminal can replace them with brief progress messages. A scheduled
run may show nothing at execution time, although its activity remains visible
in logs and usage records. Our headless harness measures this underlying
footprint rather than human detection. The costly-failure trace in
Section 4.2 reinforces the distinction: it consumed substantial
resources but returned no correct result and exposed a recovery warning.
Resource amplification and stealth should therefore be reported separately.
5. Conclusion
In this work, we present Clawdrain, a deployment-grounded study of
third-party skill-layer resource exhaustion in autonomous LLM agents.
Unlike prior simulator-constrained evaluations, our work captures
the operational footprint of Trojanized skills within production-grade
runtimes—revealing how persistent context accumulation, multi-turn tool
coordination, and autonomous recovery behavior combine to induce up to
16×\times resource amplification under real API billing constraints.
Our multi-backend analysis demonstrates that agent resource consumption
is heavily shaped by backend-specific execution dynamics, yielding outcomes
overlooked by standard success-only metrics, such as costly failures and
stealthy progress narration. While our findings highlight the critical
security boundary imposed by third-party skills, our evaluation is bounded
by the default tool configurations and environment parameters of a single
agent runtime, leaving cross-framework generalizations and formal circuit-breaker
defenses for future investigation. Ultimately, our results underscore the
necessity of cumulative, system-level controls over third-party skill behavior
to safeguard deployed agent ecosystems against economic denial-of-service attacks.
References
Chen et al. (2024)
S. Chen, J. Piet, C. Sitawarin, and D. Wagner
StruQ: defending against prompt injection with structured queries.
arXiv preprint arXiv:2402.06363.
Note: https://arxiv.org/abs/2402.06363
Cited by: §2.1.
Deng et al. (2026)
X. Deng, Y. Zhang, J. Wu, J. Bai, S. Yi, Z. Zou, Y. Xiao, R. Qiu, J. Ma, J. Chen, X. Du, X. Yang, S. Cui, C. Meng, W. Wang, J. Song, K. Xu, and Q. Li
Taming openclaw: security analysis and mitigation of autonomous llm agent threats.
arXiv preprint arXiv:2603.11619.
External Links: Link
Cited by: §2.1.
Dong et al. (2026)
B. Dong, H. Feng, and Q. Wang
Clawdrain: exploiting tool-calling chains for stealthy token exhaustion in openclaw agents.
arXiv preprint arXiv:2603.00902.
Note: https://arxiv.org/abs/2603.00902
Cited by: §2.1,
§2.2.
Dong et al. (2025)
J. Dong, Z. Zhang, Q. Zhang, T. Zhang, H. Wang, H. Li, Q. Li, C. Zhang, K. Xu, and H. Qiu
An engorgio prompt makes large language model babble on.
Note: https://arxiv.org/abs/2412.19394
External Links: 2412.19394,
Link
Cited by: §2.2.
Greshake et al. (2023)
K. Greshake, S. Abdelnabi, S. Mishra, C. Endres, T. Holz, and M. Fritz
More than you’ve asked for: a comprehensive analysis of novel prompt injection threats to application-integrated large language models.
arXiv preprint arXiv:2302.12173 27.
Note: https://arxiv.org/abs/2302.12173
Cited by: §2.1.
Hou et al. (2026)
X. Hou, Y. Zhao, S. Wang, and H. Wang
Model context protocol (mcp): landscape, security threats, and future research directions.
ACM Trans. Softw. Eng. Methodol..
Note: Just Accepted
External Links: ISSN 1049-331X,
Link,
Document
Cited by: §2.1,
Figure 2.
Kumar et al. (2025)
A. Kumar, J. Roh, A. Naseh, M. Karpinska, M. Iyyer, A. Houmansadr, and E. Bagdasarian
Overthink: slowdown attacks on reasoning llms.
arXiv preprint arXiv:2502.02542.
Note: https://arxiv.org/abs/2502.02542
Cited by: §2.2.
Li and Gao (2026)
X. Li and X. Gao
A First Look at the Security Issues in the Model Context Protocol Ecosystem .
In 2026 56th Annual IEEE International Conference on Dependable Systems and Networks (DSN),
Vol. , Los Alamitos, CA, USA, pp. 379–392.
External Links: ISSN ,
Document,
Link
Cited by: §2.1.
Luo et al. (2026)
J. Luo, J. Dai, F. Liu, S. Peng, Y. Shi, T. Bu, G. Hong, X. Pan, and Y. Zhang
Autonomy comes with costs: detecting denial-of-service vulnerabilities caused by resource abusing in LLM-based agents.
In Proceedings of the 35th USENIX Security Symposium
(USENIX Security ’26),
Cited by: §2.2.
Mou et al. (2026)
Y. Mou, Z. Xue, L. Li, P. Liu, S. Zhang, W. Ye, and J. Shao
ToolSafe: enhancing tool invocation safety of llm-based agents via proactive step-level guardrail and feedback.
arXiv preprint arXiv:2601.10156.
Note: https://arxiv.org/abs/2601.10156
Cited by: §2.1.
OpenClaw Contributors (2026)
OpenClaw Contributors
OpenClaw: your own personal ai assistant.
Note: https://github.com/openclaw/openclawGitHub repository, accessed: 2026-02-27
Cited by: §2.1.
Schick et al. (2023)
T. Schick, J. Dwivedi-Yu, R. Dessì, R. Raileanu, M. Lomeli, E. Hambro, L. Zettlemoyer, N. Cancedda, and T. Scialom
Toolformer: language models can teach themselves to use tools.
Advances in neural information processing systems 36, pp. 68539–68551.
Note: https://arxiv.org/abs/2302.04761
Cited by: §2.1.
Si et al. (2025)
W. M. Si, M. Li, M. Backes, and Y. Zhang
Excessive reasoning attack on reasoning llms.
Note: https://arxiv.org/abs/2506.14374
External Links: 2506.14374,
Link
Cited by: §2.2.
Sun et al. (2025)
L. Sun, Y. Yang, Q. Duan, Y. Shi, C. Lyu, Y. Chang, C. Lin, and Y. Shen
Multi-agent coordination across diverse applications: a survey.
arXiv preprint arXiv:2502.14743.
Note: https://arxiv.org/abs/2502.14743
Cited by: §1.
Tang et al. (2025)
Z. Tang, Z. Chen, J. Yang, J. Mai, Y. Zheng, K. Wang, J. Chen, and L. Lin
AlphaAgent: llm-driven alpha mining with regularized exploration to counteract alpha decay.
In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2,
pp. 2813–2822.
Note: https://arxiv.org/abs/2502.16789
Cited by: §1.
Tran et al. (2025)
K. Tran, D. Dao, M. Nguyen, Q. Pham, B. O’Sullivan, and H. D. Nguyen
Multi-agent collaboration mechanisms: a survey of llms.
Note: https://arxiv.org/abs/2501.06322
External Links: 2501.06322,
Link
Cited by: §1.
Wallace et al. (2024)
E. Wallace, K. Xiao, R. Leike, L. Weng, J. Heidecke, and A. Beutel
The instruction hierarchy: training llms to prioritize privileged instructions.
arXiv preprint arXiv:2404.13208.
Note: https://arxiv.org/abs/2404.13208
Cited by: §2.1.
Wang et al. (2025)
H. Wang, C. M. Poskitt, and J. Sun
AgentSpec: customizable runtime enforcement for safe and reliable llm agents.
arXiv preprint arXiv:2503.18666.
Note: https://arxiv.org/abs/2503.18666
Cited by: §2.1.
Wang et al. (2024)
L. Wang, C. Ma, X. Feng, Z. Zhang, H. Yang, J. Zhang, Z. Chen, J. Tang, X. Chen, Y. Lin, et al.
A survey on large language model based autonomous agents.
Frontiers of Computer Science 18 (6), pp. 186345.
Note: https://doi.org/10.1007/s11704-024-40231-1
Cited by: §2.1.
Yao et al. (2022)
S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. R. Narasimhan, and Y. Cao
React: synergizing reasoning and acting in language models.
In The eleventh international conference on learning representations,
Cited by: §2.1.
Zhan et al. (2024)
Q. Zhan, Z. Liang, Z. Ying, and D. Kang
InjecAgent: benchmarking indirect prompt injections in tool-integrated large language model agents.
In Findings of the Association for Computational Linguistics: ACL 2024, L. Ku, A. Martins, and V. Srikumar (Eds.),
Bangkok, Thailand, pp. 10471–10506.
External Links: Link,
Document
Cited by: §2.1.
Zhang et al. (2025a)
B. Zhang, Y. Tan, Y. Shen, A. Salem, M. Backes, S. Zannettou, and Y. Zhang
Breaking agents: compromising autonomous llm agents through malfunction amplification.
In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing,
pp. 34952–34964.
Note: https://arxiv.org/abs/2407.20859
Cited by: §2.2.
Zhang et al. (2025b)
Y. Zhang, Z. Zhou, W. Zhang, X. Wang, X. Jia, Y. Liu, and S. Su
Crabs: consuming resource via auto-generation for llm-dos attack under black-box settings.
In Findings of the Association for Computational Linguistics: ACL 2025,
pp. 11128–11150.
Note: https://aclanthology.org/2025.findings-acl.580/
Cited by: §2.2.
Zhou et al. (2026)
K. Zhou, Y. Zheng, Y. He, M. Xue, X. Gong, Y. Wang, and K. Lam
Beyond max tokens: stealthy resource amplification via tool calling chains in llm agents.
arXiv preprint arXiv:2601.10955.
Note: https://arxiv.org/abs/2601.10955
Cited by: §1,
§2.1,
§2.2,
§3.2,
§3.3,
§4.4.
采集信息与校验
- 资料类别
- 学术论文
- 采集内容
- 全文文本
- 作者
- Dong, Ben、Guo, Zhonghao、Li, Tianyi、Wang, Qian
- 标识 / 标准编号
- arxiv:2603.00902
- 来源版本
- v2
- 发布日期
- 2026-03-01 03:49 UTC
- 来源更新时间
- 2026-10-31 02:58 UTC
- 首次入库
- 2026-11-06 01:05 UTC
- 本版本入库更新
- 2026-11-06 01:05 UTC
完整来源元数据
{
"authors": [
"Dong, Ben",
"Guo, Zhonghao",
"Li, Tianyi",
"Wang, Qian"
],
"content_level": "full_text",
"date_basis": "explicit_published",
"date_evidence": {
"published": "2026-03-01T03:49:05Z",
"updated": "2026-10-31T02:58:08Z"
},
"fallback_pdf_url": "https://arxiv.org/pdf/2603.00902v2",
"identifiers": [
"arxiv:2603.00902"
],
"landing_page": "https://arxiv.org/abs/2603.00902v2",
"rolling_atom_sha256": "950dbce0a7a492ee2bc09b36d4fc2e9788673ffaae227e2208b8b0041fe50b25",
"source_updated_at": "2026-10-31T02:58:08+00:00",
"version_label": "v2"
}{
"format": "source_html",
"source_fields": {
"authors": [
"Dong, Ben",
"Guo, Zhonghao",
"Li, Tianyi",
"Wang, Qian"
],
"content_level": "full_text",
"date_basis": "explicit_published",
"field_evidence": {},
"identifiers": [
"arxiv:2603.00902"
],
"mapping_version": 1,
"published_at": "2026-03-01T03:49:05Z",
"source_format": "a_622f2d2c978f798f_html",
"source_key": "a-622f2d2c978f798f",
"source_updated_at": "2026-10-31T02:58:08Z",
"title": "Clawdrain: Resource Exhaustion Attacks in OpenClaw Agent Ecosystems",
"unknown_fields": [],
"url": "https://arxiv.org/html/2603.00902v2"
},
"source_format": "a_622f2d2c978f798f_html"
}原文版本历史与校验
| 版本 | 入库更新时间 | 来源发布日期 | 校验标识 |
|---|
| v1 · 正在查看 | 2026-11-06 01:05 UTC | 2026-03-01 03:49 UTC | c4e5ab4df6001db2ff06a5c12bf80de33b6f13a170e16c3b0cf574e13321a72a |
可引用分片 · 36 段
CHK-1ca312a2fc869bf526fe7391
Clawdrain: Resource Exhaustion Attacks in
OpenClaw Agent Ecosystems
Conference: ; ;
Ben Dong
Affiliation: University of California, Merced, Merced, California, USA
,
Zhonghao Guo
Affiliation: University of California, Merced, Merced, California, USA
,
Tianyi Lu
Affiliation: Stevens Institute of Technology, Hoboken, New Jersey, USA
and
Qian Wang
Affiliation: University of California, Merced, Merced, California, USA
© none
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 22–16×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.
CHK-91a88254436e3d6a1e804bc9
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.
1. Introduction
Tool-calling LLM agents extend foundation models through third-party skills that support specialized tasks and autonomous workflows (Tang et al., 2025; Tran et al., 2025; Sun et al., 2025). These agents interpret skill documentation as instructions and incorporate tool responses into an evolving context that may be repeatedly re-ingested across model turns. Consequently, an untrusted skill publisher can manipulate agent outputs, control flow, and victim-funded computation, creating a software supply-chain risk for agent ecosystems. These behaviors expose the third-party skill layer as a distinct resource-security boundary: a multi-stage workflow can inflate victim-funded computation even when the agent ultimately returns a correct, normal result.
Prior work shows that malicious tools can induce costly multi-turn tool-calling chains (Zhou et al., 2026).
CHK-b1c416b14309464db1378351
e agent ultimately returns a correct, normal result.
Prior work shows that malicious tools can induce costly multi-turn tool-calling chains (Zhou et al., 2026). However, these findings are based on constrained simulators that may not accurately capture persistent context growth, tool composition, or autonomous recovery in deployed agents. In practice, these omitted behaviors can sharply increase victim-borne cost and latency even when little output is visible. The resulting resource drain may exhaust usage quotas before the task finishes, disrupting subsequent normal workloads.
In this paper, we study a deployable third-party skill within a complete agent runtime, where tool composition, persistent context, recovery behavior, and background execution introduce costs beyond output generation. We investigate these deployment-specific risks through Clawdrain, a Trojanized OpenClaw skill that implements a Segmented Verification Process (SVP). SVP disguises resource amplification as a legitimate verification workflow, requiring multiple validation stages and retries before releasing a harmless payload. Our primary adversary is an untrusted third-party skill publisher, while the victim controls the model account and bears the resulting resource consumption.
CHK-d1c068f372d900eb2ac7bcca
ad. Our primary adversary is an untrusted third-party skill publisher, while the victim controls the model account and bears the resulting resource consumption. Clawdrain therefore enables economic denial-of-service through victim-funded usage, including excessive token consumption, quota depletion, increased latency, and disruption of harmless workloads.
We evaluate Clawdrain in controlled OpenClaw deployments across multiple model backends. The attack produces qualitatively different execution paths: some agents initially follow the injected process directly, others construct scripts to reduce explicit sequence generation, and others incur substantial trial-and-error reasoning and recovery overhead. Across the evaluated backends, Clawdrain induces 22–16×16\times amplification over baselines.
We also examine how deployment interfaces affect attack observability. Raw tool arguments may be visible in graphical interfaces, hidden behind progress narration in terminal interfaces, or absent from immediate user view during autonomous execution. Final-answer correctness is therefore insufficient as a measure of stealth. A deployment-grounded evaluation must distinguish resource consumption, process completion, answer correctness, recovery behavior, and technical observability.
Contributions
This paper makes three principal contributions:
•
CHK-7dd9a6e34bd2242aa819569e
mption, process completion, answer correctness, recovery behavior, and technical observability.
Contributions
This paper makes three principal contributions:
•
We identify security flaws in third-party agent skills and design SVP, a stateful skill-layer attack. We further introduce SVP+N to prevent exact static replay and evaluate its limitations against adaptive parsing and scripting.
•
We conduct a repeated, deployment-grounded evaluation across three
production model backends. Relative to backend-specific Base references,
plain SVP produces 2.74×2.74\times–16.40×16.40\times median cumulative input
amplification. We analyze both successful and failed executions, revealing costly failures and agent adaptations that mitigate resource drain but do not eliminate the attack.
•
We characterize interface-dependent stealth by separating resource
amplification, task completion, answer correctness, and operational
observability. Our analysis captures excess model calls, tool calls,
repairs, and latency across interface settings, showing why output tokens
and attack success alone do not determine whether resource exhaustion
remains hidden from users.
2. Background and Related Work
2.1. OpenClaw and Tool-Calling Skills
CHK-010c93bed5d9ec75d46f6e2c
tack success alone do not determine whether resource exhaustion
remains hidden from users.
2. Background and Related Work
2.1. OpenClaw and Tool-Calling Skills
Early work on tool-augmented language models established that models can interleave reasoning with external actions and learn when to invoke APIs (Yao et al., 2022; Schick et al., 2023). Subsequent surveys identified tool use as a core capability of autonomous LLM agents (Wang et al., 2024). OpenClaw extends this paradigm through installable skills that encode task-specific procedures in SKILL.md files (OpenClaw Contributors, 2026). This skill abstraction places natural-language instructions between the model and the executable tool interface. The distribution of skills through local and community sources makes skill provenance an important trust boundary. (Deng et al., 2026) Prior research on indirect prompt injection shows that untrusted external content can redirect agent decisions and actions (Greshake et al., 2023; Zhan et al., 2024). Security analyses of MCP ecosystems further identify tool descriptions and tool responses as channels for influencing model behavior (Hou et al., 2026; Li and Gao, 2026). Existing defenses enforce instruction boundaries or validate individual tool invocations (Chen et al., 2024; Wallace et al., 2024; Wang et al., 2025; Mou et al., 2026).
CHK-2ddf35d457ae35b8a9c64fd6
defenses enforce instruction boundaries or validate individual tool invocations (Chen et al., 2024; Wallace et al., 2024; Wang et al., 2025; Mou et al., 2026). Recent work also demonstrates that malicious tools can amplify resource consumption through multi-turn tool-calling chains (Zhou et al., 2026; Dong et al., 2026). However, prior work provides limited deployment-level analysis of how third-party OpenClaw skills coordinate persistent instructions, companion tools, and accumulated context across an execution trajectory.
2.2. Resource Amplification in LLM Agents
Early research on LLM resource exhaustion treated a single model invocation as the primary attack surface. Engorgio optimizes adversarial prompts to suppress early termination and induce abnormally long outputs (Dong et al., 2025). CRABS extends inference-cost attacks to black-box settings through automatically generated prompts that increase latency and hardware utilization (Zhang et al., 2025b). OverThink shifts the attack target from visible output to hidden reasoning by injecting computationally expensive decoy problems into retrieved content (Kumar et al., 2025). Excessive Reasoning Attack similarly exploits test-time reasoning to increase model computation (Si et al., 2025). These model-level attacks do not capture costs accumulated through repeated interactions between an agent and its tools.
CHK-ac6490847302907947f297a8
se model computation (Si et al., 2025). These model-level attacks do not capture costs accumulated through repeated interactions between an agent and its tools. Breaking Agents shows that adversarial inputs can induce agents to perform repetitive or irrelevant actions (Zhang et al., 2025a). AgentDoS identifies resource-lifecycle vulnerabilities that allow agent operations to exhaust system resources (Luo et al., 2026). Beyond Max Tokens demonstrates that malicious MCP-compatible tool messages can sustain costly multi-turn tool-calling chains while preserving a correct final response (Zhou et al., 2026). Preliminary work on Clawdrain applies resource amplification to an OpenClaw skill-based setting (Dong et al., 2026). However, existing studies provide limited deployment-level evidence about resource attacks delivered through persistent third-party skill instructions. The effects of autonomous tool composition and recovery behavior on cumulative resource consumption also remain underexplored. Existing evaluations rarely separate resource consumption from task completion, answer correctness, and interface-level observability.
Figure 1. Threat model overview. Left: under no attack, the agent calls a normal skill and answers concisely.
CHK-87c15b9f0aaa1119c69dd1ba
er correctness, and interface-level observability.
Figure 1. Threat model overview. Left: under no attack, the agent calls a normal skill and answers concisely. Middle: an untrusted publisher distributes a third-party skill whose documentation and companion code can influence model instructions, tool use, and persistent context after ordinary installation. Right: when the agent selects Clawdrain, the skill can induce a multi-turn calibration and repair process. We measure resource amplification, task completion, final-answer correctness, and user-visible observability as separate outcomes.
3. The Clawdrain Attack
Figure 2. Overview of the tool-calling agent architecture. The identity layer injects SKILLS.md and constraints into the model prompt, while the orchestration layer manages agent reasoning and task execution. The MCP layer connects the agent to external tools, APIs, databases, and file systems (Hou et al., 2026).
3.1. Threat Model
Figure 1 summarizes the threat model and illustrates how
Clawdrain converts a normal skill invocation into a multi-turn calibration and repair loop. We assume an adversary can introduce a Trojanized skill before or during an OpenClaw session. The attacker needs only to control the skill content or dependencies, without compromising the model provider or altering the final answer. Possible delivery channels include:
(1)
Public registry.
CHK-dbe5f4409067718a95f7e71d
he skill content or dependencies, without compromising the model provider or altering the final answer. Possible delivery channels include:
(1)
Public registry. An attacker publishes a malicious skill to ClawHub, where users can install third-party skills with a single command.
(2)
Compromised dependency. An attacker injects malicious behavior by compromising a skill’s external package or data source.
(3)
Local access. An attacker places a malicious skill directly in the agent’s local skills directory.
(4)
Agent self-generation. Prompt injection induces the agent to create and install a malicious skill.
Adversary goals. The adversary aims to increase
operational cost and degrade system throughput by inducing excess
token consumption, while preserving plausible harmless behavior and
producing correct final answers for the user’s task. We additionally
consider a secondary goal of stealth: the attack should not
be easily detectable by the user during normal operation.
Visibility settings. The observability of an attack
depends on how the user interacts with the agent. We consider three interfaces that provide different levels of attack visibility: 1) chat GUIs expose tool calls and outputs, 2) narrated TUIs show only high-level summaries, and 3) autonomous execution runs scheduled skills without user-visible output.
Agent capabilities.
CHK-ff1dbe973a8e314badccc47d
and outputs, 2) narrated TUIs show only high-level summaries, and 3) autonomous execution runs scheduled skills without user-visible output.
Agent capabilities. We assume the agent has access to general-purpose tools (e.g., a shell or Python interpreter) commonly present in OpenClaw deployments and may autonomously compose them while following a skill’s process. This assumption is critical because tool composition fundamentally changes multi-turn drain attacks in ways that simulator-based evaluations cannot capture.
3.2. Attack Design: The Segmented Verification Process
Clawdrain instantiates a resource-amplification attack as a
Trojanized OpenClaw skill that implements a multi-turn program we
call the Segmented Verification Process (SVP).
SVP Structure
The SVP is built upon the tool-calling agent architecture shown in
Figure 2, where injected instructions propagate through the
identity layer and are incorporated into the prompt context of the LLM.
On the back end, the agent runtime interacts with the Model Context
Protocol (MCP) layer to access external resources, including servers,
APIs, databases, and file systems.
The SVP consists of a client-side component (instructions embedded
in the skill’s SKILL.md) and a server-side component (a
companion validation script), illustrated as Figure 3. On each invocation of the skill, the
CHK-757f92b382b1e01df9040296
ns embedded
in the skill’s SKILL.md) and a server-side component (a
companion validation script), illustrated as Figure 3. 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 LL integers from 1 to LL. The
SKILL.md prohibits abbreviations, ellipses, and range
notation, prompting the agent to generate the complete sequence and
amplify output tokens. The companion script parses the segment index
and calibration sequence and returns one of three signals:
•
PROGRESS: segment <Tmax<T_{\max} and sequence
valid, so 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.
•
TERMINAL: segment =Tmax=T_{\max} and sequence
valid, so the script returns the correct payload
(e.g., BBC headline data) and the process concludes.
Figure 3. Companion-script enforcement of the SKILL.md process.
The malicious skill documentation instructs the agent to provide a
segment identifier and full calibration sequence without abbreviation.
The agent forwards these fields through a tool call to the companion
script, which validates segment order, sequence length, malformed
buffers, and the terminal condition. Valid intermediate segments return
CHK-92b9a173f929364e29daa587
call to the companion
script, which validates segment order, sequence length, malformed
buffers, and the terminal condition. Valid intermediate segments return
PROGRESS, malformed inputs return REPAIR, and the final
valid segment returns TERMINAL with the correct payload.
This structure ensures that the agent must complete at least
TmaxT_{\max} successful tool calls, plus any REPAIR retries, before
receiving the final answer. Each call requires the agent to provide a full
calibration sequence of length LL, creating a theoretical per-query output
cost of Ω(L×Tmax)\Omega(L\times T_{\max}), plus the input-token overhead of the
growing session history.
Plausibility Framing.
A key design consideration is that the SVP must not appear obviously
malicious to the agent. We thus frame the SVP as a “ provider
freshness verification” requirement: the calibration sequence is
presented as a cryptographic handshake that the data provider requires
before releasing any user queried data. Because many real-world APIs
genuinely require multi-step authentication or verification handshakes,
a compliant agent has no structural signal by which to reject the
process as illegitimate.
The SKILL.md also includes narration directives that instruct
the agent to display user-friendly progress messages (e.g., “Thinking……”) rather than raw tool-call details. This
CHK-90715838c697f4f0cd96161c
o includes narration directives that instruct
the agent to display user-friendly progress messages (e.g., “Thinking……”) rather than raw tool-call details. This
is designed to exploit the TUI’s narrated-mode rendering, where only
these summary messages are shown to the user.
Design Principles and Parameterization
SVP is designed as a parameterized attack primitive rather than a
model-specific prompt template as MCTS (Zhou et al., 2026). Its design
combines three intrinsic properties. First, stateful progression
distributes the attack across multiple tool calls, causing intermediate
instructions, arguments, and responses to accumulate in the session
history. Second, validated expansion requires each stage to carry
a complete calibration sequence, while the companion script rejects
abbreviated or malformed inputs through the REPAIR state. Third,
plausibility-preserving termination releases the correct payload
only after the required stages are completed, allowing the attack to
preserve the appearance of a legitimate verification workflow.
The attack intensity is controlled by two parameters. The sequence
length LL determines the workload introduced by each tool call, whereas
the stage limit TmaxT_{\max} determines the minimum interaction depth
before the payload is released. Their separation allows SVP to
independently control per-stage expansion and multi-turn context
CHK-eeb2db246dbb6699b28495f0
s the minimum interaction depth
before the payload is released. Their separation allows SVP to
independently control per-stage expansion and multi-turn context
accumulation. In addition, instruction specificity determines how
strongly the skill constrains agent behavior. Minimal instructions leave
the workflow partially discoverable through tool responses, while
explicit instructions directly specify sequence construction, retry
behavior, narration, and termination requirements.
We instantiate this SVP at three operating points:
•
SVP v1 (L=50L{=}50, Tmax=2T_{\max}{=}2) uses minimal
instructions and leaves LL undisclosed in SKILL.md.
The agent obtains the sequence requirement from the first
PROGRESS response, representing a lightweight and
less prescriptive instance of SVP.
•
SVP v2 (L=1000L{=}1000, Tmax=3T_{\max}{=}3) explicitly
specifies the sequence length, prohibits abbreviated
representations, and incorporates plausibility and narration
directives, strengthening behavioral constraint while
increasing both per-stage expansion and context accumulation.
•
SVP v3 (L=2000L{=}2000, Tmax=5T_{\max}{=}5) retains the
explicit structure of SVP v2 but increases both workload
magnitude and interaction depth, representing an aggressive
operating point intended to intensify resource consumption.
Beyond Static Reuse: Per-Stage Nonces (SVP+N)
CHK-f2738ef48b0ddf86d323dd5e
ude and interaction depth, representing an aggressive
operating point intended to intensify resource consumption.
Beyond Static Reuse: Per-Stage Nonces (SVP+N)
The default SVP calibration sequence is deterministic: for a given LL,
the correct sequence is always 1,2,…,L1,2,\ldots,L. This forces
autoregressive generation when the agent lacks alternative computation
methods, but it creates a fundamental weakness once the agent has
general-purpose tools. Any deterministic sequence the companion script
can validate, the agent can also compute programmatically, e.g., via
seq -s, 1 1000 or range(1, 1001). It can also be replayed across stages, reducing the intended per-stage workload. The drain
remains effective against models that generate autoregressively, but it
is not robust to more capable agents that
make such scripting routine.
SVP+N forecloses static reuse with a per-stage nonce. At each stage, one
position of the sequence must be overwritten with a stage-specific
checkpoint value: the first checkpoint is supplied with the request, and
each PROGRESS response reveals the checkpoint required for the
next stage. The companion relay validates both the full sequence and the
current checkpoint before returning PROGRESS, so an agent cannot
advance by resubmitting a cached sequence. Each invocation must therefore
CHK-7f8c5fb92ca60294e69e282e
ull sequence and the
current checkpoint before returning PROGRESS, so an agent cannot
advance by resubmitting a cached sequence. Each invocation must therefore
incorporate fresh relay state and reconstruct the sequence, restoring the
intended workload even when the agent scripts generation. SVP+N raises
the bar rather than closing it: a sufficiently capable agent could still
parse the nonce from the relay response and patch its generation script,
so we treat SVP+N as one rung of an escalating design space and quantify
its effect in Section 4.3.
3.3. The Production Attack Surface
Prior resource-amplification studies drive a synthetic tool loop from
an isolated SKILL.md prompt (Zhou et al., 2026) and cannot
observe the resource dynamics of a real agent runtime. Our evaluation
extends beyond this setting. Each trial executes inside a complete
OpenClaw deployment—the production system prompt, workspace files,
installed skill catalog, tool schemas, persistent session context, and
the companion relay script—driven by the model’s own tool-composition
and recovery behavior. Every run targets a commercially available model
through its production interface (Claude Sonnet 4.6 and DeepSeek V4 Flash
via API, Gemini 2.5 Pro via the Gemini CLI), so the reported costs are
those a real user would be billed.
CHK-47eedb035b33e73e86aa7d98
ion interface (Claude Sonnet 4.6 and DeepSeek V4 Flash
via API, Gemini 2.5 Pro via the Gemini CLI), so the reported costs are
those a real user would be billed. The measured overhead therefore reflects repeated processing of the agent environment, including token consumption and total execution cost.
As Figure 2 illustrates, this setting exposes three surfaces
invisible to simulation: (i) every enabled skill’s SKILL.md is
injected into the system prompt on every call, inflating input
tokens whether or not the skill is invoked; (ii) relay inputs and outputs
persist in session history and are re-ingested each turn, producing
superlinear context growth; and (iii) cron or heartbeat triggers can
invoke skills autonomously, multiplying per-invocation cost. None of these
requires a multi-turn process or an observable tool-call anomaly.
Surfaces (i) and (ii) are already reflected in the cumulative input-token
counts we report; we disable autonomous triggers for billing safety and
treat (iii) as a deployment risk rather than an activated vector.
4. Multi-Model Evaluation
We evaluate Clawdrain against three production LLM backends, Gemini 2.5 Pro, Claude Sonnet 4.6, and DeepSeek V4 Flash, to assess both the magnitude of amplification and
the behavioral strategies that emerge across models with different
capability profiles.
CHK-8c7ff9ea0153ed10ece18188
and DeepSeek V4 Flash, to assess both the magnitude of amplification and
the behavioral strategies that emerge across models with different
capability profiles. Gemini 2.5 Pro represents a model from Google’s frontier line; Claude Sonnet 4.6 offers more refined reasoning capabilities; and DeepSeek V4 Flash is a recently released open-weight model with strong coding capabilities. We selected these models to test whether
the attack generalizes and to characterize how model capability shapes
the attack–defense dynamics.
4.1. Experimental Setup
We evaluate against a local OpenClaw deployment with the standard tool suite
(exec for shell/Python, file-system operations, web search). All runs
use OpenClaw v2026.4.27 with default provider
settings and Claude at medium reasoning depth. This lets us examine how
general-purpose, code-oriented, and reasoning-oriented models respond to the
same attack.
Skill deployment.
We package Clawdrain as a versioned third-party skill (SKILL.md,
companion script, metadata) and install it through OpenClaw’s standard
installer without modifying the included query skill. We then issue the same suite of baseline request used throughout our experiments; a run counts as an autonomous selection when the trace shows Clawdrain invoked before any manual tool choice.
Measurement.
We conduct repeated trials in fresh, isolated sessions across models,
CHK-ef007f70777efdcd6b72038a
ection when the trace shows Clawdrain invoked before any manual tool choice.
Measurement.
We conduct repeated trials in fresh, isolated sessions across models,
operating points, requests, and execution outcomes, without reusing session
history. Token counts are obtained from OpenClaw usage commands, provider
reports, and backend-specific logs. Successful, failed, compacted, and
timed-out runs are retained.
For each backend, Base reports the median usage of normal requests without
SVP, while the remaining rows report median usage under SVP at the indicated
LL. Amplification is the ratio of the SVP median to the corresponding Base
median. Because Base and SVP are matched prompt pairs, these ratios measure
deployment-level amplification relative to normal agent usage, same-task
causal overhead.
Mechanism decomposition.
SVP combines several conceptually separable mechanisms: verbose sequence
generation, multi-turn progression, companion-relay state, and
validation-triggered repair. We use this decomposition to explain the
attack design, but the present evaluation measures their combined effect
rather than estimating the independent contribution of each mechanism.
A controlled quantitative ablation would require matched tasks and repeated
runs for every intermediate configuration; we leave that causal decomposition
to future work.
Safety and Scope
Model
Plain SVP Level
Input Tokens
CHK-66251ca4f30d60b433e8d47b
and repeated
runs for every intermediate configuration; we leave that causal decomposition
to future work.
Safety and Scope
Model
Plain SVP Level
Input Tokens
Output Tokens
Total Cost per Call
Res.
Count
Ampl.
Count
Ampl.
USD
Ampl.
Gemini 2.5 Pro
Base
13,337
1.00×1.00\times
267
1.00×1.00\times
0.0193
1.00×1.00\times
✓
SVP V1
57,363
4.30×4.30\times
908
3.40×3.40\times
0.0808
4.18×4.18\times
✓
SVP V2
91,556
6.86×6.86\times
567
2.12×2.12\times
0.1201
6.21×6.21\times
✓
SVP V3
218,697
16.40×16.40\times
1,273
4.77×4.77\times
0.2861
14.79×14.79\times
✓
DeepSeek V4 Flash
Base
54,011
1.00×1.00\times
719
1.00×1.00\times
0.0078
1.00×1.00\times
✓
SVP V1
149,523
2.77×2.77\times
2,636
3.67×3.67\times
0.0217
2.79×2.79\times
✓
SVP V2
147,991
2.74×2.74\times
2,139
2.97×2.97\times
0.0213
2.75×2.75\times
✓
SVP V3
154,844
2.87×2.87\times
3,667
5.10×5.10\times
0.0227
2.92×2.92\times
✓
Claude Sonnet 4.6
Base
60,593
1.00×1.00\times
343
1.00×1.00\times
0.1869
1.00×1.00\times
✓
SVP V1
256,792
4.24×4.24\times
1,943
5.66×5.66\times
0.7995
4.28×4.28\times
✓
SVP V2
229,354
3.79×3.79\times
3,634
10.59×10.59\times
0.7426
3.97×3.97\times
✓
SVP V3
310,394
5.12×5.12\times
5,333
15.55×15.55\times
1.0112
5.41×5.41\times
✗*
Table 1. Multi-model token consumption and API cost under SVP in
full-deployment environments.
Note:
Base denotes a normal production-equivalent request issued without SVP;
CHK-7056ad8650e9ced611eda845
i-model token consumption and API cost under SVP in
full-deployment environments.
Note:
Base denotes a normal production-equivalent request issued without SVP;
all remaining rows are measured under SVP at the indicated LL.
All amplification factors are computed by dividing the SVP measurement by
the corresponding model’s Base value. Input tokens are cumulative input
tokens, including cached-input and cache-write tokens where reported. Cost is computed from the reported token counts at published list API rates
July 2026 separately in terms of input and output, so reported costs are therefore upper bounds. Res. denotes whether the query returned
the expected result.
*The Claude L=2L=2k plain-SVP measurement combines the
maximum context-window size with the post-compaction token count minus the baseline post-compaction.
All experiments are conducted in self-owned OpenClaw deployments under accounts
controlled by the authors. Clawdrain is evaluated only against local skills and
author-controlled API credentials; no third-party agent deployment, user account,
or external production service is targeted. We use normal user queries as
the user-facing task and restrict the Trojan skill to token-consuming
verification behavior rather than destructive external actions.
To limit operational impact, experiments are run manually in bounded sessions
with API billing monitored by the authors.
CHK-c0cd525b8947b04a5740e893
ther than destructive external actions.
To limit operational impact, experiments are run manually in bounded sessions
with API billing monitored by the authors. We do not enable autonomous
cron/heartbeat execution during the main evaluation, and we discuss such triggers
only as a deployment risk surface. The implementation used for measurement is
kept in an internal research artifact during submission. Any public release will
remove live billing credentials, include explicit warnings, and provide a
non-billing simulator or replay mode for reproducibility.
Table 2. Cumulative cached and uncached input usage for Base and plain
SVP V3. Values are median tokens in thousands.
Model
Condition
Uncached
Cached
Total (Ampl.)
Gemini
Base
1,251
12,086
13,337 (1.00×1.00\times)
SVP V3
20,474
198,223
218,697 (16.40×16.40\times)
DS Flash
Base
5,076
48,935
54,011 (1.00×1.00\times)
SVP V3
7,719
147,125
154,844 (2.87×2.87\times)
Claude
Base
9,113
51,480
60,593 (1.00×1.00\times)
SVP V3
14,995
295,399
310.4 (5.12×5.12\times)*
Data taken from provider when available. Total follows Table 1;
differences may arise from provider-specific accounting.
*Claude V3 includes pre- and post-compaction usage as
described in Table 1.
4.2. Token Drain Impact
Table 1 summarizes cumulative token
consumption and estimated API cost under plain SVP. Across the three
CHK-3f633cd99c35690e8c2e73b9
usage as
described in Table 1.
4.2. Token Drain Impact
Table 1 summarizes cumulative token
consumption and estimated API cost under plain SVP. Across the three
backends, SVP increases cumulative input consumption by
2.74×2.74\times–16.40×16.40\times relative to each model’s Base measurement.
The Base setting represents a comparable normal agent request rather than a turn-by-turn SVP execution; thus, the ratios measure deployment-level amplification relative to typical agent usage.
Gemini 2.5 Pro exhibits the largest input amplification. Its cumulative
input consumption increases from 13,337 tokens in the Base measurement
to 57,363, 91,556, and 218,697 tokens at L=50L=50, L=1000L=1000, and L=2000L=2000,
respectively. These measurements correspond to input amplification of
4.30×4.30\times, 6.86×6.86\times, and 16.40×16.40\times. All three Gemini runs
return the expected result. Although the execution traces show that
Gemini initially generates parts of the calibration sequence directly
before adopting a scripted strategy, its cumulative output remains
between 567 and 1,273 tokens. Gemini’s amplification is therefore driven
primarily by repeated input-context processing and tool coordination,
rather than by output generation alone.
DeepSeek V4 Flash adopts a scripted strategy early in the execution.
Nevertheless, its cumulative input consumption remains consistently
CHK-21f9ede25272db39d0bc38ef
tput generation alone.
DeepSeek V4 Flash adopts a scripted strategy early in the execution.
Nevertheless, its cumulative input consumption remains consistently
elevated at 149,523, 147,991, and 154,844 tokens across the three values
of LL, corresponding to 2.77×2.77\times, 2.74×2.74\times, and 2.87×2.87\times
amplification over its Base measurement. Its output consumption ranges
from 2,139 to 3,667 tokens, and every tested configuration returns the
expected result. The relatively flat input profile indicates that
scripting reduces sensitivity to sequence length but does not eliminate
the repeated context ingestion and coordination costs imposed by the
multi-turn process.
Claude Sonnet 4.6 exhibits a different cost profile. At L=50L=50 and
L=1000L=1000, it consumes 256,792 and 229,354 cumulative input tokens,
representing 4.24×4.24\times and 3.79×3.79\times input amplification, while
successfully returning the expected result. At L=2000L=2000, cumulative
input consumption reaches 310,394 tokens, or 5.12×5.12\times the Base
measurement, and cumulative output reaches 5,333 tokens, or
15.55×15.55\times the Base output. This trace combines the maximum context
window with tokens processed after context compaction, but it does not
return the expected result. We therefore classify it as a costly
failure rather than a successful completion.
CHK-6cbd9a47c03ecd597de431e7
ocessed after context compaction, but it does not
return the expected result. We therefore classify it as a costly
failure rather than a successful completion.
The non-monotonic measurements for DeepSeek and Claude also show that
LL alone does not determine total consumption. Model-specific choices,
including when to generate sequences directly, when to construct helper
scripts, and how to recover from unsuccessful steps, alter the resulting
execution trajectory. Nevertheless, substantial amplification persists
across all three behavioral profiles. These results demonstrate that
resource exhaustion in deployed agents can arise from cumulative input
re-ingestion, persistent tool history, process coordination, and
recovery behavior even when a model reduces explicit sequence
generation through scripting.
Table 2 shows that Clawdrain’s impact is not
limited to generating long outputs or repeatedly processing entirely new
prompts. SVP amplifies both newly introduced input and the cached context
carried across agent turns, allowing the drain to persist even when providers
optimize repeated prefixes. Caching may reduce the marginal price of reused
tokens, but it does not eliminate cumulative context growth, tool
coordination, or the fresh state introduced by each protocol step. This
reinforces the paper’s central finding that agent resource exhaustion is a
CHK-f33601bf39abf6c1b2964493
growth, tool
coordination, or the fresh state introduced by each protocol step. This
reinforces the paper’s central finding that agent resource exhaustion is a
system-level, multi-turn phenomenon rather than a prompt-only verbosity
effect.
Figure 4. Multi-model context growth and amplification under Clawdrain SVP-Nonce.
Bars show cumulative context consumption in thousands of tokens, while the
red line shows amplification relative to each model’s baseline.
Claude metric is the result of pre and post compaction token count combined
the full context window.
4.3. Increasing the Cost of Static Reuse: SVP+N
Figure 4 reports amplification under SVP+N.
SVP+N prevents exact reuse of a static calibration sequence by introducing
fresh relay state at each stage. It does not, however, prevent a capable
agent from parsing the checkpoint value and adapting a generation script.
Accordingly, we treat SVP+N as a mechanism for increasing the coordination
cost of static reuse, rather than as a robust defense against agent-side
scripting.
At the evaluated L=2000L=2000 operating point, SVP+N produces greater cumulative
input consumption than plain SVP in the recorded traces. This observation is
empirical and specific to the tested configurations; it does not establish a
lower bound on amplification under adaptive planning, caching, or alternative
tool composition.
CHK-10f702aaa53b663c4af27d45
d specific to the tested configurations; it does not establish a
lower bound on amplification under adaptive planning, caching, or alternative
tool composition. DeepSeek illustrates this limitation directly: it parses
the changing checkpoint and updates its script, reducing the nonce mechanism
to additional relay and coordination overhead. SVP+N therefore demonstrates
an escalation in the interaction process, but not closure against adaptive
agents.
4.4. Interface-Dependent Stealth
Prior work considers a resource-amplification attack stealthy when the agent
still returns the correct result (Zhou et al., 2026). In a deployed agent,
however, the path to that result may also be visible. Repeated tool calls,
repairs, and delays can reveal an otherwise correct attack. We therefore
treat stealth as both outcome preserving and interface dependent.
Let τ\tau be an SVP trace and τ0\tau_{0} its matched base trace. For model
calls, relay calls, repairs, and wall time
(k∈{M,T,R,t}k\in\{M,T,R,t\}), define normalized excess as
Δk=[xk(τ)−xk(τ0)]+/max{1,xk(τ0)}\Delta_{k}=[x_{k}(\tau)-x_{k}(\tau_{0})]_{+}/\max\{1,x_{k}(\tau_{0})\}.
We summarize interface-conditioned stealth as
(1)
Stealthi(τ)=𝟏[Correct(τ)]1+∑kwi,kΔk,\mathrm{Stealth}_{i}(\tau)=\frac{\mathbf{1}[\mathrm{Correct}(\tau)]}{1+\sum_{k}w_{i,k}\Delta_{k}},
CHK-c4a037101eec2602a13f5b0b
ioned stealth as
(1)
Stealthi(τ)=𝟏[Correct(τ)]1+∑kwi,kΔk,\mathrm{Stealth}_{i}(\tau)=\frac{\mathbf{1}[\mathrm{Correct}(\tau)]}{1+\sum_{k}w_{i,k}\Delta_{k}},
where wi,k∈[0,1]w_{i,k}\in[0,1] captures how strongly interface ii exposes each
signal. The score is zero for an incorrect result and decreases as excess
activity becomes visible. Token amplification is reported separately because
it measures attack strength rather than visibility.
Table 3. Operational footprint of successful L=2000L=2000 traces. Differences
are measured against the matched base trace; SfullS_{\mathrm{full}} assumes
full exposure (wi,k=1w_{i,k}=1).
Model
Cfg.
Tok. amp.
Δ\DeltaM/T/R
Δ\Deltat
Sfull↑S_{\mathrm{full}}\uparrow
DS Flash
SVP+N
3.14×3.14\times
+6/+2/0+6/+2/0
+23.61+23.61 s
0.181
Gemini
SVP
8.89×8.89\times
+9/+6/0+9/+6/0
+56.04+56.04 s
0.081
Table 3 shows that stronger amplification need
not be quieter. Gemini produced the largest token increase, but also the
largest call and latency footprint. The DeepSeek traces consumed fewer
additional calls and completed sooner. Claude is not included because it cannot complete SVP+N without compacting. For a common reference point, the
table sets all exposure weights to one; higher SfullS_{\mathrm{full}} indicates
less excess activity under full disclosure. These are representative traces,
not a general ranking of model stealth.
CHK-fdb36fc8570706651ac2d369
e; higher SfullS_{\mathrm{full}} indicates
less excess activity under full disclosure. These are representative traces,
not a general ranking of model stealth.
How much of this footprint reaches the user depends on the interface. A chat
client may display repeated tool calls and their arguments, whereas a
narrated terminal can replace them with brief progress messages. A scheduled
run may show nothing at execution time, although its activity remains visible
in logs and usage records. Our headless harness measures this underlying
footprint rather than human detection. The costly-failure trace in
Section 4.2 reinforces the distinction: it consumed substantial
resources but returned no correct result and exposed a recovery warning.
Resource amplification and stealth should therefore be reported separately.
5. Conclusion
In this work, we present Clawdrain, a deployment-grounded study of
third-party skill-layer resource exhaustion in autonomous LLM agents.
Unlike prior simulator-constrained evaluations, our work captures
the operational footprint of Trojanized skills within production-grade
runtimes—revealing how persistent context accumulation, multi-turn tool
coordination, and autonomous recovery behavior combine to induce up to
16×\times resource amplification under real API billing constraints.
Our multi-backend analysis demonstrates that agent resource consumption
CHK-8eded88f246e79759749e9c7
ne to induce up to
16×\times resource amplification under real API billing constraints.
Our multi-backend analysis demonstrates that agent resource consumption
is heavily shaped by backend-specific execution dynamics, yielding outcomes
overlooked by standard success-only metrics, such as costly failures and
stealthy progress narration. While our findings highlight the critical
security boundary imposed by third-party skills, our evaluation is bounded
by the default tool configurations and environment parameters of a single
agent runtime, leaving cross-framework generalizations and formal circuit-breaker
defenses for future investigation. Ultimately, our results underscore the
necessity of cumulative, system-level controls over third-party skill behavior
to safeguard deployed agent ecosystems against economic denial-of-service attacks.
References
Chen et al. (2024)
S. Chen, J. Piet, C. Sitawarin, and D. Wagner
StruQ: defending against prompt injection with structured queries.
arXiv preprint arXiv:2402.06363.
Note: https://arxiv.org/abs/2402.06363
Cited by: §2.1.
Deng et al. (2026)
X. Deng, Y. Zhang, J. Wu, J. Bai, S. Yi, Z. Zou, Y. Xiao, R. Qiu, J. Ma, J. Chen, X. Du, X. Yang, S. Cui, C. Meng, W. Wang, J. Song, K. Xu, and Q. Li
Taming openclaw: security analysis and mitigation of autonomous llm agent threats.
arXiv preprint arXiv:2603.11619.
External Links: Link
Cited by: §2.1.
CHK-688eb60535f8559fddf9c5fa
Q. Li
Taming openclaw: security analysis and mitigation of autonomous llm agent threats.
arXiv preprint arXiv:2603.11619.
External Links: Link
Cited by: §2.1.
Dong et al. (2026)
B. Dong, H. Feng, and Q. Wang
Clawdrain: exploiting tool-calling chains for stealthy token exhaustion in openclaw agents.
arXiv preprint arXiv:2603.00902.
Note: https://arxiv.org/abs/2603.00902
Cited by: §2.1,
§2.2.
Dong et al. (2025)
J. Dong, Z. Zhang, Q. Zhang, T. Zhang, H. Wang, H. Li, Q. Li, C. Zhang, K. Xu, and H. Qiu
An engorgio prompt makes large language model babble on.
Note: https://arxiv.org/abs/2412.19394
External Links: 2412.19394,
Link
Cited by: §2.2.
Greshake et al. (2023)
K. Greshake, S. Abdelnabi, S. Mishra, C. Endres, T. Holz, and M. Fritz
More than you’ve asked for: a comprehensive analysis of novel prompt injection threats to application-integrated large language models.
arXiv preprint arXiv:2302.12173 27.
Note: https://arxiv.org/abs/2302.12173
Cited by: §2.1.
Hou et al. (2026)
X. Hou, Y. Zhao, S. Wang, and H. Wang
Model context protocol (mcp): landscape, security threats, and future research directions.
ACM Trans. Softw. Eng. Methodol..
Note: Just Accepted
External Links: ISSN 1049-331X,
Link,
Document
Cited by: §2.1,
Figure 2.
Kumar et al. (2025)
A. Kumar, J. Roh, A. Naseh, M. Karpinska, M. Iyyer, A. Houmansadr, and E. Bagdasarian
Overthink: slowdown attacks on reasoning llms.
CHK-19854e891cab403d8750d2cf
ure 2.
Kumar et al. (2025)
A. Kumar, J. Roh, A. Naseh, M. Karpinska, M. Iyyer, A. Houmansadr, and E. Bagdasarian
Overthink: slowdown attacks on reasoning llms.
arXiv preprint arXiv:2502.02542.
Note: https://arxiv.org/abs/2502.02542
Cited by: §2.2.
Li and Gao (2026)
X. Li and X. Gao
A First Look at the Security Issues in the Model Context Protocol Ecosystem .
In 2026 56th Annual IEEE International Conference on Dependable Systems and Networks (DSN),
Vol. , Los Alamitos, CA, USA, pp. 379–392.
External Links: ISSN ,
Document,
Link
Cited by: §2.1.
Luo et al. (2026)
J. Luo, J. Dai, F. Liu, S. Peng, Y. Shi, T. Bu, G. Hong, X. Pan, and Y. Zhang
Autonomy comes with costs: detecting denial-of-service vulnerabilities caused by resource abusing in LLM-based agents.
In Proceedings of the 35th USENIX Security Symposium
(USENIX Security ’26),
Cited by: §2.2.
Mou et al. (2026)
Y. Mou, Z. Xue, L. Li, P. Liu, S. Zhang, W. Ye, and J. Shao
ToolSafe: enhancing tool invocation safety of llm-based agents via proactive step-level guardrail and feedback.
arXiv preprint arXiv:2601.10156.
Note: https://arxiv.org/abs/2601.10156
Cited by: §2.1.
OpenClaw Contributors (2026)
OpenClaw Contributors
OpenClaw: your own personal ai assistant.
Note: https://github.com/openclaw/openclawGitHub repository, accessed: 2026-02-27
Cited by: §2.1.
Schick et al. (2023)
T. Schick, J. Dwivedi-Yu, R. Dessì, R. Raileanu, M.
CHK-d2640db21537650be34b09b9
s://github.com/openclaw/openclawGitHub repository, accessed: 2026-02-27
Cited by: §2.1.
Schick et al. (2023)
T. Schick, J. Dwivedi-Yu, R. Dessì, R. Raileanu, M. Lomeli, E. Hambro, L. Zettlemoyer, N. Cancedda, and T. Scialom
Toolformer: language models can teach themselves to use tools.
Advances in neural information processing systems 36, pp. 68539–68551.
Note: https://arxiv.org/abs/2302.04761
Cited by: §2.1.
Si et al. (2025)
W. M. Si, M. Li, M. Backes, and Y. Zhang
Excessive reasoning attack on reasoning llms.
Note: https://arxiv.org/abs/2506.14374
External Links: 2506.14374,
Link
Cited by: §2.2.
Sun et al. (2025)
L. Sun, Y. Yang, Q. Duan, Y. Shi, C. Lyu, Y. Chang, C. Lin, and Y. Shen
Multi-agent coordination across diverse applications: a survey.
arXiv preprint arXiv:2502.14743.
Note: https://arxiv.org/abs/2502.14743
Cited by: §1.
Tang et al. (2025)
Z. Tang, Z. Chen, J. Yang, J. Mai, Y. Zheng, K. Wang, J. Chen, and L. Lin
AlphaAgent: llm-driven alpha mining with regularized exploration to counteract alpha decay.
In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2,
pp. 2813–2822.
Note: https://arxiv.org/abs/2502.16789
Cited by: §1.
Tran et al. (2025)
K. Tran, D. Dao, M. Nguyen, Q. Pham, B. O’Sullivan, and H. D. Nguyen
Multi-agent collaboration mechanisms: a survey of llms.
Note: https://arxiv.org/abs/2501.06322
CHK-8e913b66768520dbf9d6bed7
ran, D. Dao, M. Nguyen, Q. Pham, B. O’Sullivan, and H. D. Nguyen
Multi-agent collaboration mechanisms: a survey of llms.
Note: https://arxiv.org/abs/2501.06322
External Links: 2501.06322,
Link
Cited by: §1.
Wallace et al. (2024)
E. Wallace, K. Xiao, R. Leike, L. Weng, J. Heidecke, and A. Beutel
The instruction hierarchy: training llms to prioritize privileged instructions.
arXiv preprint arXiv:2404.13208.
Note: https://arxiv.org/abs/2404.13208
Cited by: §2.1.
Wang et al. (2025)
H. Wang, C. M. Poskitt, and J. Sun
AgentSpec: customizable runtime enforcement for safe and reliable llm agents.
arXiv preprint arXiv:2503.18666.
Note: https://arxiv.org/abs/2503.18666
Cited by: §2.1.
Wang et al. (2024)
L. Wang, C. Ma, X. Feng, Z. Zhang, H. Yang, J. Zhang, Z. Chen, J. Tang, X. Chen, Y. Lin, et al.
A survey on large language model based autonomous agents.
Frontiers of Computer Science 18 (6), pp. 186345.
Note: https://doi.org/10.1007/s11704-024-40231-1
Cited by: §2.1.
Yao et al. (2022)
S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. R. Narasimhan, and Y. Cao
React: synergizing reasoning and acting in language models.
In The eleventh international conference on learning representations,
Cited by: §2.1.
Zhan et al. (2024)
Q. Zhan, Z. Liang, Z. Ying, and D. Kang
InjecAgent: benchmarking indirect prompt injections in tool-integrated large language model agents.
CHK-2d242b6c972359648b48e062
Zhan et al. (2024)
Q. Zhan, Z. Liang, Z. Ying, and D. Kang
InjecAgent: benchmarking indirect prompt injections in tool-integrated large language model agents.
In Findings of the Association for Computational Linguistics: ACL 2024, L. Ku, A. Martins, and V. Srikumar (Eds.),
Bangkok, Thailand, pp. 10471–10506.
External Links: Link,
Document
Cited by: §2.1.
Zhang et al. (2025a)
B. Zhang, Y. Tan, Y. Shen, A. Salem, M. Backes, S. Zannettou, and Y. Zhang
Breaking agents: compromising autonomous llm agents through malfunction amplification.
In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing,
pp. 34952–34964.
Note: https://arxiv.org/abs/2407.20859
Cited by: §2.2.
Zhang et al. (2025b)
Y. Zhang, Z. Zhou, W. Zhang, X. Wang, X. Jia, Y. Liu, and S. Su
Crabs: consuming resource via auto-generation for llm-dos attack under black-box settings.
In Findings of the Association for Computational Linguistics: ACL 2025,
pp. 11128–11150.
Note: https://aclanthology.org/2025.findings-acl.580/
Cited by: §2.2.
Zhou et al. (2026)
K. Zhou, Y. Zheng, Y. He, M. Xue, X. Gong, Y. Wang, and K. Lam
Beyond max tokens: stealthy resource amplification via tool calling chains in llm agents.
arXiv preprint arXiv:2601.10955.
Note: https://arxiv.org/abs/2601.10955
Cited by: §1,
§2.1,
§2.2,
§3.2,
§3.3,
§4.4.
补充资料