Skip to content

Persistent Billable State: Denial-of-Wallet Attacks and Defenses in Tool-Calling LLM Agents

Jinqian Zhang, Haojun Xia, Shujiang Wu, Jingkun Yue, Xia Zhang, Zhangpei Cheng, Bibo Tu

cs.CR

Abstract

Multi-step tool-calling LLM agents rely on host runtimes to preserve state across turns. When a runtime carries an external tool return into later model inputs, providers meter it again. An adversary who controls the return of an already configured tool can thereby convert that return into recurring victim-billed processing without victim credentials or local runtime privilege. We call such retained content persistent billable state and formalize the host's decision over whether and how it enters later billable context as the persistent billable-state boundary. We present the first systematic security study of this post-admission lifecycle. We derive 6 denial-of-wallet attack vectors and build DoW-Bench, an end-to-end harness evaluated across 6 model families. Across 243 executions, the maximum per-session cumulative input reaches 14,293x the corresponding session's complete first-call input. Retaining raw history increases mean effective session cost by 21.2-35.9%. Compression succeeds on 10/12 and 11/12 history-dependent tasks, versus 2/12 under deletion for each provider. To govern this boundary, we combine deterministic history transformation with 4 host-side invariants that bound prompt mass, context growth, recursive opportunity, and cumulative spend before reingestion. The host-side kernel stops all 41 retained attack traces under each of 3 replay presets. Separate live integrations exercise enforcement before subsequent model calls. A full-code audit of 95 randomly sampled public MCP server and transport repositories finds an author-verified, code-visible safeguard in only 17 (17.9%); 1 bounds cost, and none combines all 4 safeguard families. These results establish persistent billable state as a first-class security object and pre-reingestion as its host-owned control point. Confirmed disclosure also assigns that placement to the host application.

Create a lesson

Metadata

Categories
cs.CR, cs.AI
Comments
19 pages, 9 figures