Skip to main content

Documentation Index

Fetch the complete documentation index at: https://spendguard.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

SpendGuard ships with four policy templates designed for common AI agent use cases. Each template is a complete, valid POST /v1/policies request body — copy it, customize the parameters, and you’re live.

Template 1: AI Support Refund Policy

Best for: AI customer support agents handling refund requests. What it does:
  • Blocks refunds over $500
  • Escalates refunds over $200 for human review
  • Blocks refunds on orders older than 30 days
  • Blocks wire, crypto, check, and cash refund methods
  • Blocks duplicate submissions within 10 minutes
  • Blocks refunds outside business hours (Mon-Fri, 8am-8pm UTC)
{
  "policy_id": "support_refund_policy",
  "name": "AI Support Refund Policy",
  "description": "Standard guardrails for AI agents handling customer refund requests. Prevents oversized refunds, late refunds, and unauthorized payment methods.",
  "rules": [
    {
      "rule_id": "r1",
      "rule_type": "max_amount",
      "description": "Refunds may not exceed $500 per transaction without escalation",
      "parameters": { "limit": 500, "currency": "USD" }
    },
    {
      "rule_id": "r2",
      "rule_type": "refund_age_limit",
      "description": "Refunds must be requested within 30 days of the original purchase",
      "parameters": { "max_days": 30 }
    },
    {
      "rule_id": "r3",
      "rule_type": "blocked_payment_rails",
      "description": "Refunds may only be issued to the original payment method (card or ACH). No wire transfers or crypto.",
      "parameters": { "rails": ["wire", "crypto", "check", "cash"] }
    },
    {
      "rule_id": "r4",
      "rule_type": "escalate_if",
      "description": "Refunds above $200 require human review before processing",
      "parameters": { "amount_above": 200, "action_types": ["refund"] }
    },
    {
      "rule_id": "r5",
      "rule_type": "duplicate_guard",
      "description": "Block duplicate refund submissions within 10 minutes",
      "parameters": { "window_minutes": 10 }
    },
    {
      "rule_id": "r6",
      "rule_type": "time_restriction",
      "description": "Automated refunds only processed during business hours (Mon-Fri, 8am-8pm UTC)",
      "parameters": {
        "allowed_days": ["mon", "tue", "wed", "thu", "fri"],
        "allowed_hours_utc": "08:00-20:00"
      }
    }
  ],
  "metadata": {
    "template": true,
    "template_id": "support_refund_policy",
    "version_notes": "Starter template for AI support refund agents. Adjust max_amount and refund_age_limit to match your policy."
  }
}
Common customizations:
  • Change max_amount.limit to match your refund cap (e.g., $1,000 for enterprise)
  • Change refund_age_limit.max_days (e.g., 60 days for subscriptions)
  • Remove time_restriction if your support operates 24/7
  • Adjust escalate_if.amount_above to your approval threshold

Template 2: SaaS Discount Policy

Best for: AI pricing agents or sales agents applying discounts. What it does:
  • Blocks discounts over 20%
  • Escalates discounts on deals above $10,000 ACV
  • Blocks automated discounts on enterprise or government contracts
  • Blocks discount values over $5,000
  • Blocks duplicate submissions within 30 minutes
{
  "policy_id": "saas_discount_policy",
  "name": "SaaS Discount Policy",
  "description": "Guardrails for AI agents applying discounts or pricing adjustments. Caps discount depth and escalates unusual pricing decisions.",
  "rules": [
    {
      "rule_id": "r1",
      "rule_type": "discount_cap",
      "description": "Maximum automated discount is 20%. Deeper discounts require human approval.",
      "parameters": { "max_percent": 20 }
    },
    {
      "rule_id": "r2",
      "rule_type": "escalate_if",
      "description": "Discounts on deals above $10,000 ACV require sales manager approval",
      "parameters": { "amount_above": 10000, "action_types": ["discount"] }
    },
    {
      "rule_id": "r3",
      "rule_type": "blocked_categories",
      "description": "No automated discounts on enterprise or government contracts",
      "parameters": { "categories": ["enterprise_contract", "government_contract"] }
    },
    {
      "rule_id": "r4",
      "rule_type": "duplicate_guard",
      "description": "Block duplicate discount submissions within 30 minutes",
      "parameters": { "window_minutes": 30 }
    },
    {
      "rule_id": "r5",
      "rule_type": "max_amount",
      "description": "Maximum discount value (not percentage) is $5,000 per transaction",
      "parameters": { "limit": 5000, "currency": "USD" }
    }
  ],
  "metadata": {
    "template": true,
    "template_id": "saas_discount_policy",
    "version_notes": "Starter template for SaaS pricing agents. Adjust discount_cap and escalate_if thresholds to match your approval workflow."
  }
}
Common customizations:
  • Change discount_cap.max_percent (e.g., 15% for stricter, 30% for flexible)
  • Change escalate_if.amount_above to your deal approval threshold
  • Add customer segments to blocked_categories

Template 3: Vendor Spend Policy

