Sanction
v0.10.0Approval and budget checks before agent spending or tool use.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
sanction_authorize Request spend authorization
Returns a structured decision and readable text. isError:false means the check succeeded, not permission; use authorized and next_action. ALWAYS call this before any purchase, subscription, API credit top-up, or money transfer. Sanction enforces the wallet owner's spend policy: amounts under the auto-approve threshold return immediately; amounts over the escalation threshold pause for human approval; blocked categories are hard-denied. Returns authorized:true with a request_id on approval, or authorized:false with a machine-readable code and remediation hint on denial. When status is 'escalate…
| Parameter | Type | Description |
|---|---|---|
action * | string | Type of spend action: purchase (one-time), subscribe (recurring), transfer (move funds) |
amount_usd * | number | Exact amount in US dollars |
category * | string | Spend category — one of: software, services, research, infrastructure, marketing, legal, other |
merchant * | string | Vendor or service name, e.g. 'Anthropic', 'AWS', 'Stripe' |
description | string | Brief human-readable description of what this spend is for — helps the wallet owner understand escalations |
execution_jwt | string | If this spend is part of an execution (the JWT from sanction_request_execution), pass it here to additionally enforce that execution's hard spend cap. The charge is denied EXEC_BUDGET_EXCEEDED if it w… |
grant_id | string | One-use grant minted when the owner approved a prior escalation of this exact request. Retry with the identical action/amount/merchant/category/description plus this grant_id to consume it. Any field… |
sanction_authorize_provision Request provisioning authorization
Returns a structured decision and readable text. isError:false means the check succeeded, not permission; use authorized and next_action. ALWAYS call this before provisioning any resource — user seats, software licenses, cloud infrastructure, subscriptions with unit counts. One call governs both the resource (the wallet's resource allow/block/escalate lists) and the dollars (the same spend ladder and daily budget as purchases). Amounts or resources over the line pause for human approval; approval mints a one-use grant — retry the exact same request with that grant_id to proceed. Never prov…
| Parameter | Type | Description |
|---|---|---|
amount_usd * | number | Total amount in US dollars |
category * | string | Spend category — shares the wallet's category governance and daily budget, e.g. 'licenses', 'infrastructure' |
line_item * | string | The concrete SKU or plan, e.g. 'Microsoft 365 E3' |
quantity * | integer | Number of units to provision |
resource * | string | What is being provisioned, e.g. 'azure.seat', 'm365.license', 'aws.instance' |
description | string | Brief description of what this provision is for — helps the wallet owner understand escalations |
execution_jwt | string | If part of an execution, pass the JWT to additionally enforce that execution's hard spend cap. |
grant_id | string | One-use grant minted when the owner approved a prior escalation of this exact provision. Retry with identical fields plus this grant_id to consume it. |
unit_price_usd | number | Per-unit price in USD. When supplied, quantity × unit_price_usd must equal amount_usd exactly or the request is rejected AMOUNT_MISMATCH. |
sanction_authorize_tool Request tool authorization
Returns a structured decision and readable text. isError:false means the check succeeded, not permission; use authorized and next_action. Call this BEFORE invoking any other tool or external action (a different MCP tool, a shell command, a deploy, an email send). For a one-off human decision, set require_approval:true and explain why in approval_reason; no policy edit is needed. This pauses even in observe mode, never auto-approves on timeout, and an initial request cannot override a hard denial. Approval is bound to the exact tool, server and arguments; redeem the one-use grant before acting.…
| Parameter | Type | Description |
|---|---|---|
tool * | string | The exact name of the tool/action about to be invoked, e.g. 'github.create_deployment', 'shell.exec', 'email.send' |
approval_reason | string | Why you want the owner to review this action; shown in the approval request. Do not include secrets. |
arguments | object | The arguments the tool would be called with — surfaced to the owner on escalation |
grant_id | string | Redeem a grant minted when the owner approved this tool's escalation — call sanction_check_authorization with the request_id to get the grant_id, then retry this exact request with it |
require_approval | boolean | Ask the owner for a one-off human approval even if policy would allow this action. Never execute while waiting. |
server | string | The MCP server or integration the tool belongs to, e.g. 'github', 'filesystem' — advisory context for the owner |
sanction_authorize_capability Request capability authorization
Returns a structured decision and readable text. isError:false means the check succeeded, not permission; use authorized and next_action. Call this BEFORE acquiring any new capability — installing a skill or plugin, enabling an integration, or calling an API you haven't used before. Sanction enforces the wallet owner's capability policy: blocked capabilities are hard-denied, capabilities off the allow-list are denied, and sensitive ones return escalated for human approval. Returns authorized:true to proceed, or authorized:false with a machine-readable code (CAPABILITY_BLOCKED, CAPABILITY_NOT…
| Parameter | Type | Description |
|---|---|---|
capability * | string | Namespaced identifier of the capability about to be acquired, e.g. 'skill:install:web-scraper', 'plugin:browser', 'api:github.com/repos' |
arguments | object | Advisory context about the acquisition (version, source, config) — surfaced to the owner on escalation, not policy-evaluated |
grant_id | string | One-use grant minted when the owner approved a prior escalation of this exact capability. Retry with the identical capability plus this grant_id to consume it. |
sanction_log_tokens Record model usage
Call this after every LLM inference call (Claude, GPT-4, Gemini, Llama, etc.) to record token consumption. It is metered against three budget horizons — the seat's daily budget, the seat's monthly budget, and the pooled per-department daily token cap — and returns a 402 budget error naming which horizon was hit if any is exceeded; on a budget error the agent should stop making LLM calls and notify the owner. Report the provider's actual billed cost_usd for the call (from the provider's usage/response), not an estimate — under-reporting silently defeats the budget. Prefer routing calls th…
| Parameter | Type | Description |
|---|---|---|
cost_usd * | number | Actual dollar cost of this call — compute from provider pricing or read from API response if available |
model * | string | LLM model identifier exactly as returned by the provider, e.g. claude-sonnet-4-6, gpt-4o, gemini-2.0-flash |
tokens_in * | integer | Input/prompt token count from the API response usage field |
tokens_out * | integer | Output/completion token count from the API response usage field |
task | string | Short label for what this call did, e.g. 'summarize-email', 'plan-task', 'code-review' — used in spend reports |
sanction_log_outcome Record business outcome
Record a business outcome (an enrollment, booking, signed engagement, conversion) against this wallet. Outcomes are what the wallet's spend answers to: Sanction computes cost-per-outcome over a rolling window and, when the wallet has a cost_per_outcome ceiling configured, throttles further spend to human-gated once the ceiling is crossed. Call this when your system confirms a real outcome — never speculatively. Use dedupe_key (e.g. your CRM record id) so retries never double-count.
| Parameter | Type | Description |
|---|---|---|
kind * | string | Outcome kind in your operating vocabulary, lowercase — e.g. 'enrollment', 'booking', 'signed-engagement'. Must match the policy's outcome_kind for ceiling governance. |
dedupe_key | string | Idempotency key unique per outcome (e.g. CRM record id). Same key = same outcome, never double-counted. |
play | string | Optional campaign/play label for reporting, e.g. 'speed-to-lead' |
value_usd | number | Optional dollar value of the outcome (e.g. expected LTV or contract value) — reporting only, not governance |
sanction_request_execution Request scoped execution token
Mint a short-lived mandate (signed JWT) for a child agent, subprocess, or counterparty: credential scope plus a hard spend cap. Pass the JWT — never the root pxy_ key. Default 15 min, wallet-bound, freeze-aware. The other party verifies it at POST /mandate/verify with no API key. Required before sanction_inject_credential.
| Parameter | Type | Description |
|---|---|---|
budget_usd * | number | Hard spend cap for this execution in USD. The execution cannot authorize more than this amount even if the wallet policy allows more. Use the minimum amount needed. |
scope * | array | List of credential labels the execution needs — e.g. ['STRIPE_KEY', 'OPENAI_API_KEY']. Only these labels will be injectable with the returned JWT. Request minimum required scope. |
ttl_seconds | integer | Token lifetime in seconds. Default 900 (15 min). Use shorter values for quick tasks; max 3600 (1 hour) for long-running jobs. |
sanction_inject_credential Retrieve scoped credential
Retrieve a decrypted credential value using a scoped execution JWT. Every injection is audit-logged with timestamp, agent ID, and credential label — raw values are never logged. Use the credential value immediately and do not store it in memory, files, or logs. Fails if the JWT is expired, revoked, or if the requested credential label was not in the original scope.
| Parameter | Type | Description |
|---|---|---|
credential_label * | string | Exact label of the credential to retrieve — must match one of the labels in the JWT scope, e.g. 'STRIPE_KEY', 'DATABASE_URL'. Case-sensitive. |
jwt * | string | Execution JWT returned by sanction_request_execution. Must not be expired. |
sanction_wallet_status Check budget and approval status
Check the wallet's current spend and token budget consumption. Returns today's and month-to-date LLM token costs and real-money spend, plus a count of authorization requests pending human approval. Call this at the start of long agentic tasks to confirm budget headroom before initiating expensive operations, or when a prior authorize/log_tokens call returns a budget error.
sanction_check_authorization Check and settle authorization
Returns a structured decision and readable text. isError:false means the check succeeded, not permission; use authorized and next_action. Poll an authorization request that returned 'escalated', to see whether the wallet owner has approved it yet. Pass the request_id from the escalated authorize/provision/tool response. While pending, pause and wait for human review, then check once; do not poll indefinitely. This check always returns authorized:false. Only next_action:retry_with_grant exposes a usable active grant: retry the ORIGINAL authorize call with identical fields plus that grant_id; ex…
| Parameter | Type | Description |
|---|---|---|
request_id * | string | The request_id from an escalated authorize/provision/tool response |