AI and LLM security

AI resource exhaustion, runaway requests and cost abuse

Bounded work: clock, filter, server arranged to illustrate ai resource exhaustion, runaway requests and cost abuse.

AI resource abuse can increase cost or reduce availability through long requests, repeated calls or expensive tool use. Understanding AI resource exhaustion and runaway requests and cost abuse helps establish which security property the feature needs and where that property is actually enforced.

What does this involve?

Availability controls need to bound the total work an operation can cause, including background jobs, nested queries, retries and paid services. Request size alone is a poor measure of cost when small inputs can trigger expensive processing.

Resource Exhaustion attacks exploit vulnerabilities by consuming excessive resources (such as memory, CPU, network bandwidth, or storage), thus disrupting or degrading the performance and availability of AI services. In AI systems, attackers can craft specific inputs or interactions that intentionally cause resource-intensive processes, potentially resulting in denial-of-service (DoS) conditions.

Token limitations are also very important when defining how the testing will be conducted. Many of the automated testing tools currently in use generate a large number of requests and can therefore incur significant costs, which may not be justified by the results obtained, potentially making a more manual approach to this type of analysis preferable.

Why it matters

Consider a realistic failure: one task enters an uncontrolled loop of model and paid API requests.

Resource abuse can slow legitimate work, increase service costs or leave queues and business state in an unhealthy condition. Assessment should use proportionate workloads and distinguish a missing limit from a demonstrated operational effect.

AI testing needs recorded model and application conditions because outputs can vary. The important evidence is the protected information, decision or tool operation affected in the deployed workflow.

How penetration testers check for it

Measure request, token, tool, concurrency and budget limits.

  • Identify vulnerabilities within the AI infrastructure that could lead to resource exhaustion.
  • Ensure AI infrastructure handles unusually large or maliciously crafted inputs without performance degradation or failure.
  • Enforce Rate Limiting: The system must return 429 Too Many Requests errors when a client exceeds the defined request frequency.
  • Enforce Input Size Limits: The API gateway or application should immediately reject requests with payloads exceeding a reasonable size (e.g., 1-2 MB) with a 413 Payload Too Large error.
  • Check retries, cancellation and identity-based quotas.
  • Observe useful service behaviour during bounded failure conditions.

How to fix it

Apply end-to-end work budgets and cancellation and monitor meaningful cost boundaries.

  • Apply end-to-end work budgets and sensible defaults.
  • Limit costly operations at relevant identity boundaries.
  • Use bounded retries and safe cancellation.
  • Monitor meaningful capacity and cost signals.

Load testing and penetration testing have different operational impacts. The test conditions should be agreed so the review can establish control behaviour without unnecessary service disruption.

Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.

Read about our methodology or contact pentested.com to discuss your AI applications and agent workflows.

See your first test report this week.

Book a 30 minute demo. We will verify one of your targets with you and run a test against it, so you can judge the results on your own systems.

Book a demo