# Wallet Spend-Limit Policy

> Wallet Spend-Limit Policy is a paid API for AI agents from wallet-portfolio-history-mcp.mtree.workers.dev, paid per call via x402, $0.250000/call, status unknown (last checked 2026-09-15).

Evaluates per-call and per-counterparty spend caps, autopay controls, wallet risk score, and burst signals to produce a pre-payment policy decision for autonomous agents

## Facts

- Endpoint: POST https://wallet-portfolio-history-mcp.mtree.workers.dev/tools/wallet_spend_limit_policy
- Price: $0.250000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/wallet-spend-limit-policy-38f54adb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0JS5qJ23Sz-_6bM97ogwE

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability wallet-spend-limit-policy-38f54adb -d '<json body>'
```

Example prompt: Before my agent pays 50 USDC to counterparty 0xAbC123... from wallet 0xDef456..., check the spend-limit policy — give me the per-call cap status, counterparty exposure, autopay controls, and wallet risk score so I know if it's safe to proceed.

## When to prefer this

Use this endpoint when an autonomous agent needs a pre-payment policy gate — specifically when you need combined per-call caps, per-counterparty exposure limits, autopay controls, burst detection, and a wallet risk score in a single call before authorizing a payment. Prefer over generic risk scorers when you need spend-limit enforcement logic (not just a score) with D1-fresh provenance.

## Known failure modes

- Invalid or unrecognized wallet address returns an error or empty policy
- Stale D1 snapshot may reduce provenance freshness score
- Missing counterparty address prevents per-counterparty cap evaluation
- Network timeout from Blockscout or D1 data source causes partial results
- Payment of 0.25 USDC not fulfilled causes 402 rejection before policy is evaluated

## How this service works

Hosted wallet spend-limit policy for autonomous agents: per-call and per-counterparty caps, autopay spend controls, wallet risk score, transaction-pattern burst signals, counterparty exposure, and fresh D1 provenance before an agent pays. Price 0.25 USDC on Base via x402. Demo: https://wallet-portfolio-history-mcp.mtree.workers.dev/demo/tools/wallet_spend_limit_policy. Contact: https://wallet-portfolio-history-mcp.mtree.workers.dev/contact.

## Output

Returns a structured spend-limit policy decision including per-call cap evaluation, per-counterparty cap status, autopay spend controls, a 0-100 wallet risk score, transaction-pattern burst signals, counterparty exposure summary, and freshness provenance (D1 snapshot timestamp) — giving the agent a clear approve/deny/flag recommendation before executing a payment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum",
        "arbitrum",
        "optimism",
        "polygon"
       ],
       "type": "string"
      },
      "limit": {
       "type": "integer",
       "maximum": 50,
       "minimum": 1
      },
      "address": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      },
      "refresh": {
       "type": "boolean"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/wallet-spend-limit-policy-38f54adb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from wallet-portfolio-history-mcp.mtree.workers.dev](https://www.zero.xyz/host/wallet-portfolio-history-mcp.mtree.workers.dev/llms.txt)