Best for: AI procurement agents making vendor payments. What it does:
  • Blocks payments over $10,000
  • Escalates payments over $2,500 for finance approval
  • Escalates spend over $5,000 for CFO approval
  • Blocks wire and crypto payments
  • Blocks payments to sanctioned countries (RU, KP, IR, BY, CU, SY)
  • Blocks duplicate submissions within 60 minutes
  • Blocks payments outside business hours (Mon-Fri, 9am-5pm UTC)
{
  "policy_id": "vendor_spend_policy",
  "name": "Vendor Spend Policy",
  "description": "Guardrails for AI procurement agents making vendor payments. Enforces approved vendor list, spend limits, and payment method controls.",
  "rules": [
    {
      "rule_id": "r1",
      "rule_type": "max_amount",
      "description": "Automated vendor payments may not exceed $10,000 per transaction",
      "parameters": { "limit": 10000, "currency": "USD" }
    },
    {
      "rule_id": "r2",
      "rule_type": "escalate_if",
      "description": "Payments above $2,500 require finance team approval",
      "parameters": { "amount_above": 2500, "action_types": ["spend"] }
    },
    {
      "rule_id": "r3",
      "rule_type": "blocked_payment_rails",
      "description": "No wire transfers or crypto payments without manual approval",
      "parameters": { "rails": ["wire", "crypto"] }
    },
    {
      "rule_id": "r4",
      "rule_type": "geography_block",
      "description": "Block payments to high-risk jurisdictions",
      "parameters": { "blocked_countries": ["RU", "KP", "IR", "BY", "CU", "SY"] }
    },
    {
      "rule_id": "r5",
      "rule_type": "duplicate_guard",
      "description": "Block duplicate vendor payment submissions within 60 minutes",
      "parameters": { "window_minutes": 60 }
    },
    {
      "rule_id": "r6",
      "rule_type": "time_restriction",
      "description": "Automated payments only processed on business days (Mon-Fri, 9am-5pm UTC)",
      "parameters": {
        "allowed_days": ["mon", "tue", "wed", "thu", "fri"],
        "allowed_hours_utc": "09:00-17:00"
      }
    },
    {
      "rule_id": "r7",
      "rule_type": "escalate_if",
      "description": "Spend above $5,000 requires CFO approval",
      "parameters": { "amount_above": 5000, "action_types": ["spend"] }
    }
  ],
  "metadata": {
    "template": true,
    "template_id": "vendor_spend_policy",
    "version_notes": "Starter template for AI procurement agents. Add vendor_allowlist rule to restrict to approved vendors only."
  }
}
Common customizations:
  • Add a vendor_allowlist rule to restrict to pre-approved vendors
  • Adjust max_amount.limit based on your procurement policy
  • Update geography_block.blocked_countries for your compliance requirements

Template 4: Expense Reimbursement Policy

Best for: AI finance agents processing employee expense claims. What it does:
  • Blocks individual claims over $500
  • Escalates claims over $250 for manager approval
  • Blocks personal expenses, gambling, and luxury categories
  • Allows only ACH and corporate card reimbursements
  • Blocks duplicate submissions within 24 hours
  • Blocks claims for expenses over 60 days old
{
  "policy_id": "expense_reimbursement_policy",
  "name": "Expense Reimbursement Policy",
  "description": "Guardrails for AI agents processing employee expense reimbursements. Enforces per-transaction limits, category rules, and escalation for high-value claims.",
  "rules": [
    {
      "rule_id": "r1",
      "rule_type": "max_amount",
      "description": "Individual expense claims may not exceed $500 without manager approval",
      "parameters": { "limit": 500, "currency": "USD" }
    },
    {
      "rule_id": "r2",
      "rule_type": "escalate_if",
      "description": "Claims above $250 require manager approval",
      "parameters": { "amount_above": 250, "action_types": ["spend"] }
    },
    {
      "rule_id": "r3",
      "rule_type": "blocked_categories",
      "description": "Personal expenses, alcohol, and entertainment above policy limit are blocked",
      "parameters": {
        "categories": ["personal", "alcohol_over_policy", "entertainment_over_policy", "gambling", "luxury_goods"]
      }
    },
    {
      "rule_id": "r4",
      "rule_type": "blocked_payment_rails",
      "description": "Reimbursements only via direct deposit (ACH) or corporate card. No wire, check, or crypto.",
      "parameters": { "rails": ["wire", "crypto", "cash"] }
    },
    {
      "rule_id": "r5",
      "rule_type": "duplicate_guard",
      "description": "Block duplicate expense submissions within 24 hours",
      "parameters": { "window_minutes": 1440 }
    },
    {
      "rule_id": "r6",
      "rule_type": "refund_age_limit",
      "description": "Expense claims must be submitted within 60 days of the expense date",
      "parameters": { "max_days": 60 }
    }
  ],
  "metadata": {
    "template": true,
    "template_id": "expense_reimbursement_policy",
    "version_notes": "Starter template for expense reimbursement agents. Adjust limits to match your company's expense policy."
  }
}
Common customizations:
  • Change max_amount.limit to your per-transaction policy
  • Change escalate_if.amount_above to your manager approval threshold
  • Add or remove categories from blocked_categories
  • Change refund_age_limit.max_days to your submission deadline

How to Load a Template

Copy the JSON and POST it to the policies endpoint:
curl -X POST https://spendguardapi.com/v1/policies \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $SPENDGUARD_API_KEY" \
  -d '{ ... paste template JSON here ... }'
To customize a template: copy the JSON, change the policy_id, adjust the rule parameters, and POST it as a new policy.