Skip to content
Agent Safety & Budget ProtectionDefault $0.00 Ceiling

Mathematical $0 Overage Ceilings & AI Agent Velocity Circuit Breakers

Autonomous agents in Cursor, Claude, and LangChain can get caught in infinite loops. SpendGuard stops runaway sends before bills explode, with strict $0 default overages and smart hold queues.

Overage Floor
$0.00 Default

Zero surprise bills on all subscription plans.

Circuit Breaker
Sub-15ms Trip

In-memory sliding token bucket evaluation.

Safe Hold Mode
Zero Data Loss

Enqueues held sends for 1-click human review.

Agent Key Scopes
Per-Key Caps

Isolate agent keys with daily dollar ceilings.

Interactive Demonstration

Live Velocity Circuit Breaker Simulator

Simulate what happens when an autonomous agent enters a runaway loop. Drag the velocity slider to test real-time SpendGuard trip mechanics.

Agent Sending Velocity
150emails / hour
Configured Safe Ceiling
300 emails / hr
Drag to adjust send velocity:150 / 1,500
10 / hr (Normal Bot)300 / hr (Safety Threshold)1,500 / hr (Runaway Loop)

NORMAL: Velocity within safe operational bounds (150 sends/hr)

All transactional emails are being dispatched with sub-150ms latency. Account balance remains protected with a default $0.00 ceiling.

Simulated API Gateway Response (Sub-15ms)HTTP 200 OK
JSON
{
  "ok": true,
  "status": 200,
  "id": "msg_982b_accepted",
  "spendGuard": {
    "status": "normal",
    "currentHourlyVelocity": 150,
    "velocityCeiling": 300,
    "budgetRemainingUsd": 19,
    "overageFloor": "$0.00"
  }
}
Core Architecture

Four Levels of Financial Defense

SpendGuard operates as an in-flight gateway filter, stopping runaway costs before any SMTP packet leaves our network.

Default On

Mathematical $0.00 Overage Floor

Unlike cloud providers that bill uncapped credit card overages, every SadaSend account defaults to a strict $0.00 overage ceiling. When your quota is reached, sends halt cleanly rather than generating surprise charges.

RFC-compliant HTTP 402/429 response codes with clear quota breakdown headers.
Real-time Sub-15ms

Hourly Velocity Circuit Breakers

If an autonomous background agent gets stuck in a while loop or recursive retry cascade, send velocity spikes within minutes. SpendGuard trips automatically if send rates exceed your configured threshold.

Sliding-window token bucket algorithm tracking burst volume per API key and domain.
Zero Data Loss

Dual Action Modes: Block vs. Hold

Choose between Fail-Fast Block (rejecting excess sends immediately with typed errors) or Human-in-the-Loop Hold (safely enqueuing messages in your dashboard for 1-click review without dropping data).

Held messages remain in encrypted queue with 24-hour expiration and 1-click release.
Least Privilege

Per-Agent Scoped Key Limits

Give each autonomous agent (e.g. support bot, billing agent, onboarding assistant) its own scoped API key with dedicated daily budget ceilings and recipient allowlists.

Agent keys cannot alter root account budgets or lift their own velocity ceilings.
Risk Analysis

Why Legacy Providers Expose You to Bill Shock

Traditional ESPs treat runaway loops as revenue opportunities. Compare overage policies below:

ProviderOverage Rate ModelDefault Hard StopVelocity BreakerHuman Hold Queue
SendGrid (Twilio)
$1.95 - $2.50 / 1,000 sendsNo (Uncapped monthly overage charges)None (Processes all valid API calls)None
Postmark (ActiveCampaign)
$1.80 / 1,000 sendsNo (Auto-billed at next billing cycle)NoneNone
Mailgun (Sinch)
$1.75 / 1,000 sends (Flex Tier)No (Stealth overages on all payg plans)NoneNone
Amazon SES
$0.10 / 1,000 + data transfer feesAccount suspension if reputation dropsHard rate limit per second onlyNone
SadaSend SpendGuard
$0.00 Default (Optional pre-paid credits)Yes (Strict $0.00 ceiling default)Automated sliding-window trip with alertsNative Human Hold Queue in /app/approvals
Developer Integration

Handling SpendGuard in Production

Standard SDK error handling patterns for catching circuit breaker trips and routing held sends.

agent-dispatcher.tsHandling SpendGuard velocity circuit breakers and hold queues gracefully in your agent runtime.
TYPESCRIPT
import { SadaSend, SpendGuardError } from 'sadasend';

const sada = new SadaSend({
  apiKey: process.env.AGENT_SCOPED_KEY!, // Scoped to max $5.00/day
});

async function dispatchAgentEmail(recipient: string, summary: string) {
  try {
    const result = await sada.emails.send({
      from: 'ai-assistant@yourdomain.com',
      to: recipient,
      subject: 'Weekly Analysis Briefing',
      html: `<p>${summary}</p>`,
      headers: {
        // Enforce idempotency key to prevent double sends
        'Idempotency-Key': `briefing_${recipient}_${new Date().toISOString().slice(0, 10)}`,
      },
    });

    if (result.status === 'held') {
      console.log('SpendGuard: Send held in human review queue. Message ID:', result.id);
      return { status: 'held', reviewUrl: 'https://app.sadasend.com/approvals' };
    }

    console.log('Dispatched successfully. Message ID:', result.id);
    return { status: 'sent', id: result.id };
  } catch (err) {
    if (err instanceof SpendGuardError) {
      // Velocity circuit breaker tripped or monthly budget ceiling reached
      console.error('SpendGuard tripped:', err.code, err.message);
      // Zero overages billed — alerts dispatched to Slack & developer email
      return { status: 'blocked', reason: err.code };
    }
    throw err;
  }
}
Common Inquiries

Frequently Asked Questions

Build AI email agents without fearing surprise bills

Get 6,000 free emails every month with automatic SpendGuard protection, custom DKIM signing, and zero overage risk.