Skip to main content

Budgets

Budgets enforce spending limits at any level of your agent hierarchy. Each budget has an amount, a period (daily/weekly/monthly/total), and tracks spend in real time.

Hierarchical budgets

Budgets can have parent budgets via parent_budget_id. When a card is created against a budget, the entire chain is validated and debited atomically:
  1. Walk up the parent chain (max depth 10)
  2. Lock each budget row with FOR UPDATE
  3. If any level has insufficient remaining balance → deny with bottleneck message
  4. If all levels pass → debit all in a single pass

Budget periods

Delegation rules

Delegation rules control which agents can create cards on behalf of other agents within an organization.

Enforcement

When a delegated agent creates a card:
  1. System finds delegation rules where the agent is the delegate
  2. Checks max_amount_cents — denies if exceeded
  3. Checks allowed_categories — denies if merchant category not in list
  4. If requires_approval: true — forces approval even if rules say auto-approve

Agent hierarchy

Agents support parent-child relationships via parent_agent_id. Combined with budgets and delegation, this enables:
  • Department-level budget caps
  • Per-agent spending limits within departments
  • Delegated authority with category restrictions