---
name: allowanceguard
description: Deterministic pre-approval allowance checks for Base agents, paid per call.
---

# AllowanceGuard

AllowanceGuard answers one question before an agent signs an irreversible approve: should this spender get this allowance. It reads the allowance the spender already holds, classifies the one being requested against the token's own supply rather than a list of sentinel values, and says whether signing raises or lowers exposure — so reducing an unlimited allowance is recognised as safer than the status quo instead of flagged as another approval. It checks whether the spender is a contract at all, whether its code can be swapped after the grant, and whether it is on the denylist. There is no model anywhere in it. When a fact cannot be read the answer is unknown, never a quiet allow.

## When to use this

Use `POST https://allowance.schemasure.com/v1/guard/allowance` when you need: Decide whether to grant a token allowance before signing the approve.

## How to pay

1. Send the request without payment. You receive HTTP 402 and a base64 `PAYMENT-REQUIRED` header.
2. Decode it, sign one of the `accepts` entries with your wallet locally.
3. Retry the identical request with the `PAYMENT-SIGNATURE` header.
4. A successful response carries a `PAYMENT-RESPONSE` receipt.

Cost: $0.015 in USDC on Base mainnet. Failed calls are free.
Your private key never leaves your process.

## Request

```json
{
  "calldata": {
    "from": "0x9F2C5E4A8db1C3a7E6B0d4f8C1E2a5b7D9C0e3F4",
    "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "data": "0x095ea7b30000000000000000000000002626664c2603336e57b271c5c0b26f421741e4810000000000000000000000000000000000000000000000000000000000000000"
  }
}
```

## Response

```json
{
  "ok": true,
  "verdict": "allow",
  "confidence": 1,
  "risk_codes": [],
  "evidence": [
    {
      "code": "CURRENT_ALLOWANCE_UNREADABLE",
      "severity": "info",
      "detail": "The allowance 0x2626664c2603336E57B271c5C0b26F421741e481 already holds could not be read: no RPC endpoint is configured, so the allowance this spender already holds could not be read. Whether this request adds to an existing allowance or replaces one is therefore unknown. It does not change the answer: this request cannot increase what the spender can move.",
      "source": "rpc"
    },
    {
      "code": "SPENDER_CODE_UNREADABLE",
      "severity": "info",
      "detail": "Whether 0x2626664c2603336E57B271c5C0b26F421741e481 is a contract or an account could not be determined: no RPC endpoint is configured, so it is unknown whether the spender has code. It does not change the answer: this request cannot increase what the spender can move.",
      "source": "rpc"
    },
    {
      "code": "SPENDER_PROXY_OPAQUE",
      "severity": "info",
      "detail": "The code that would execute on 0x2626664c2603336E57B271c5C0b26F421741e481's behalf could not be resolved: no RPC endpoint is configured, so no slot could be read. An allowance to a contract whose executing code is unknown is an allowance to unknown code. It does not change the answer: this request cannot increase what the spender can move.",
      "source": "rpc"
    }
  ],
  "result": {
    "input_shape": "calldata",
    "chain": "eip155:8453",
    "request": {
      "kind": "erc20_approve",
      "mode": "absolute",
      "owner": "0x9f2C5E4a8DB1C3A7e6b0d4f8C1e2A5b7d9c0E3f4",
      "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "spender": "0x2626664c2603336E57B271c5C0b26F421741e481",
      "amount": "0",
      "expiration": null,
      "deadline": null,
      "token_id": null,
      "target": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "summary": "Revoke 0x2626664c2603336E57B271c5C0b26F421741e481's allowance on token 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 by setting it to zero."
    },
    "decode": {
      "selector": "0x095ea7b3",
      "signature": "approve(address,uint256)",
      "source": "bundled-abi",
      "trace": [
        "verified-abi: no candidate",
        "bundled-abi: resolved to approve(address,uint256)"
      ],
      "candidates": []
    },
    "classification": {
      "scope": "bounded",
      "subject": "resulting_allowance",
      "basis": "the allowance is zero, which is bounded without reference to the token's supply",
      "supply_checked": true,
      "total_supply": null,
      "resulting_allowance": "0"
    },
    "current": {
      "amount": null,
      "source": "unreadable",
      "expiration": null,
      "detail": "no RPC endpoint is configured, so the allowance this spender already holds could not be read"
    },
    "delta": {
      "direction": "unknown",
      "increases_exposure": false,
      "difference": null,
      "detail": "this sets the allowance to zero, which cannot increase exposure whatever it is now; the value being replaced could not be read, so whether it is a reduction or already zero is unknown"
    },
    "approval": {
      "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "owner": "0x9f2C5E4a8DB1C3A7e6b0d4f8C1e2A5b7d9c0E3f4",
      "spender": "0x2626664c2603336E57B271c5C0b26F421741e481",
      "amount": "0",
      "scope": "bounded",
      "basis": "the allowance is zero, which is bounded without reference to the token's supply",
      "spender_is_contract": null,
      "total_supply": null,
      "expiration": null
    },
    "spender": {
      "address": "0x2626664c2603336E57B271c5C0b26F421741e481",
      "is_contract": null,
      "detail": "no RPC endpoint is configured, so it is unknown whether the spender has code",
      "proxy": {
        "address": "0x2626664c2603336E57B271c5C0b26F421741e481",
        "kind": "unknown",
        "implementation": null,
        "admin": null,
        "beacon": null,
        "upgradeable": null,
        "slots_probed": [],
        "detail": "no RPC endpoint is configured, so no slot could be read"
      }
    },
    "token": {
      "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "has_code": null,
      "code_size": null,
      "symbol": null,
      "decimals": null,
      "total_supply": null,
      "is_erc721": null,
      "detail": "no RPC configured, so code presence could not be read; no RPC configured, so token metadata could not be read"
    },
    "denylist_hits": [],
    "unresolved": [
      "The allowance 0x2626664c2603336E57B271c5C0b26F421741e481 already holds could not be read: no RPC endpoint is configured, so the allowance this spender already holds could not be read. Whether this request adds to an existing allowance or replaces one is therefore unknown.",
      "Whether 0x2626664c2603336E57B271c5C0b26F421741e481 is a contract or an account could not be determined: no RPC endpoint is configured, so it is unknown whether the spender has code.",
      "The code that would execute on 0x2626664c2603336E57B271c5C0b26F421741e481's behalf could not be resolved: no RPC endpoint is configured, so no slot could be read. An allowance to a contract whose executing code is unknown is an allowance to unknown code."
    ],
    "rpc": {
      "configured": false,
      "reachable": null,
      "endpoints": []
    }
  },
  "policy_version": "2026-09-19",
  "request_hash": "sha256:a88cb1eea90d411505068349493a5cf35a1f2b46f4cbb4185330ffd4094c65fb",
  "data_versions": {
    "denylist": "2026-08-03.1",
    "abi_packs": "2026-08-03.1",
    "signature_index": "2026-08-03.1",
    "policy": "2026-09-19",
    "chain": "eip155:8453",
    "allowance_sentinels": "4"
  },
  "warnings": []
}
```

## Reading the verdict

- `resolved` / `pass` / `allow` — the service answered and the answer is usable.
- `warn` — usable, but `evidence` contains findings you should act on.
- `block` — the service is telling you not to proceed. Read `risk_codes`.
- `unknown` — the service could not determine the answer. **Do not treat this as safe.**
