Runtime protection

Stop a runaway customer in seconds.

Lancelot’s SDK counts each customer’s AI calls and spend, and stops anyone who passes your limits.

Lancelot Protection page showing a stopped customer and flagged free accounts
600

calls a minute per customer before the emergency stop.

$50

in 5 minutes is the default spend limit per customer.

5

minutes of cooldown after a stop, adjustable up to 24 hours.

1

minute or less before you hear about a stop.

Northwind LabsCalls per minute · 2:14 amExample
Limit
600
Calls
1,840
Stopped for5 min
ThenLancelot limits them to 10 calls a minute and tells you within a minute.
sam@example.comFree plan · MonExample
Daily budget
$0.50
Spent today
$0.50
Blocked calls never reach the provider
Held untilTomorrow
Set byYou, once, for every free customer on the Protection page.
document-chatNorthwind Labs · Sat 2:00 amExample
Loop threshold
50 calls
Last 10 minutes
412 calls
Prompt sizes within 10%
Proposed fixThrottle
NeverLancelot compares prompt sizes, and never stores what your users type.

One stuck agent can spend a month of margin in an afternoon.

$906

spent by one looping agent in this example, on a $49 plan.

Northwind Labs · one weekend
$906.00
Example
Friday
$6.10
Saturday
$431.70
Sunday
$468.20

Every stop becomes an alert and an item in the agent’s feed.

Lancelot proposes a lasting fix, and you approve it from the app, Slack or email.

The agent feed in Lancelot on a sample workspace

Turn on one SDK option. The stop is on from the first call.

01

Set enableFlags.

enableFlags: true in Node, or enable_flags=True in Python.

02

Fails open.

If Lancelot can’t be reached, your calls keep working. Limits already set still apply.

03

Undo anytime.

The agent’s limits lift at the start of next month, or the moment you undo them.

The limits, in detail. Defaults you can change.

Emergency stop

Calls per customer

600 a minute by default. Set it anywhere from 10 to 100,000.

Spend per customer

$50 in 5 minutes by default.

Cooldown

5 minutes by default, from 1 minute to 24 hours.

On or off

On by default, for each product. Developers can override it in code.

Plan-scaled stop

Each paying customer gets an hourly cap equal to their monthly plan price from Stripe or RevenueCat. Nobody has to set it.

Unpriced models

Don’t count toward a spend limit. The calls-per-minute limit still applies.

AI agent monitoring, every hour

Runaway loop

More than 50 calls in 10 minutes from one customer, on the same feature and model, with prompt sizes within 10% of each other.

Burst

Over 10 times a customer’s usual hourly calls and over 100 calls in the last hour. Or yesterday cost over 3 times their two-week median, and over $5.

New-account spike

A customer whose first call was in the last 48 hours has already spent more than 95% of your paying customers spend in a month.

Free-tier farming

More than 10 new free accounts in 24 hours, and over 5 times your usual daily number.

Warm-up

These last two checks start after 7 days of usage. New-account spikes also need 5 paying customers to compare against.

Fixes and rules

Throttle

Limits the customer to 10 calls a minute.

Pause

Stops their AI calls.

Cap spend

Holds them to a daily budget.

Switch model

Moves them to a cheaper model you’ve approved.

Paying customers

Lancelot never pauses one without your approval.

Free-tier farming

Always stays a suggestion.

On its ownGrowth+

Lancelot acts without asking on Growth and higher. On Founder, you approve each fix with one click.

Inside your app

Blocked calls

The SDK throws LancelotBlockedError before the call reaches the provider, so it costs nothing. Catch it and show your own message.

import { LancelotBlockedError } from "@lancelotwatch/node";
 
try {
  const reply = await openai.chat.completions.create({ model: "gpt-4o", messages });
} catch (e) {
  if (e instanceof LancelotBlockedError) {
    // e.reason: "paused" | "throttled" | "runaway" | "budget"
    return showMessage("You've hit today's AI limit.");
  }
  throw e;
}
New decisions

The SDK picks up throttles, pauses, model switches and budgets once a minute.

Many servers

Each server process keeps its own counts, so across servers a limit is approximate. The hourly checks catch what slips between them.

Without the SDK

Through OpenRouter or Helicone, Lancelot still detects every pattern and suggests fixes. Stopping, throttling and budgets run in your app, so they need the SDK.

Questions about runaway costs and abuse protection

Does the emergency stop slow down my AI calls?

No. The stop and budgets run inside your app with no network call on the way to the model. The SDK checks a few in-memory counters per customer and either lets the call through or stops it.

Every call goes through. The SDK fails open: it keeps the last limits and decisions it received and never blocks your product because Lancelot can’t be reached. Usage data waits in a queue of up to 10,000 calls and is sent when the connection returns.

600 calls a minute or $50 in 5 minutes per customer, with a 5-minute cooldown. Paying customers also can’t spend their monthly plan price within one hour. You can change the numbers or turn the stop off on the Protection page.

Whatever you choose. The SDK throws LancelotBlockedError with a reason (paused, throttled, runaway or budget) before the call reaches the provider. Catch it and show your own message, such as an upgrade prompt.

Not without your approval. Lancelot can throttle or cap a customer automatically on Growth and higher plans, but pausing a paying customer always waits for you. Every limit can be undone and lifts by itself at the start of next month.

It looks for more than 50 calls in 10 minutes from one customer on the same feature and model, with prompt sizes within 10% of each other. It compares token counts, never prompts, so nothing your users type is stored.

Set a daily AI budget for free users, and the SDK stops anyone who reaches it. Lancelot also flags unusual waves of new free sign-ups and suggests pausing the newest accounts or tightening the free plan.

It covers the cost side. Denial of wallet means someone runs up your AI bill on purpose, with a script, a loop or a farm of free accounts. Lancelot caps what any one customer can spend and flags new-account spikes and free-tier farming. It doesn’t inspect prompts or block prompt attacks.

Provider limits apply to your whole account and protect the provider. Lancelot’s limits apply to each of your customers, in dollars as well as calls, so one customer can’t use up your capacity or your margin.

No. The emergency stop and budgets run inside your app through the SDK, so there’s no proxy between your app and the provider. If you already use OpenRouter or Helicone, Lancelot imports those calls for detection, and enforcement still needs the SDK.

Partly. Lancelot detects every abuse pattern in imported calls and suggests fixes. Stopping, throttling and budgets run inside your app, so they need the Lancelot SDK.

Node (@lancelotwatch/node) and Python (lancelotwatch). Both include the emergency stop, budgets, throttle and pause, and wrap the official OpenAI and Anthropic clients. Protection turns on with one option: enableFlags in Node, enable_flags in Python.