Join our Newsletter — 33% off our NHI Course
Home› Guides› OWASP LLM Top 10 LLM10 Unbounded Consumption Guide:…
Guide LLM & GenAI Security

OWASP LLM Top 10 LLM10 Unbounded Consumption Guide: Limiting Cost, Abuse and Model Extraction

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 26 October 2026 15 min read
On this page

Every call to a large language model costs compute and money, and an application that lets anyone make unlimited calls of unlimited size has handed its budget, its availability and its model behaviour to whoever finds the endpoint. LLM10:2025 Unbounded Consumption is the OWASP Top 10 for LLM Applications entry for this problem. OWASP describes it as expanding on what was previously Denial of Service, and it now covers three harms that share one root cause: denial of service, denial of wallet, and model extraction or replication through the inference API. This guide turns the OWASP text into enforceable limits, explains why the credential that calls the model is part of the control, and shows how to test and evidence it. It is written for AI platform engineers, API and application security teams, FinOps owners and assessors.

Key takeaways

  • Cost is an attack surface. OWASP names Denial of Wallet as a distinct example: under pay-per-use pricing, an attacker does not need to break anything to cause harm, only to keep the meter running.
  • Limit in tokens, not just requests. One request can carry a full context window and ask for thousands of output tokens, so request counts alone say little about load or spend.
  • Every limit needs an identity to hang on. Quotas only work when each caller (user, tenant, service or agent) authenticates with its own credential; a shared provider key turns every limit into one shared bucket.
  • Extraction looks like heavy legitimate use. Model replication and side-channel attacks run through the normal API, so exposure of logprobs and logit bias, plus query pattern monitoring, matter as much as rate limits.
  • Spend and usage telemetry are security signals. In the Sourcegraph and LLMjacking cases, a spike in API usage or cost was the first visible sign of abuse.

What it is and who it applies to

OWASP defines the risk as occurring when an LLM application "allows users to conduct excessive and uncontrolled inferences", leading to denial of service, economic losses, model theft and service degradation. The underlying weakness is the classic MITRE CWE-400 Uncontrolled Resource Consumption, made sharper by two properties of LLMs: inference is expensive and its cost scales with input and output length, and the model's outputs are themselves valuable enough to steal.

It applies to any system that exposes inference to someone you do not fully control: public chatbots, customer-facing copilots, internal assistants reachable by every employee, partner APIs that wrap a model, agents that loop on tool calls, and self-hosted models where the cost is GPU time rather than an invoice. It also applies to the credentials that pay for inference. A stolen provider key is unbounded consumption by someone outside your application entirely, which is why this guide is read alongside the LLMjacking Guide.

LLM10 is the LLM-specific form of API4:2023 Unrestricted Resource Consumption, and OWASP lists that entry among its related frameworks. Everything in the OWASP API Top 10 API4 Unrestricted Resource Consumption Guide (execution timeouts, payload size, spending limits on third-party services) applies to the API in front of the model; LLM10 adds tokens, context windows and model extraction. For where it sits in the full list, see the OWASP Top 10 for LLM Applications Guide.

Structure and key requirements

OWASP gives seven common examples of the vulnerability. They fall into three harm groups, and each group needs a different primary control.

OWASP exampleHarm groupWhat the attacker exploitsPrimary control
Variable-length input floodAvailabilityMany inputs of different lengths that exploit processing inefficienciesInput size limits, per-caller rate limits, queue caps
Denial of Wallet (DoW)CostThe cost-per-use model of hosted AI servicesToken quotas per identity, budget caps, hard spend limits
Continuous input overflowAvailabilityInputs that keep exceeding the context windowReject or truncate oversize input before it reaches the model
Resource-intensive queriesAvailability and costPrompts that drive long or complex generationOutput token caps, timeouts, throttling of expensive operations
Model extraction via APIIntellectual propertyCrafted queries, sometimes with prompt injection, to build a shadow modelLimit logits and logprobs exposure, extraction-pattern monitoring
Functional model replicationIntellectual propertyUsing outputs as synthetic training data to fine-tune another modelVolume limits per identity, watermarking, terms enforcement
Side-channel attacksIntellectual propertyInput filtering behaviour, to harvest weights and architecture informationSandbox the LLM's network access, restrict response detail

