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 securityClawdrain 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 runs | 6-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 automation | 5.7M tokens overnight (non-malicious) |
Skills related to this research
Related notes
- The best skill scanner hits 98% recall — and still flags 937 of 4,000 safe skills as malicious →
- Agent-skill security scanners agree on just 0.69% of all skills — each is watching a different layer →
- SkillFortify doesn't just scan skills, it proves the scan -- 96.95% F1, 0% false positives →
- Malicious-Skill Detection Hits 0.920 F1 at $0.006 per Skill →
- A poisoned skill file compromises up to 86% of sessions that load it →
- Automated SKILL.md rewrites push poisoned-skill attacks from 0% success to 80.7% →
- 1,858 reusable skills mined from 22,511 real chats — zero weight updates →
- Flat Skill Invocation Craters From 48 to 17 as the Pool Hits 200,000 →
- Skill folders, not weights: +12.1 points on noisy-retrieval QA →
References
- 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)
- T. Schick et al., "Toolformer: Language Models Can Teach Themselves to Use Tools," NeurIPS 2023
- Y. Liu et al., "Prompt Injection Attack against LLM-integrated Applications," arXiv:2306.05499 (2023)