What is LLM Denial of Service (DoS)? Types and Defenses
LLM denial of service is an availability and runtime security risk in which prompts, outputs, context growth, agent behavior, or tool calls consume excessive model capacity, tokens, quota, money, or downstream system resources. Unlike traditional DoS, LLM DoS attacks may not require very high request volume. A smaller number of semantically expensive prompts can exhaust context windows, trigger long outputs, cause recursive agent loops, or overload connected tools and APIs.
LLM DoS is a runtime availability problem
LLM DoS risk appears during execution, where user prompts, retrieved context, model responses, agent actions, and tool calls all compete for capacity. The impact can include excessive token usage, higher latency, exhausted quota, unexpected cost, overloaded downstream systems, or unavailable AI workflows.
Because these attacks can be semantically expensive rather than simply high volume, defenses need to evaluate more than request count. Runtime controls should consider prompt size, output length, context growth, agent iteration behavior, tool use, identity, and budget before expensive execution continues.
Common types of LLM DoS attacks
| Attack type | How it creates availability pressure |
|---|---|
| Prompt flooding | Repeated prompts target the AI application or model API. The distinguishing factor is often token and compute consumption, not only request count. |
| Context-window exhaustion | Attackers or faulty workflows force repeated inclusion of large histories, documents, retrieval results, or tool outputs until latency, quota, or cost becomes unsustainable. |
| Expensive-output generation | Prompts request long, verbose, recursive, or highly structured responses to maximize generation time and output-token use. |
| Recursive agent loops | Agents may repeatedly plan, call tools, retry, or ask the model to continue without clear iteration limits, elapsed-time limits, or stop conditions. |
| Tool-call abuse | The model may remain available while connected databases, search systems, SaaS APIs, code sandboxes, or workflow services become the bottleneck. |
| Continuous input overflow | A session or conversation is driven to accumulate more context than the application can safely process or afford. |
LLM DoS pressure points
Availability risk can emerge at multiple points in an AI workflow, not only at the model API boundary. The most important pressure points are the places where cost, latency, context size, agent execution, or downstream systems can grow unexpectedly.
Architecture patterns that reduce exposure
The strongest LLM DoS defenses are enforced before expensive execution occurs. Enterprises should place a runtime control layer between users, applications, models, agents, tools, and downstream systems. This layer should evaluate identity, policy, prompt size, context size, model selection, tool permissions, and budget before the request is allowed to proceed.
Isolation is equally important. Shared quotas can turn one abusive user, tenant, API key, agent, or workflow into a broader outage. Quotas should be separated by tenant, user, application, model, agent, and workflow where operationally feasible. This prevents one high-cost interaction pattern from exhausting capacity needed by other business processes.
Agentic systems need additional boundaries. A bounded agent design sets maximum iterations, maximum tool calls, maximum elapsed time, maximum context size, and explicit stop conditions. Tool access should follow least privilege. Agents should not receive broad access to write operations, financial actions, production systems, or high-cost APIs unless there is a clear need and a control path. For high-impact actions, human authorization can reduce both DoS and excessive-agency risk.
Design principle: enforce limits before high-cost execution, then isolate usage so that one user, tenant, workflow, application, model, or agent cannot consume capacity needed by other business processes.
Practical runtime controls for LLM DoS defense
Effective controls combine rate, token, context, output, concurrency, and tool policies. Request-per-minute limits alone are not enough because two requests can have very different cost profiles. A short prompt with a short answer may be low risk, while a single large prompt that requests a long structured response and triggers multiple tools can consume materially more resources.
Start with hard limits at the AI gateway or runtime layer. Enforce request-per-minute, token-per-minute, concurrent-session, context-size, and output-token limits. Output caps are especially important for expensive-output attacks because they limit how long the model can continue generating. Timeouts and circuit breakers should apply to model calls, retrieval calls, tool invocations, and agent loops. If a downstream system begins failing or slowing, the AI application should degrade gracefully rather than retry indefinitely.
Prompt and query validation can help identify unusually large inputs, repeated patterns, recursive instructions, or requests likely to trigger high-cost output. These checks do not need to determine user intent perfectly to be useful. They can classify risk, route suspicious requests to stricter limits, require approval, or reject clearly abusive input. For asynchronous or long-running work, queueing and resource allocation limits can protect interactive workflows from being starved.
Limit costly execution
Apply request, token, context, output, concurrency, elapsed-time, and session limits before expensive work continues.
Bound agent behavior
Set maximum iterations, maximum tool calls, clear stop conditions, and least-privilege tool access for agentic workflows.
Protect downstream systems
Use timeouts, circuit breakers, queueing, and approval paths so retrieval systems, SaaS APIs, databases, and workflow tools do not become the bottleneck.
Detection, evidence, and incident response
Detection should focus on AI-specific usage patterns and execution behavior. Useful evidence includes prompt and response size, token consumption, context growth, model selection, tool invocations, agent iterations, policy outcomes, latency, retries, and downstream errors.
When an incident occurs, response teams need enough runtime evidence to understand whether the issue came from abusive prompts, faulty workflows, recursive agent behavior, excessive retrieval, long output generation, or overloaded tools and APIs. That evidence can also support later governance review and policy tuning.
How Trussed AI fits into an enterprise control model
Trussed AI supports an enterprise control model by helping teams apply governance and runtime controls where AI activity is executed, observed, and audited.
- Runtime policy enforcement: Apply controls at the point where prompts, agents, tools, and downstream actions are executed.
- Agent permissions: Reduce excessive agency by limiting what agents can do and which tools they can access.
- Tool approval workflows: Introduce review for sensitive or high-impact tool actions rather than allowing unrestricted autonomy.
- Runtime monitoring: Observe AI-specific usage patterns, policy outcomes, and execution behavior for investigation and response.
- Audit logging: Maintain governance evidence for AI activity, decisions, permissions, and runtime events.
Build runtime controls for enterprise AI agents
LLM DoS risk is best managed with bounded execution, least-privilege tools, monitored runtime behavior, and enforceable AI policies.
Talk to an Expert