OWASP lists 15 prevention and mitigation strategies. In practice they form five layers:

  • Admission: input validation against size limits; access controls with RBAC and least privilege.
  • Metering: rate limiting and user quotas per source entity; limits on queued and total actions.
  • Execution: timeouts and throttling for resource-intensive operations; dynamic resource allocation so no single user or request monopolises capacity; graceful degradation under load.
  • Response: restricting or obfuscating logit_bias and logprobs; glitch token filtering; watermarking outputs; sandboxing the model's access to networks and internal services.
  • Governance: comprehensive logging, monitoring and anomaly detection; a centralised ML model inventory; automated MLOps deployment with approval workflows; adversarial robustness training.

Model extraction is not theoretical. Carlini and colleagues (arXiv 2403.06634, "Stealing Part of a Production Language Model") recovered the full embedding projection layer of OpenAI's Ada and Babbage models for under 20 US dollars in queries, recovered the hidden dimension of gpt-3.5-turbo, and estimated under 2,000 US dollars to recover its full projection matrix. That attack used ordinary API access, which is why OWASP puts response detail and query volume in the same risk as cost.

Limits that actually bound consumption

Major providers meter in several dimensions at once, and an application should mirror them at its own boundary so it fails safely before the provider does.

LimitWhat it boundsProvider behaviour to knowWhere to set it in your stack
Requests per minute (RPM)Call rateAzure OpenAI evaluates RPM over short windows of 1 or 10 seconds, so bursts are throttled even under the per-minute totalGateway, per identity and per tenant
Tokens per minute (TPM) and per day (TPD)Compute and spendOpenAI and Azure OpenAI count the larger of max_tokens and the estimated tokens from request size, not the billed tokensGateway, per identity; set max_tokens close to the real need
Input sizeContext abuseOversize prompts consume quota and memory even when rejected laterApplication, before tokenisation where possible
Output sizeGeneration costOutput tokens usually cost more than input tokensRequest parameter, enforced server-side
Concurrency and queue depthCapacityQueued work still holds memory and connectionsWorker pool, queue
Agent loop budgetRecursive tool callsEach step of an agent loop is a new inferenceAgent runtime: maximum steps, total tokens per task
Spend limitMoneyOpenAI distinguishes spend alerts (notify only) from hard spend limits (requests return HTTP 429)Provider account and cloud budget

Provider response headers such as x-ratelimit-remaining-tokens, x-ratelimit-reset-requests and, on Azure OpenAI, retry-after-ms let the gateway back off cleanly. Microsoft notes that unsuccessful requests still count toward the per-minute limit, so clients that retry without backoff make throttling worse. For the API-layer mechanics (token bucket, sliding window, 429 handling), see the Rate Limiting and API Abuse Guide.

Identity and NHI requirements

A rate limit is only as fine-grained as the identity it is keyed on. Most real LLM10 failures trace back to identity design rather than missing throttles.

  • One credential per consumer: each application, tenant, service account and agent should authenticate to your AI gateway with its own identity, and only the gateway should hold the provider key. Quotas, budgets and kill switches then apply per consumer. See the AI Gateway and LLM Gateway Guide.
  • Provider keys are spending authority: a model provider key is a non-human credential that can spend money without limit unless the account caps it. Keep it in a vault, scope it to one project, and rotate it. LLMjacking research reported by Sysdig estimated potential costs to victims of over 46,000 US dollars per day in May 2024, rising to over 100,000 US dollars per day in September 2024 for higher-tier models; see the LLMjacking 2024 to 2026 breach page.
  • Admin and quota-setting rights are privileged: in the Sourcegraph incident of August 2023, a site-admin access token committed to code on 14 July was used on 30 August to elevate an attacker account, which then raised API rate limits for selected users and fed a proxy app that gave others access to Sourcegraph's APIs and the underlying LLM. The control that bounds consumption was itself reachable through a leaked NHI.
  • Prefer federated workload identity: on cloud platforms, call hosted models with roles or workload identity federation instead of static keys, so there is no long-lived secret to scrape. See the OWASP NHI Top 10 NHI7 Long-Lived Secrets Guide.
  • Agents need budgets as well as permissions: an agent identity should carry a step limit and a token budget per task, enforced by the runtime, not by instructions in the prompt. See the Denial-of-Wallet and AI Agent Cost Runaway Guide.
  • Never ship provider keys in clients: a key in a mobile app or browser bundle is public, and anyone holding it bypasses every limit your backend enforces. The Microsoft Azure OpenAI Abuse 2025 case involved customer credentials scraped from public sources and resold as a service.

