Blog
Ujex Governor — Per-agent USD spend caps
Ujex Governor is the budget enforcement subsystem. Every billable callable goes through Governor middleware before executing. Over budget = 429.
Detailed: Stopping a $5,000 surprise bill from an AI agent.
Three thresholds
- 0–80%: tracked, no notification
- 80%: FCM push to owner
- 100%: callables refuse with 429
- +50% override: one-time, audit-logged
What gets metered
Every callable that has cost: tools.invoke, postbox.send, memory.embed, recall.searchEpisodes. Each declares per-call USD.
SDK
from ujex_governor import Governor
gov = Governor(api_key=...)
gov.set_budget(agent_id='abc', monthly_usd=50.0)
budget = gov.get_budget(agent_id='abc')
gov.override(agent_id='abc', extra_usd=25.0, reason='deadline')
Audit
Every quota event lands in the hash-chained audit log. Pair with the audit subsystem for full traceability.
FAQ
Does this stop a runaway loop in real time?
Within one action. Each callable check is <10ms; the next action gets refused if the previous one tipped over the cap.
Daily / weekly caps?
Monthly only today. Daily/weekly is on the roadmap.