# What Is Unbounded Consumption?

> What unbounded consumption is, why one user can run up a huge model bill, and how to cap cost in code, explained simply for your AI interview.

**In short:** Unbounded consumption is when an AI app allows excessive, uncontrolled model use, so one user, a bug or an attacker can run up a huge bill or slow the service for everyone. The cost side is called denial of wallet, and the fix is hard limits on tokens, spend and agent steps, enforced in code or by the provider.

AI and LLM interview question Q217, Guardrails and AI safety. Intermediate, common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/what-is-unbounded-consumption-denial-of-wallet

## Say it in 30 seconds

Unbounded consumption is when an AI app lets one user, a bug or an attacker trigger so much model use that the bill explodes or the service slows for everyone. People call the cost side denial of wallet. Every request costs real money, and a small prompt can start a long chain of work. OWASP ranks it sixth in its 2026 list. I'd stop it with hard token and spend caps, per-user quotas and agent step limits, enforced in code or by the provider. A request rate limit helps, but it is not enough alone.

## Say it in 2 minutes

A language model is paid for by use. Each request costs money, and the cost grows with the size of the prompt and the length of the answer. Unbounded consumption happens when an AI app lets requests run with no real limit on that cost. OWASP describes it as an app that allows excessive and uncontrolled inferences, where an inference is one run of the model on a prompt.

The danger is cost asymmetry. The attacker pays almost nothing, while the owner pays for every token. A short prompt can keep a reasoning model busy, a model that works through hidden steps before it answers. An agent can turn one message into a long chain of tool calls, and the owner pays for each step. Denial of wallet is the name for this: attackers use pay-per-use pricing to drain the owner's budget.

A request rate limit is a start, but it misses large requests, and a few huge requests can cost more than thousands of small ones. So I would set hard caps on tokens per hour and spend per month, enforced in code or by the provider. I would add per-user quotas, and give every agent run a step and time limit. Alerts tell you about a problem. A cap stops it.

I would also log cost per user and check it each day, so a leaked key shows up in the report. In an interview, name the cap, say where it is enforced, and say what the user sees when it trips.

## What is unbounded consumption, in plain words?

A model is paid for by use. Every request costs money, and the cost grows with the size of the prompt and the length of the answer. Unbounded consumption is when an AI app lets requests run with no real limit on that cost. OWASP describes it as an app that allows excessive and uncontrolled inferences, where an inference is one run of the model on a prompt.

Picture a hospital's supplies team that orders from a supplier billing per item, with no order limit. One broken reorder script sends ten thousand gauze packs before lunch, and the invoice is the first anyone hears of it. A support chatbot that re-reads a 100-page policy manual on every customer message has the same weak spot, and nobody sees the cost until the invoice arrives.

The attack on the money has a name: denial of wallet. The aim is to drain the budget. The service may even keep working while the money runs out.

- **Inference:** One run of the model on a prompt. You pay for each one.
- **Token:** A small piece of text the model reads or writes. Bills count tokens.
- **Denial of wallet:** An attack that runs up the bill until the owner stops it.
- **Quota:** An allowance for one user, one key or one team.
- **Circuit breaker:** A switch that stops a run once it goes past a set limit.

## How does a small prompt become a big bill?

The core idea is cost asymmetry. OWASP says attackers can "trigger disproportionately expensive computation at negligible cost to themselves". The attacker pays little, and the owner pays for every token.

> "By initiating a high volume of operations, attackers exploit the cost-per-use model of cloud-based AI services, leading to unsustainable financial burdens on the provider and risking financial ruin." (OWASP, LLM06:2026)

Three routes are common. First, floods of big inputs, such as long documents sent again and again. Second, long thinking: a short prompt can keep a reasoning model busy. That is a model that works through hidden steps before it answers, and input checks miss it because the prompt looks harmless. Third, agents that call tools in a loop, so one message turns into hundreds of calls.

