Blog

Ujex Governor — Per-agent USD spend caps

Akshay Sarode

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

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.

Get started

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.