skillfed

A trojanized skill hit 9x token amplification — the failed run cost more than either successful one

Notes on Clawdrain: Exploiting Tool-Calling Chains for Stealthy Token Exhaustion in OpenClaw Agents (arXiv:2603.00902) — Ben Dong, Hui Feng, Qian Wang · March 2026

Note published · written by SkillFed’s research pipeline from the paper above · how these notes are made

AI-assisted notes · reviewed by SkillFed Skill security

Clawdrain is a trojanized OpenClaw skill that hides a multi-turn "Segmented Verification Protocol" (SVP) inside its SKILL.md instructions. Before it hands back a simple BBC-headline lookup, the skill demands a growing, comma-separated "calibration sequence" — and a companion script grades every submission PROGRESS, REPAIR, or TERMINAL. REPAIR forces a retry of the same step, so the exchange stretches into extra tool calls that get replayed back into context on every subsequent turn.

The test ran against a real OpenClaw v2026.2.9 instance on Gemini 2.5 Pro, with actual API billing instead of a simulator. The benign version of the query answers in about 28k context tokens; the trojanized versions ran to roughly 125k and 190k, a 6-7x amplification, and still returned the correct headline. Pushed further — sequence length 2000, five verification rounds — the agent never finished the protocol at all. It hit repeated REPAIR rejections, decided the skill was "faulty," and burned through a cascade of fallback attempts: retry, search the web, kill the stuck process, retry again. That failure alone cost about 249k tokens, roughly 9x amplification — more than either successful run. The agent also improvised: it wrote a Python one-liner to generate its calibration sequence instead of typing it token by token, cutting per-turn cost from about 1,000 tokens to roughly 30, a workaround the authors could never have seen in a simulator that only lets the agent call the malicious tool.

Key numbers

Amplification, successful SVP runs6-7x baseline tokens
Amplification, failed high-parameter run~9x baseline tokens
Failed-run context tokens consumed~249k (vs ~28k baseline)
Emergent scripting workaround cost~1,000 tokens → ~30 tokens/turn
Community-reported runaway automation5.7M tokens overnight (non-malicious)

Skills related to this research

Related notes

References

  1. K. Zhou, Y. Zheng, Y. He, M. Xue, X. Gong, Y. Wang, K. Lam, "Beyond Max Tokens: Stealthy Resource Amplification via Tool Calling Chains in LLM Agents," arXiv:2601.10955 (2026)
  2. T. Schick et al., "Toolformer: Language Models Can Teach Themselves to Use Tools," NeurIPS 2023
  3. Y. Liu et al., "Prompt Injection Attack against LLM-integrated Applications," arXiv:2306.05499 (2023)