Spending Policies

Programmable
guardrails.

Define per-transaction limits, daily caps, counterparty restrictions, and human escalation triggers. The engine evaluates every payment against all active policies in under 10ms.

Under 10ms evaluation 7 Rule Types Human Escalation
Rule Engine

Seven rule types.
Composable.

payments

Amount Limits

Per-transaction, daily, weekly, and monthly spending caps. The engine tracks counters atomically in Redis with TTL-based expiration.

speed

Velocity

Maximum transactions per hour and unique counterparties per day. Prevents rapid-fire spending and counterparty diversification attacks.

people

Counterparty

Whitelist and blacklist addresses. Agents can only send to approved counterparties. Unknown addresses trigger policy violation.

schedule

Time Window

Operating hours and blocked days. Restrict agent spending to business hours in a specific timezone. Block weekends or holidays.

category

Category

Allowed and blocked spending categories. Permit compute purchases but block gambling. Categories are defined per transaction.

link

Chain Restriction

Limit agents to specific blockchains. A Base-only agent cannot spend on Ethereum. The engine rejects cross-chain attempts.

front_hand

Human Escalation

Transactions above a threshold require human approval. Define the amount, set an approval timeout, and choose the auto-action (reject or allow) when the timeout expires.

Enforcement

Three modes.
Your choice.

Each policy runs in one of three enforcement modes. Start with audit_only to observe agent behavior, move to warn for visibility, then switch to enforce when the rules are calibrated.

audit_onlyobserve

Violations logged. Transactions proceed. Use this to understand spending patterns before setting limits.

warnflag

Violations logged and flagged. Transactions proceed with a warning attached. Dashboard highlights the issue.

enforcereject

Violations reject the transaction immediately. The agent receives a structured error with the violated rule and action taken.

policies.py
agent.set_policy(
max_per_tx=50,
max_daily=500,
counterparty_whitelist=["0x7f3a..."],
enforcement_mode="enforce"
)
# Simulate before going live
result = agent.simulate_payment(amount=75)
print(result.passed) # False
print(result.violated_rules) # ["max_per_transaction"]