spend_decide
Gate AI model calls before execution using token metadata, returning allow/block decisions with signed provenance receipts to enforce spend caps without exposing prompt content.
Instructions
Gate a model call BEFORE it runs. Pass metadata only (model, token counts, endpoint URL), never prompt content. Returns allow/block plus an Ed25519-signed, content-free receipt with model and hosting provenance (weights origin, jurisdiction, retention). Unknown self-hosted models need set_model_cost first (fail-closed). Optional agent_id, task_id and workflow_id accept identifiers only; spend_decide binds them into the signed actor. Read-only and cost-configuration tools accept these fields without recording a spend decision.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>",
"input_tokens": "<input_tokens>",
"output_tokens": "<output_tokens>"
},
"name": "spend_decide"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model name, e.g. llama-3.1-8b-instruct or gpt-5-mini | |
| task_id | No | Optional task identifier; signed as actor.taskId on spend_decide | |
| agent_id | No | Optional agent identifier; signed as actor.agentId on spend_decide | |
| workflow_id | No | Optional workflow identifier; signed as actor.workflowId on spend_decide | |
| endpoint_url | No | Endpoint URL. Unrecognized endpoints route as self-hosted (zero retention, your jurisdiction). | |
| input_tokens | Yes | Projected input tokens | |
| output_tokens | Yes | Projected output tokens |