Model dos

From thejefflarson/soundcheck · View interactive version

Model dos is an AI agent skill from the GitHub repository thejefflarson/soundcheck. Detects LLM endpoints missing token caps, rate limits, or prompt-length bounds, enabling cost and resource exhaustion. Use when writing LLM API call handlers, setting up inference endpoints, implementing chatbot backends, or configuring token limits for LLM services. Also invoke when accepting user-

How to use this skill

Skill file

Model Denial of Service Security Check (OWASP LLM04:2025)

What this checks

Protects against resource exhaustion caused by unbounded prompts, missing token caps,

or absent rate limiting. Attackers can submit enormous or recursive inputs that inflate

inference costs, saturate GPU/CPU, and deny service to legitimate users.

Vulnerable patterns

Fix immediately

Flag the vulnerable code and explain the risk. Then suggest a fix that establishes

these properties:

  1. Every LLM call sets an explicit output cap — the provider's max-tokens

parameter or its equivalent. Leaving it at the provider default lets a single

request run for minutes and rack up dollars in tokens.

  1. Prompt input is length-capped at the handler boundary before it reaches the

inference client. Measured in chars, bytes, or tokens — the exact unit does not

matter as long as the cap runs before the upstream call.

  1. Conversation context is bounded. Either the handler is stateless

single-turn, or accumulated history is trimmed to a fixed turn or token

budget before every call. Unbounded history is an attacker's favorite

amplifier.

  1. Per-identifier throttling (per user, per API key, per IP) runs on every

LLM endpoint. In-process token bucket, framework middleware, or reverse-proxy

rule — anything that survives alias and batch tricks and prevents one caller

from pinning the endpoint.

  1. Every inference call has a deadline. SDK timeout, HTTP client timeout, or

request-context cancellation — a hung upstream must not be able to

indefinitely occupy a worker.

Translate each principle to the inference SDK, web framework, and rate-limiter of

the audited file. Use the SDK's documented cap and timeout parameters — do not rely

on global defaults.

Verification

Confirm the following properties hold (language-agnostic):

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.