Spend and abuse limits
How rate limits, spending caps and per-endpoint quotas stop abuse and runaway cost, enforced in the database.
Limits are decided in the database, so two runtime instances cannot both take the last slot, and a limiter that fails does not fail open.
Rate limits
A new turn counts against the user, the agent and (when the session has one) the tenant. Defaults are 20, 300 and 100 per minute, and each agent can change them. Other endpoints have their own limits: source links, AI checks, feedback, knowledge push, tenant uploads, signals, eval runs, and the public theme and logo routes. The full table is on Rate limits and spend.
The public theme and logo routes need only a publishable key, so they are limited per key and per network address. The address is hashed and never stored.
If the database cannot answer, the request fails. A limiter that fails open would let a burst through exactly when the system is struggling.
Monthly spending limits
An owner or admin can set a monthly cost and/or token limit on an agent, and one default per tenant for the organization. They are checked in begin_turn, the one database function every new turn goes through. A full limit raises before any turn, message or provider call exists, so nothing is left behind.
- Concurrent turns cannot all take the last slot. The function locks each counter and counts the turns in flight.
- Usage is counted by a trigger on usage events in the event's own transaction, so every writer is covered.
- A model without a known price is counted at the highest price Baseera knows, never as free.
- Only owners and admins set a limit, through
set_spend_limit, which validates and caps the numbers. - Setting, changing and removing a limit are audited with ids and numbers only. Tenant ids are never logged, emailed or audited.
- The 80% email goes to the owners at most once per period per limit, enforced by a unique row.
- Turns already running finish.
Provider key checks
Saving a key is limited to 10 checks a minute per person and per organization. See Provider keys.
Evals
A run spends your provider key, so nothing starts without confirmCost: true. Runs are capped at 500 attempts, one at a time per agent and 30 per agent per hour. The optional setting that runs required tests when the tool manifest changes is off by default, and is bounded to one trigger per agent per 10 minutes and 10 a day.
Knowledge and uploads
Pushes are limited to 1,000 items a minute per secret key. Tenant uploads have quotas (200 files, 200 MB, 25 MB a file) and rates (20 a minute per user, 30 per tenant). Crawls have page, depth and site caps. See Network and fetching.
Input caps
Message text (8,000 characters), tools per turn (64), context.data (4 KB), tool output (64,000 bytes), signal data (2 KB) and request bodies all have caps, and the SDK, runtime and database check them in turn.