Establish a baseline spending profile per agent scope (per agent, per project, per principal): expected transaction frequency, average transaction amount, merchant category distribution, and peak spending hours — computed from 30+ days of historical data.
Instrument your wallet service or payment middleware to compute rolling statistics on each transaction: z-score of amount vs baseline, time-since-last-transaction vs normal cadence, merchant category vs expected distribution.
Define anomaly thresholds: a transaction 3+ standard deviations above mean amount, more than 2x the normal daily transaction count, a merchant category never seen before, or transactions outside normal business hours for the agent's use case.
On threshold breach, emit an alert event to a monitoring channel (PagerDuty, Slack, email) with the anomaly type, transaction details, and agent session context; simultaneously place a soft hold on further agent spending pending human review.
Provide a human review interface where the operator can clear the alert (mark as expected — updating the baseline) or confirm the anomaly (triggering automatic spending suspension and incident response).
Retrain the baseline model monthly or after significant changes in expected agent behavior (new merchants added, budget increased) to reduce false-positive alert fatigue.
Known gotchas
Anomaly detection based solely on amount misses multi-transaction schemes where an agent makes many small, individually normal purchases; add velocity-based rules (N transactions in M minutes) as a separate detection layer.
Alert fatigue is the primary failure mode of anomaly detection systems — if alerts are too sensitive, operators will begin ignoring them; tune thresholds to maintain a false-positive rate below a level that your team will actually investigate.
A soft hold on agent spending after an anomaly alert must not block time-sensitive legitimate operations indefinitely; define a maximum hold duration and an escalation path if the human reviewer is unresponsive.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp