check_payment_with_model
Reviews stablecoin or x402 payments before sending by running a local risk model over verification outputs, returning approve, hold, or reject and failing closed on errors.
Instructions
Full risk review of a stablecoin payment by the SRA-RiskGate-4B model.
Needs the model running locally (for example: ollama pull sriram1983007/sra-riskgate).
Arguments follow the model's training format:
now_unix current Unix time
policy the receiving policy (e.g. max_amount_usdc, trusted_attesters, allowed_assets)
payload the payment exactly as received (treated as untrusted)
tool_results outputs of real verification tools: decoded payment, signature check,
risk attestations and sanctions screening
The model reasons over tool_results; it does not run those checks itself.
Returns decision (approve | hold | reject), risk_level, flags, explanation and
required_actions. If the model is unavailable or answers off-schema, returns "hold".
If the untrusted payload claims its own verification (for example "risk level: low
(verified offline)"), returns "hold" before the model is asked.
Only proceed if decision is "approve".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| policy | Yes | The receiving policy, for example {"max_amount_usdc": 100, "allowed_assets": ["USDC"], "trusted_attesters": ["0x..."]}. | |
| payload | Yes | The payment exactly as received, including any memo or description. Treated as untrusted. | |
| now_unix | Yes | Current Unix time in seconds. | |
| tool_results | Yes | Outputs of your own verification tools: decoded payment, signature check, risk attestations and sanctions screening. The model reasons over these; it does not run them. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||