AI call with no limit on how much it may generate
Partiallow severity · reads .ts .tsx .js .jsx .mjs .cjs .pyBeta
Without a limit, one request can run up a large bill or tie up the service (unbounded consumption). Marked Partial: the limit may be set in a shared client or wrapper. When Lintsure finds this, it marks it as Partial: it may be fine, depending on context only you can confirm.
How to fix it
Set a maximum output size on each call (max_tokens, maxTokens or max_output_tokens), and limit how often each user can call it.
Through a coding agent, Lintsure suggests the change and waits. Nothing is edited until you approve it.
Controls it relates to
- OWASP LLM Top 10LLM06:2026Unbounded Consumption
- CWE Top 25CWE-770Allocation of Resources Without Limits or Throttling
- API4:2023Unrestricted Resource Consumption
What the framework asks
OWASP LLM Top 10 LLM06:2026: Unbounded Consumption
Limit output size, request rate and cost per user, so one person can't run up a bill or take the service down.
Evidence a reviewer may ask for: Rate limits, spending alerts and usage monitoring.
CWE Top 25 CWE-770: Resources without limits
Expensive work, including AI calls, has limits.
Evidence a reviewer may ask for: Rate limits and quotas.
API4:2023: Unrestricted Resource Consumption
Limit how often, how much and how long: request rates, page sizes, upload sizes, and anything you pay for per call.
Evidence a reviewer may ask for: The limits in code and at the gateway, and spending caps with providers.
Summaries are our own reading of the public texts, not the official wording.
Read more: How to reduce prompt injection risk in your AI app
Check your code for this
Runs on your machine. Your code is never uploaded.
npx lintsure scanThis rule is in Beta: its mapping to framework controls is our own reading of the public texts, not independently reviewed. Lintsure is a readiness tool, not an audit or legal advice. A finding, or the lack of one, doesn't make you compliant. Disclaimer
We improve these rules all the time. If you see a false alarm, a missed problem or anything that could work better, tell us in a review and we will use it to improve your experience.
Related rules
- Personal data written to logs
- Secret or private key committed to source
- Data sent over plain HTTP
- Personal data or tokens in a URL
Did this rule flag something that's fine, or miss a real problem? Tell us on GitHub. Every report becomes a test case, so the same mistake can't come back.