← Back to Risk Mitigation Techniques Risk Mitigation Techniques

Usage caps and limits

Category
Prevent
Creatures
Loggle (#1), Scalix (#2), Loopuff (#3), Promptle (#9)

Description

Hard or soft limits that bound how far consumption, and so cost, can run before a person intervenes. They limit the blast radius when something goes wrong.

How to apply it

  • Log Analytics daily cap, with an alert before it is hit (Loggle).
  • Autoscale and scale-out maximums set to what downstream systems can sustain (Scalix).
  • Capped retry policies, dead-letter queues and circuit breakers (Loopuff).
  • Token limits (max_tokens, quotas, rate limits, APIM token-limit policy) and a usage cap where possible (Promptle).

Examples

  • Scalix: after a plan scaled from 1 to 30 nodes against a database that could not cope, the team lowered the max scale-out to the database's sustainable throughput.
  • Loopuff: limited retry policies were added after runaway executions.
  • Promptle: no token limit and no monitoring allowed a PoC to pass 20k.

Limitations

  • Caps can drop data (Loggle: capping drops data, so alert before the cap).
  • A cap set without thought for downstream bottlenecks can still move the problem (Scalix: think about maximum sustainable throughput).
  • Caps do not apply everywhere; Promptle says "where possible".

Related techniques