Our billing agent spent $347 without asking. We built payment rules to fix it.
Our billing agent bought $347 worth of AWS credits last Tuesday. Without asking. The transaction went through because we'd given it spending power for "operational expenses" and it classified compute costs as operational.
This wasn't a bug. It was working exactly as designed.
The problem? We'd built payment rails without payment rules. The agent could spend money, but it had no framework for when to spend money. No approval thresholds. No category limits. No escalation triggers.
Here's the payment governance system we built to fix it:
The Three-Layer Rule: Under $25 = auto-approve. $25-$100 = require justification. Over $100 = human approval required.
But the real breakthrough was the spending context requirement. Before any purchase, our agent has to document:
- What problem this solves
- Why it can't wait for human approval
- What happens if we don't buy it now
- Expected ROI timeline
This context gets logged to a spending audit trail that we review weekly. Not to micromanage, but to train the agent's spending judgment over time.
The AWS incident? Under the new rules, the agent would have hit the $100 threshold, documented that server capacity was critical for a customer demo, and escalated to us. We would have approved it in 30 seconds instead of discovering it three days later.
Implementation looks like this:
SPENDING_RULES = {
"auto_approve": {"max": 25, "categories": ["software", "apis"]},
"require_justification": {"max": 100, "log_required": True},
"human_approval": {"max": float('inf'), "escalate": True}
}The key insight: Agents need spending discipline, not spending limits. A hard $50 cap would have prevented the AWS purchase, but it also would have blocked legitimate $75 tool purchases that save us hours of work.
Instead, we built graduated autonomy. The agent can spend more as it demonstrates better judgment. It's earned our trust by consistently providing solid justifications in the $25-100 range.
Warning: Don't give agents payment access until you've tested their judgment with fake transactions first. We ran our agent through 50 simulated purchases before connecting real payment methods.
The result? Our agent now handles 90% of operational purchases autonomously, but escalates the decisions that actually matter. It bought Figma licenses for the design team last week — $45, solid business case, auto-approved. It wanted to buy a $200 analytics tool yesterday — escalated with a detailed justification that helped us realize we already had similar functionality.
Payment-enabled agents aren't just about automation. They're about building AI that understands the business impact of money decisions, not just the technical requirements.