*Diagram, How one small prompt keeps the meter running: A small prompt reaches an agent. The agent calls a tool, the result goes back, and the loop repeats. Each turn is billed, and nothing in the loop caps how many turns run.*
1. The small prompt reaches the agent.
2. The agent asks for a tool, such as a search.
3. The result goes back, and the agent asks for the next step.
4. Each tool result leads to another model turn, and every turn is billed.

A worked example: a call centre runs an AI helper that drafts replies for 400 agents. Every call goes through the call centre's own gateway, and each app has its own gateway key. Its prompts include a 100,000-token policy manual. One leaked gateway key sends a request every 20 seconds, far below a usual requests-per-minute limit. Over an hour that is 180 requests, about 18 million tokens, from one key. Anthropic also limits input tokens per minute, and this key sends 300,000 a minute, so a real tier may throttle it before the gateway cap does.

With a cap of 5 million tokens an hour per gateway key, the 51st request is refused about 17 minutes in, after the key has used 5 million tokens. A leaked provider key skips the gateway, so the provider's monthly spend limit is the backstop for that case. The team revokes the key and sees the spike in its cost report.

## Why isn't a request rate limit enough?

- **Request rate limit: Counts requests.** Lets through a set number of requests each second, whatever each one costs. A few huge requests pass as easily as many small ones.
- **Token and spend caps: Counts cost.** Stops calls once the hour's tokens or the month's spend reach the limit. The check runs in code before the call.

> "Traditional request-rate limiting alone is no longer sufficient." (OWASP, LLM06:2026)
>
> "These must be enforcement mechanisms that halt inference when exceeded, rather than alerting thresholds that fast-accumulating workloads can outpace." (OWASP, LLM06:2026)

OWASP's 2026 entry asks for limits on tokens per minute, tokens per day and estimated cost per request, not only requests per second. A cap that only sends an alert leaves the bill running while the alert is read.

## What stops the bill, and in what order?

Layers work best. Each one stops a different kind of run, and together they keep the cost inside a set amount. The checks run in code or at the provider, before any model call, so a clever prompt cannot change them.

*Diagram, Checks in code before the model is called: Two checks in code run before each model call, and a step limit stops a run that loops. Any check can refuse a call, and a refused call never reaches the model.*
1. The request enters the first check, the hourly token cap.
2. A call under the cap moves on to the user's quota.
3. Then the step count for the run is checked.
4. Only calls that pass every check reach the model.

1. **Cap tokens in code:** Estimate the tokens before each call and refuse anything over the limit. OWASP: "Use pre-flight token estimation to reject requests before inference begins."
2. **Set a hard spend cap:** Set a monthly limit that the provider enforces. Anthropic's documentation says: "When usage reaches a spend limit you set, requests return HTTP 400 with error type invalid_request_error."
3. **Give each user a quota:** One account should not use the whole team's budget. OWASP: "Set non-overridable budget ceilings per API key, user, team, and cloud account."
4. **Limit agent runs:** Every agent run gets a step limit, a depth limit and a time limit. OWASP: "Enforce step limits, recursion depth limits, time limits, and per-run cost ceilings on all agent executions." That is a circuit breaker: a hard stop on each run.
5. **Watch cost per user:** Log tokens and cost per user, and check for spikes. Alerts warn. Caps stop.

Here is the call centre's guard in plain Python. The limits and the key are made up, and the code only counts tokens. It does not call a model.

```python
# The call centre's gateway counts tokens as well as requests.
HOUR_TOKEN_CAP = 5_000_000   # hard cap for one gateway key, per hour (made-up)
MAX_REQUESTS_PER_SECOND = 5  # a usual request-rate limit (made-up)

def guard(used_tokens, new_tokens, requests_per_second):
    if requests_per_second > MAX_REQUESTS_PER_SECOND:
        return "STOPPED: too many requests a second"
    if used_tokens + new_tokens > HOUR_TOKEN_CAP:
        return "STOPPED: hourly token cap reached"
    return "OK"

used = 0
# A leaked gateway key sends one 100,000-token document every 20 seconds.
for request in range(1, 61):
    verdict = guard(used, 100_000, 1 / 20)
    if verdict != "OK":
        print("Request", request, verdict)
        break
    used += 100_000
print("Tokens used this hour:", used)
```

