Nobody hacked you, but your AI bill exploded: put limits on your app

Unbounded consumption (LLM10:2025 in OWASP's list) happens when your app lets anyone send requests to the model with no limit. The fix: a cap on input size, a cap on requests per user, and a timeout for each request.

Published 2 min read#AI#App security

Nobody hacked your server, stole a password or touched the database. But your AI provider's bill at the end of the month came out several times the usual, and the chatbot was slow for days. This article shows you how that happens, and which limits to put in place so it doesn't happen to you.

What is the unbounded consumption risk?

Unbounded consumption is when an app built on a language model lets users send excessive, uncontrolled requests. The result can be a service outage, lost money, or a stolen model.

The OWASP page on LLM10:2025 Unbounded Consumption puts it in the list of risks for LLM applications, and ties it to uncontrolled requests that nobody limits.

How does someone exploit it?

An attacker exploits it by finding an endpoint that calls the model with no limit, and sending it many or very long requests. OWASP names examples, including:

  1. Variable-Length Input Flood, meaning very long texts that eat processing resources.

  2. Denial of Wallet, meaning many requests aimed at the cost of each call.

  3. Model Extraction via API, meaning chosen queries to collect enough answers to build a similar copy.

Why is the mistake easy to make?

The mistake is easy because the chat endpoint works fine in testing: you send two questions and get an answer back. Nothing tells you that someone else can send a thousand questions a minute on your account.

In a normal app, an extra request costs a little electricity. In an app built on a model, every request has a price at the provider, so a limit on requests is also protection for your money. That's why counting tokens before you send, as we covered in the article on token counting with Claude, gives you an idea of what each request costs.

Which limits do you add today?

The basic limits are three: a cap on input size, a cap on requests per user, and a timeout for each heavy operation. OWASP adds monitoring to them, and showing less about the model in API responses.

  1. Reject any input larger than a reasonable limit before it reaches the model.

  2. Set a fixed number of requests per user or address over a time window, as you do with login attempts.

  3. Set timeouts for heavy operations and throttle them under load, so they don't hold resources for long.

  4. Restrict or hide logit_bias and logprobs in API responses, as OWASP advises.

  5. Log resource usage, and alert on any odd pattern, like one user suddenly using several times the usual.

And when the agent has tools too, the limits apply to them, as in the article on an AI agent's permissions.

Where do you start now?

The lesson for us as developers: in an LLM app every request costs money, so a limit on requests is protection like a lock on the door. Open the endpoint that calls the model in your app today, and check that it has a cap on input size and a cap on requests.

If you want someone to try these attacks on your app before anyone else does, there is Muhassan. What happens to your bill if someone sends requests to your chat endpoint nonstop for a whole night?

FAQ

What does Denial of Wallet mean?

It's OWASP's name for an attack that targets the bill, not the server: the attacker sends many requests so the app owner pays for every call to the model.

If only signed-in users can use the app, am I safe?

Better, but not enough. One account can still send unlimited requests, so you need a quota per user too, not just a login.

How is model theft related to this risk?

OWASP puts model extraction through the API under the same risk: someone sends many chosen queries to collect answers and build a similar copy. The same limits make that harder.

Share

More articles