Implementation steps

  1. Inventory inference paths. List every model endpoint, provider account, project and key, and every application, agent and user group that calls them. OWASP's centralised model inventory recommendation starts here.
  2. Put a gateway in front. Route all inference through one control point that authenticates callers with their own identities, holds provider credentials, and records identity, model, input tokens and output tokens per request.
  3. Set baselines in monitor mode. Run for two to four weeks logging consumption per identity, per tenant and per feature. Use the 95th and 99th percentile of real usage to size limits rather than guessing.
  4. Enforce admission limits. Reject inputs over a defined character or token size, cap max_tokens per route, and set request timeouts. Start with the most expensive routes and models.
  5. Enforce per-identity quotas. Apply RPM and TPM per identity and per tenant, daily token budgets, and concurrency caps. Return HTTP 429 with a Retry-After header so well-behaved clients back off.
  6. Cap spend at the account level. Configure provider hard limits and cloud budgets with alerts at staged thresholds (for example 50, 80 and 100 percent), and decide in advance who can raise them.
  7. Reduce response detail. Disable or restrict logprobs, top_logprobs and logit_bias for callers who do not need them, especially external ones.
  8. Bound agents. Set maximum steps, maximum tool calls and maximum tokens per task in the agent runtime, plus a global kill switch per agent identity.
  9. Design degradation. Define what happens under load: smaller model fallback, cached answers, queueing with a ceiling, or a clear "try later" message.
  10. Turn on logging and detection. Enable provider-side invocation logs (for example, Amazon Bedrock model invocation logging is disabled by default) and alert on the signals in the next section.

Rollback: deploy limits behind feature flags per route and per tenant, start with soft limits that log and alert, and keep a documented override for incidents. If a limit blocks legitimate traffic, raise that identity's quota rather than removing the control for everyone.

Choosing where to enforce

OptionStrengthsWeaknessesBest fit
Provider limits onlyNo build effort; hard spend limits stop the billShared across all your callers; one abuser exhausts everyone's quotaPrototypes, single internal app
Application codeKnows the user and feature contextDuplicated across apps, easy to miss on new routesSmall organisations with one product
AI or API gatewayOne policy point, per-identity quotas, central logs, holds provider keysAnother component to run and secureAny organisation with several apps, tenants or agents
Self-hosted serving layerControls GPU scheduling, batch size and memory directlyNeeds specialist tuning; no provider spend capSelf-hosted models; see the Self-Hosted LLM Security Guide

Small teams can start with provider hard limits plus input and output caps in code. Larger organisations, and anyone exposing models to customers or running agents, need the gateway layer because per-identity metering is impossible without it.

Evidence and assessment

What to log and monitor

  • Per-request record: caller identity, tenant, model, input tokens, output tokens, latency, status (including 429s) and route. The Bedrock invocation log, for example, records the calling role ARN and input and output token counts.
  • Cost anomalies: daily spend per identity against its baseline; first use of a new model or region by an identity.
  • Abuse signals: sustained near-limit usage, many identities from one source, repeated maximum-length inputs, high 429 rates from one client.
  • Extraction signals: systematic, low-diversity queries at high volume, heavy use of logprob or logit parameters, and outputs harvested in bulk by a single API identity.
  • Control changes: quota raises, spend limit changes, new keys and disabled logging, all treated as privileged events.

