Skip to content
AI Primer
breaking

Vercel details spend caps and anomaly alerts for runaway agent bills

Guillermo Rauch listed shipped safeguards including spend caps, anomaly alerts, recursion protection, billing APIs and DDoS mitigation. The post followed reports of agents looping until queues timed out.

4 min read
Vercel details spend caps and anomaly alerts for runaway agent bills
Vercel details spend caps and anomaly alerts for runaway agent bills

TL;DR

  • Vercel framed runaway agent bills as a shipped controls problem: rauchg's list named spend caps, anomaly alerts, recursion protection, billing APIs, and DDoS mitigation.
  • The controls are not all new: after a reply questioned the list, rauchg's follow-up said many of them have shipped for years.
  • The failure mode came from normal agent plumbing: zeeg's report said Junior was looping until a Vercel queue timed out tasks, with pinned old workers suspected at first.
  • The recursion shield has edges: cramforce's reply said Vercel catches recursive invocations automatically, but not every third-party loop or unusual HTTP client.
  • v0 added per-message cost visibility: v0's dashboard post said Usage & Activity can break down daily credits, member or project activity, and message cost by date and model.

The sharp caveat is in Vercel's Spend Management docs: setting a spend amount does not stop usage unless project pausing is enabled, and pausing can lag by several minutes because spend checks are periodic. The recursion protection changelog says protection works for Node http and fetch calls by propagating x-vercel-id, while bare Socket calls are outside scope. The billing endpoint returns FOCUS v1.3 JSONL, which is the most agent-friendly part of the list.

Runaway loops

Zeeg said Junior was infinite-looping on an error until a Vercel queue timed out the tasks. The bug pattern happens about once a week in his setup, he wrote, but only one incident involved inference.

His first read pointed at pinned old worker code. A later update from zeeg's follow-up said that specific loop might not have been version drift, and zeeg's pinning reply argued that pinning is bad in most scenarios because people misunderstand the systems behavior.

The shipped controls list

Rauch's list was a compact inventory of bill-safety primitives already in Vercel:

  1. Soft and hard caps: Vercel's hard caps changelog says Pro customers can automatically pause all projects when metered usage reaches a configured spend amount.
  2. Anomaly alerts: The alert configuration changelog says teams can choose projects, alert types, metrics, HTTP status codes, and routes, then route findings to destinations like Slack or email.
  3. Recursion protection: The recursion changelog says Vercel Functions can detect code that repeatedly triggers itself.
  4. Billing usage APIs: The billing API changelog says /billing/charges exposes cost data through API and CLI.
  5. DDoS mitigation: Vercel's DDoS docs say mitigation covers L3, L4, and L7 attacks on all plans, and blocked DDoS traffic is not charged.

The Spend Management docs add the operational footnote: web and email notifications fire at 50%, 75%, and 100%, SMS can fire at 100%, and project pausing is not instantaneous because Vercel checks spend every few minutes.

Recursion protection

Cramforce said Vercel automatically detects and breaks recursive invocations, and that he has not gotten an escalation in years. His caveat was the useful part: loops through third-party systems and unusual HTTP clients can escape the pattern.

The official recursion changelog matches that boundary. Protection supports Node http and fetch in Serverless Functions, including dependencies, while requests using the bare Socket constructor are not protected.

Billing APIs

Rauch specifically called out billing usage APIs that agents can query in the spend-control list. The endpoint Vercel shipped in February returns charge data in FOCUS v1.3, supports 1-day granularity over a maximum one-year range, and streams newline-delimited JSON.

The REST docs for /billing/charges say the endpoint is available to Owner, Member, Developer, Security, Billing, and Enterprise Viewer roles for a team. That makes cost state readable by automation without scraping invoice pages.

v0 Usage & Activity

v0's separate Usage & Activity dashboard shipped into Settings with three cost views:

  • Daily credit usage.
  • Activity by member or project.
  • Message drill-down by date, model, and cost.

The v0 pricing docs now describe Usage as credit consumption and activity grouped by project or chat. On eligible team plans, Owners and members with the Billing role can review team-wide credit and activity data by member or project.

rauchg's v0 reply called the dashboard "much needed," which is the least surprising sentence in the thread.

Further reading

Discussion across the web

Where this story is being discussed, in original context.

On X· 2 threads
Runaway loops2 posts
v0 Usage & Activity1 post
Share on X