Output:

```text
Request 51 STOPPED: hourly token cap reached
Tokens used this hour: 5000000
```

> **Tip:** Asked how to stop a runaway bill? Name the cap, say it is enforced in code or by the provider, and say what the user sees when it trips.

### How would you set a budget for a new AI feature?

Say a company wants a document chatbot for 2,000 staff, billed per token. I'd start with the expected tokens per person per day, then set a per-user daily cap in code, a monthly spend cap in the provider's console, and a step limit for any agent that searches. After two weeks of real use, I'd check the numbers and tighten the caps.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: anyone who can trigger model use can run up the cost or slow the service.
- [ ] Denial of wallet, and why a small prompt can cost a lot.
- [ ] Why a request rate limit alone falls short: size counts as well as the number of calls.
- [ ] Hard caps in code that stop calls, not only alerts.
- [ ] Agent loops: step, depth and time limits so a run is forced to stop.
- [ ] Where it sits in OWASP: LLM06 in the 2026 list, LLM10 in 2025.

**Common traps**

- Trap: "Rate limiting handles it." Better: It is a request-count limit, so it misses cost. Add token and spend caps as well.
- Trap: "A billing alert will stop the spend." Better: An alert tells you. A cap that code or the provider enforces stops the spend.
- Trap: "Only attackers cause this." Better: A retry loop or an agent with no step limit can burn the budget on its own.

## Can you spot the cost risk?

**Spot the cost risk:** Which setup has no real limit on what a run can cost?

A. A monthly spend cap set in the provider's console, enforced by the provider.
B. An agent that retries a failed tool call until it works, with no step or time limit.
C. A step limit that stops any agent run after 20 tool calls.
D. A per-user quota, so one account cannot use the whole team's allowance.

**Answer:** B. The retry loop has no ceiling, so one bad run can keep calling the model and the tools until the bill is huge. The other three each set a ceiling: a monthly provider spend cap, a step limit and a per-user quota.

**Quick check:** One leaked gateway key is draining the budget. Which limit caps how much damage that key can do?

A. A longer system prompt
B. A hard hourly token cap per key, enforced by the gateway
C. A billing alert that emails the team at $500 a day
D. A shorter system prompt

**Answer:** B. A cap per key refuses that key's calls once the hour's limit is reached, whatever the prompt says. Prompt length and model size change what each call costs, but neither stops a key. Temperature only changes how random the output is.

## Can you answer these from memory?

**Flash cards**

- **What is unbounded consumption?** Uncontrolled model use that drives up the cost or slows the service.
- **What is denial of wallet?** The cost attack: it exploits pay-per-use pricing and can cause financial ruin.
- **Where does OWASP rank it?** LLM06 in the 2026 list, and LLM10 in the 2025 list.
- **Why is a rate limit not enough?** It counts requests, so it misses size. A few huge requests can cost more than many small ones.
- **What is a hard spending cap?** A limit that halts calls when reached. An alert only warns.
- **What do agents need?** Step, depth and time limits, so a loop is forced to stop.

## Likely follow-up questions

- Q206 Name the OWASP LLM Top 10 (2026). https://designervenkat.online/interview/ai/name-the-owasp-llm-top-10-2026
- Q207 What changed from the 2025 list to the 2026 list? (full answer coming)
- Q208 What is the OWASP Agentic Top 10? https://designervenkat.online/interview/ai/what-is-the-owasp-agentic-top-10
- Q330 How do you handle rate limits and 429 errors? (full answer coming)
- Q187 How do you control agent cost? https://designervenkat.online/interview/ai/how-do-you-control-agent-cost
