[Release feedback] LLM06: denominate spending caps in currency per run — measured model price spread and a model-boundary enforcement pattern

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

@drk-ram is already working on this.

Since Nov 1, 2026.

  • #158 by @drk-ram — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
44/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet

Research direction

Start from the LLM06:2026 entry document in this repository and read Mitigation #2 together with the reference list it ends with; the payload does not name a path, so the first step is locating that entry and the citation format it uses. Check whether the three suggested additions (currency-denominated caps, in-path enforcement, cost per successful task) each need wording plus one or more reference entries. Done means the entry text and references are updated consistently and the linked sources resolve, but confirm with the entry leads first since the author offers a PR rather than a fixed spec.

Written by the indexing model from the issue text.

Description

Feedback type

Reference or supporting research

Feedback

LLM06:2026 Mitigation #2 (Hard Spending Caps) sets ceilings per API key,
user, team, and cloud account, and rightly requires that caps halt
inference rather than only alert. Two measured points from published
work suggest strengthening the wording:

  1. Token-denominated caps misprice the risk across models. The same
    token budget costs very different amounts on different models. In a
    measured comparison of current models on identical agent workloads,
    the per-task dollar cost spread between the cheapest and most
    expensive model was about 28x, while framework overhead changed cost
    by at most about 3.9x. A token ceiling that is safe on a small model
    therefore permits roughly an order of magnitude more spend on a
    frontier model. Independent session-scale data points the same way:
    across 722 real agent sessions, context processing was 83.5% of
    modelled cost and 3.3% of sessions produced 80% of the cost
    (Arsentev, 2026), so controls set per request systematically miss
    where spend accumulates. Suggested addition to Mitigation #2: "Denominate caps
    in currency per run or per task, not only in tokens; token limits
    remain a useful secondary control because they are model-agnostic."

  2. The enforcement point matters, and there is a reference pattern.
    Mitigation #2 says caps "must be enforcement mechanisms that halt
    inference when exceeded." In agent loops, after-the-fact accounting
    (callbacks, billing monitors) cannot halt a run, because the loop
    continues while the accounting catches up. A working pattern is to
    enforce the budget inside the model-call path: a model wrapper that
    prices each call's actual usage and raises before the call that would
    exceed the budget. In a verified test, this halted a runaway
    tool-loop after 2 calls / $0.09 against a $0.05 budget. The same
    in-path halt is what stops the adversarial cases this entry already
    cites: infinite-thinking loops (Li et al., 2025, ThinkTrap) and
    tool-chain token exhaustion (Dong et al., 2026, Clawdrain) both burn
    budget inside the run, where only an in-path control can stop them.
    The pattern is published as a runnable sample (BudgetedModel,
    strands-agents samples) and could be cited as an implementation
    reference for the mitigation.

  3. Retries make consumption per successful task the safer unit.
    A failing cheap model that retries can out-consume a reliable
    frontier model. Measuring cost per successful task (rather than per
    call) when setting caps accounts for this; a public benchmark
    dataset for that measure is available (see evidence).

Caveats: the author's measurements are benchmark workloads with a
reference cost library, not production telemetry. The Arsentev reports
cited alongside are technical reports, not peer-reviewed. Together they
speak mainly to the benign-runaway half of LLM06 (loops, retries, model
selection); the adversarial half is covered by the entry's existing
attack references (ThinkTrap, Clawdrain).

I am happy to open a pull request with the wording and reference
entries if the entry leads want them.

Supporting evidence

Author's work:

Other researchers' work:

Acknowledgments
  • I searched existing issues and discussions for this topic.
  • I agree to follow the OWASP Code of Conduct.
Dominant language
JavaScript
Stars
177
Forks
57
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenAI-Security-Project/GenAI-LLM-Top10

All issues in GenAI-Security-Project/GenAI-LLM-Top10

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.