Metrics

  • Coverage: percentage of inference traffic passing through the gateway with a per-identity quota (target 100 percent).
  • Shared credential count: number of provider keys used by more than one application or held outside the vault (target zero).
  • Cost per identity variance: number of identities exceeding 3 times their 30-day baseline per week, and mean time to triage.
  • Time to contain: minutes from cost or usage alert to key revocation or quota cut.
  • Load test result: service availability for legitimate users while an abusive identity is at its limit.

How to test

Assessors should run, in a non-production environment with its own budget: an oversize input test; a burst test from one identity; a multi-identity test from one tenant; an agent loop that never terminates; and a request for logprobs from an external client. The pass condition in each case is that the limit triggers, the event is logged with the right identity, and other users are unaffected. Retain gateway configuration exports, limit change history and test results as evidence.

Mapping to other frameworks

FrameworkReferenceRelevance to LLM10
MITRE ATLASAML.T0029 Denial of AI ServiceAvailability attacks on inference
MITRE ATLASAML.T0034 Cost HarvestingDriving up the victim's cost of running AI services
MITRE ATLASAML.T0024 Exfiltration via AI Inference API; AML.T0040 AI Model Inference API AccessModel extraction and replication through the API
MITRE ATT&CKT1496.004 Cloud Service HijackingStolen credentials used to consume hosted services at the victim's expense
OWASP API Security Top 10 2023API4:2023 Unrestricted Resource ConsumptionSame weakness at the API layer
MITRE CWECWE-400 Uncontrolled Resource ConsumptionRoot weakness named by OWASP
NIST SP 800-53 Rev. 5SC-5 Denial-of-service Protection; SI-10 Information Input Validation; AC-6 Least Privilege; AU-6 Audit Record Review, Analysis, and ReportingAvailability, input size limits, scoped access, usage review
NIST CSF 2.0PR.AA-05; DE.CM-01; ID.AM-02Least-privilege access, monitoring, inventory of AI services
ISO/IEC 27001:2022 Annex AA.8.6 Capacity management; A.8.16 Monitoring activitiesResource use planning and anomaly monitoring
CIS Controls v8.1Control 16 Application Software Security; Control 8 Audit Log ManagementSecure design of the application and retained usage logs

Common pitfalls

  • Request-only rate limits: limiting calls per minute while allowing maximum context and unlimited max_tokens lets one caller consume a large share of capacity in a handful of requests.
  • One provider key for everything: all applications share a key, so the provider limit is one bucket, nobody can tell who spent what, and revoking the key in an incident takes every service down.
  • Spend alerts without spend limits: an alert that arrives overnight does not stop a bill. LLMjacking victims typically learned of abuse from the invoice; see the LLMjacking 2024 to 2026 case.
  • Quota controls reachable by a leaked token: as at Sourcegraph, the ability to raise limits was held by an admin token that ended up in code. Treat quota administration as privileged access and scan for its tokens.
  • Unbounded agents: agents that retry failed tool calls or re-plan forever, with no step or token ceiling, generate cost without any attacker involved.
  • Full response detail to everyone: exposing logprobs and logit_bias to anonymous callers makes extraction cheaper with no product benefit.

Practitioner checklist

  • Inventory every model endpoint, provider account, key and consumer, and record an owner for each.
  • Route all inference through a gateway that authenticates each consumer with its own identity and holds provider keys.
  • Cap input size, max_tokens and request time on every route.
  • Enforce RPM, TPM and daily token budgets per identity and per tenant, returning 429 with Retry-After.
  • Set hard spend limits and staged budget alerts at provider and cloud account level.
  • Restrict logprobs and logit_bias to callers that need them.
  • Give every agent a step limit, token budget and kill switch enforced by the runtime.
  • Enable invocation logging and alert on cost anomalies, new model use and quota or logging changes.
  • Run abuse, burst and runaway-agent tests each release and keep the results as evidence.

Standards and references

Related NHI Mgmt Group resources: OWASP Top 10 for LLM Applications Guide · LLMjacking Guide · OWASP API Top 10 API4 Unrestricted Resource Consumption Guide · Denial-of-Wallet and AI Agent Cost Runaway Guide · LLM Observability Guide

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 26 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org