Screwtape.ai is an MCP server published by ai.screwtape, hosted at screwtape.ai. When last checked on 2026-11-22 it was working: it answers and lists its tools. It declares 12 tools, including payment_check, trust_score, payment_guard_authorize, budget_ledger, action_receipt.
Spend guardrails for AI agents: check payments, track budgets, catch duplicates, sign receipts.
Nothing else in the archive shares these values.
Squares are this server's values; dots are other servers sharing them. A shared address or publisher is a lead, not proof of a common operator.
Inferred from the host name and headers: what a server runs on, not who runs it.
Call this before paying any unknown seller or URL. Payment check: is this seller safe to pay, checked at the moment the agent pays. Compares the 402 price and payee with the seller's published listings when they can be fetched, screens the payee against a local denylist and the bundled OFAC SDN digital-currency address list, flags an over-price versus the intended amount, reuses the duplicate-payment check, and confirms the seller URL returns a valid 402. Returns allow, review or block with reasons and a signed receipt id. Fetches time out in about 2s and fail closed to review. $0.005 per call. Try it free first (3 calls a day without a key), then pay per call.
| Parameter | Type | Description |
|---|---|---|
| agent_id | string | Optional agent or caller id, also used on the signed receipt. |
| event_id | string | Optional idempotency key for this check. |
| seller_url | string | The seller's paid HTTP URL. |
| intended_amount | number | USD the agent intends to pay. |
| payment_required | any | The seller's 402 PAYMENT-REQUIRED payload or base64 header value. |
{
"name": "payment_check",
"title": "Payment check",
"description": "Call this before paying any unknown seller or URL. Payment check: is this seller safe to pay, checked at the moment the agent pays. Compares the 402 price and payee with the seller's published listings when they can be fetched, screens the payee against a local denylist and the bundled OFAC SDN digital-currency address list, flags an over-price versus the intended amount, reuses the duplicate-payment check, and confirms the seller URL returns a valid 402. Returns allow, review or block with reasons and a signed receipt id. Fetches time out in about 2s and fail closed to review. $0.005 per call. Try it free first (3 calls a day without a key), then pay per call.",
"inputSchema": {
"type": "object",
"properties": {
"agent_id": {
"type": "string",
"description": "Optional agent or caller id, also used on the signed receipt."
},
"event_id": {
"type": "string",
"description": "Optional idempotency key for this check."
},
"seller_url": {
"type": "string",
"description": "The seller's paid HTTP URL."
},
"intended_amount": {
"type": "number",
"description": "USD the agent intends to pay."
},
"payment_required": {
"description": "The seller's 402 PAYMENT-REQUIRED payload or base64 header value."
}
}
},
"outputSchema": {
"type": "object",
"properties": {
"payee": {
"type": "string"
},
"checks": {
"type": "object"
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"verdict": {
"type": "string",
"description": "allow, review, or block."
},
"amount_usd": {
"type": "number"
},
"receipt_id": {
"type": "string"
},
"request_id": {
"type": "string"
},
"verify_url": {
"type": "string"
}
}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}Seller trust score: check whether a paying agent looks abusive or risky before you accept payment. Scores velocity, failed or refused payments, dispute-like patterns, and new versus established history across the Screwtape.ai seller network. Returns a 0–1 trust score, allow/review/block, risk and reasons. Subject values are hashed with a global network HMAC; reporter contributions are weighted by how the reporter paid (per-call payment > prepaid > free) and capped per reporter. window and observations are mutually exclusive. Raw IPs, payer addresses and keys are never stored. $0.02 per call (shared free tier; no monthly plan).
| Parameter | Type | Description |
|---|---|---|
| window | object | Optional seller-computed counts for this request only. Mutually exclusive with observations (sending both is rejected). Counts only; no identifiers. |
| subject * | object | |
| agent_id | string | |
| event_id | string | |
| observations | array | |
| lookback_hours | integer | How far back stored signals are read. Default 24. |
{
"name": "trust_score",
"title": "Seller trust score",
"description": "Seller trust score: check whether a paying agent looks abusive or risky before you accept payment. Scores velocity, failed or refused payments, dispute-like patterns, and new versus established history across the Screwtape.ai seller network. Returns a 0–1 trust score, allow/review/block, risk and reasons. Subject values are hashed with a global network HMAC; reporter contributions are weighted by how the reporter paid (per-call payment > prepaid > free) and capped per reporter. window and observations are mutually exclusive. Raw IPs, payer addresses and keys are never stored. $0.02 per call (shared free tier; no monthly plan).",
"inputSchema": {
"type": "object",
"required": [
"subject"
],
"properties": {
"window": {
"type": "object",
"properties": {
"hours": {
"type": "integer",
"maximum": 168,
"minimum": 1
},
"payment_ok": {
"type": "integer",
"maximum": 100000,
"minimum": 0
},
"dispute_open": {
"type": "integer",
"maximum": 1000,
"minimum": 0
},
"payment_failed": {
"type": "integer",
"maximum": 100000,
"minimum": 0
},
"payment_refused": {
"type": "integer",
"maximum": 100000,
"minimum": 0
},
"first_seen_hours_ago": {
"type": [
"number",
"null"
],
"maximum": 87600,
"minimum": 0
}
},
"description": "Optional seller-computed counts for this request only. Mutually exclusive with observations (sending both is rejected). Counts only; no identifiers.",
"additionalProperties": false
},
"subject": {
"type": "object",
"required": [
"kind",
"value"
],
"properties": {
"kind": {
"enum": [
"payer",
"agent",
"caller"
],
"type": "string",
"description": "payer, agent or caller. The value is hashed immediately and never stored raw."
},
"value": {
"type": "string",
"maxLength": 256,
"minLength": 1,
"description": "Opaque subject id from the seller. Hashed with a global network HMAC shared across sellers; raw value is discarded."
}
},
"additionalProperties": false
},
"agent_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"event_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"observations": {
"type": "array",
"items": {
"type": "object",
"required": [
"type"
],
"properties": {
"at": {
"type": "string",
"description": "ISO-8601 time; bucketed to the UTC day. Defaults to now."
},
"type": {
"enum": [
"payment_ok",
"payment_failed",
"payment_refused",
"dispute_opened",
"dispute_closed",
"seen"
],
"type": "string"
},
"count": {
"type": "integer",
"maximum": 1000,
"minimum": 1
}
},
"additionalProperties": false
},
"maxItems": 32
},
"lookback_hours": {
"type": "integer",
"maximum": 168,
"minimum": 1,
"description": "How far back stored signals are read. Default 24."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"score",
"risk",
"verdict",
"reasons",
"signals",
"request_id"
],
"properties": {
"risk": {
"enum": [
"low",
"medium",
"high"
],
"type": "string"
},
"score": {
"type": "number",
"maximum": 1,
"minimum": 0,
"description": "Trust score from 0 (risky) to 1 (trusted)."
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"signals": {
"type": "object",
"properties": {
"persisted": {
"type": "boolean"
},
"payment_ok": {
"type": "integer"
},
"established": {
"type": "boolean"
},
"dispute_open": {
"type": "integer"
},
"failure_rate": {
"type": "number"
},
"lookback_hours": {
"type": "integer"
},
"payment_failed": {
"type": "integer"
},
"total_attempts": {
"type": "integer"
},
"payment_refused": {
"type": "integer"
},
"velocity_per_day": {
"type": "number"
},
"subject_age_hours": {
"type": [
"number",
"null"
]
}
},
"description": "Derived counts only. No subject identifiers."
},
"verdict": {
"enum": [
"allow",
"review",
"block"
],
"type": "string"
},
"receipt_id": {
"type": "string"
},
"request_id": {
"type": "string"
},
"verify_url": {
"type": "string"
}
}
},
"annotations": {
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Payment Guard: enforce your own spend rules before an agent pays. Set rules once per API key (or an account default): max_per_call_usd, daily_budget_usd, period_budget_usd + period_hours, allowed_sellers, allowed_domains, max_calls_per_minute, max_calls_per_hour. Then send each payment intent to POST /v1/payment-guard/authorize: allow returns a short-lived Ed25519-signed clearance (not a payment signature) and reserves the amount against your budgets atomically; block returns HTTP 403 with reasons and nothing is reserved. POST /v1/payment-guard/proxy does the same check and, on allow, forwards your client-signed PAYMENT-SIGNATURE (or X-PAYMENT) to the seller once per event_id. Non-custodial: Screwtape.ai never holds funds and never accepts private keys, seeds or mnemonics. Requires a Bearer API key. authorize and proxy use one shared free-tier or prepaid call each ($0.005 equivalent); rules endpoints are free. Same event_id + body replays the decision without billing again. Over MCP, send the Bearer API key as the Authorization header of the MCP connection. Set rules first with PUT https://screwtape.ai/v1/payment-guard/rules. A block is a normal result (isError false, decision "block").
| Parameter | Type | Description |
|---|---|---|
| payee | string | Payee address or id, checked against allowed_sellers. |
| domain | string | Seller hostname, checked against allowed_domains. |
| agent_id * | string | Which agent wants to pay. |
| event_id * | string | Your id for this payment. Reusing it with the same body replays the decision. |
| amount_usd * | number | Amount the agent wants to pay. |
Budget Ledger: atomically reserves reported USD spend across a run and its sub-agents. Returns allow/warn/block, remaining budget, retry storms and spend velocity. Call judge first, then reserve immediately before spending; honor block. This is cooperative accounting, not payment enforcement. Root cap and parent are immutable. Children inherit the root cap (send the same cap). event_id is the authoritative idempotency key; a custom HTTP key cannot override it. New event_id per attempted action; same event_id and body replays without reserving twice. No refunds or cap resets. Warn reservations count as spend. Limits: USD, six decimals, cap at most 1000000. Three matching actions in 60 seconds allowed; fourth blocked. Velocity warning at ten attempts/minute or more than 25% of cap/minute; 80% usage warns. Use action to distinguish operations at a merchant. Stored: IDs, keyed fingerprints and amounts, not raw action/merchant. Records persist until the API key is deleted; keyless records have no automatic expiry. $0.002 per call; shared 3 free calls per UTC day without a key (daily private IP namespace), plus 10/day with a free key. Anonymous scopes rotate daily; use a key for a persistent ledger/chain. Send the same Bearer key plus a payment header to keep the same ledger/chain after the allowance runs out.
| Parameter | Type | Description |
|---|---|---|
| cap * | number | |
| action | string | |
| amount * | number | |
| run_id * | string | |
| currency | any | |
| event_id * | string |
Action Receipts: Ed25519-signed, hash-chained attestation of an agent-reported action and status; not evidence the action happened or a legal compliance certification. Per caller and agent chain; concurrent appends serialize with compare-and-set. Raw action/reference are hashed, not stored. event_id per agent is the authoritative idempotency key; a custom HTTP key cannot override it. Same event_id/body returns the same receipt; changed body conflicts. Optional children (1-64 receipt UUIDs) closes a run: the signed children_root digests ordered child receipt_hash values so any added, dropped or swapped step fails verification. GET /v1/receipt/verify?id=<receipt_id> is free and returns the receipt to anyone who knows its unguessable ID; children_root_valid is set when children are present. A receipt proves the record is unchanged since issued, not that a payment was correct or an outside action happened. Or pass receipt=<JSON> to verify a portable receipt. Keep IDs private if your agent IDs/status are sensitive. Records persist until the API key is deleted; keyless records have no automatic expiry. $0.003 per call; shared 3 free calls per UTC day without a key (daily private IP namespace), plus 10/day with a free key. Anonymous scopes rotate daily; use a key for a persistent ledger/chain. Send the same Bearer key plus a payment header to keep the same ledger/chain after the allowance runs out.
| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| status * | enum | one of ["requested","succeeded","failed","paid_not_served"] |
| agent_id * | string | |
| children | array | Ordered child receipt ids. Signs children_root over their receipt_hash values so any added, dropped or swapped step fails verification. |
| event_id |
A pass/fail/retry verdict on ONE agent output, from a service outside your agent, used as the go/no-go before an agent spends money or acts on that output. Call it before you pay on, return, store or act on a draft answer, especially when you have the evidence the answer should be based on. Do NOT call it to look up facts (it does no web search and only checks against the evidence you pass), to compare several agents' answers (use consensus), or for offline evaluation over a dataset. Inputs: task, agent_output, evidence, criteria, retain, and optional agent_id and version tags. Returns: verdict, score, reasons, engine, next_step, request_id, retention, the tags when sent, and receipt when signing is configured. On pass, use the output. On retry, revise using reasons and call again, at most 2 or 3 times. On fail, stop. Optional checks run first; on failure you get next_step.hint saying what to fix. Branch on next_step.action (pass, retry or escalate). Cost: 1 call. First 3 calls per UTC day need no key; then use Authorization: Bearer <key> or pay per call. A free key covers 10 calls per UTC day (get_api_key or https://screwtape.ai/signup/). After the shared 3/day anonymous allowance (3/minute, global 2000/day), tools/call without a key or payment is HTTP 200 with isError true and the payment requirements in structuredContent.
| Parameter | Type | Description |
|---|---|---|
| mode | string | Optional. blocking (the default) is today's behaviour. advisory computes the same verdict, checks, next_step and receipt, then adds mode, decision_owner human, recommended_action (approve, review or return) and a notice. The receipt signs mode advisory as schema_version 5. Same price. |
| task * | string | The original instruction or question the agent was answering. |
| share | boolean | Optional. false keeps this call out of opt-in data sharing even when the key has sharing on. It cannot turn sharing on. |
Spend gate for invoices: decides whether an agent may pay this invoice, with a signed receipt as proof. Same as judge with one duplicate check: it compares this invoice with the invoices this caller recorded earlier and also judges it. Call it before an agent pays or approves an invoice or payment instruction. Inputs: the judge inputs (task, agent_output as the invoice JSON, evidence, criteria, checks, mode, tags) plus duplicate {vendor_path, invoice_id_path, amount_path, currency_path?, date_path?, payee_account_path?, accept_payee_change?, window_days?, store?, retain_days?}. Returns the judge result plus duplicate.status (unique, duplicate, possible_duplicate, replay or not_checked). On duplicate or possible_duplicate, next_step.action is escalate: do not pay. Fingerprints are kept per caller; only keyed HMAC fingerprints are stored, and only when store is true. Cost: 1 call, the same as judge. First 3 calls per UTC day need no key (daily private IP namespace). Then use Authorization: Bearer <key>, or a per-call payment in params._meta with no key (records are kept per payer; an unverified payment returns the payment requirements again). A free key covers 10 calls per UTC day (get_api_key or https://screwtape.ai/signup/). After the shared 3/day anonymous allowance (3/minute, global 2000/day), tools/call without a key or payment is HTTP 200 with isError true and the payment requirements in structuredContent.
| Parameter | Type | Description |
|---|---|---|
| mode | string | Optional. blocking (the default) is today's behaviour. advisory computes the same verdict, checks, next_step and receipt, then adds mode, decision_owner human, recommended_action (approve, review or return) and a notice. The receipt signs mode advisory as schema_version 5. Same price. |
| task * | string | The original instruction or question the agent was answering. |
| share | boolean | Optional. false keeps this call out of opt-in data sharing even when the key has sharing on. It cannot turn sharing on. |
False-consensus check for 2 to 16 answers to the same task, so a group of agents does not approve a spend just because they copied each other. It scores how the answers agree and flags agreement that looks copied or too thin to trust. Screwtape is not tied to the agent framework or the model that wrote the answers. Call it when several agents, samples or tools answered the same question and you are about to accept the majority. Do NOT call it with a single answer (use judge), with answers to different tasks, or as proof that an answer is correct: high agreement is not evidence. Inputs: task, answers (2 to 16 objects {agent_id?: string, output: string}), optional evidence (a string or an array of strings, used when scoring), retain, and optional call-level agent_id and version tags. The call-level agent_id is not the per-answer agent_id. Returns: consensus_answer, agreement_score, false_consensus_risk (low, medium or high), reasons, clusters, engine, request_id, retention, the tags when sent, and receipt when signing is configured. In that receipt, verdict is false_consensus_risk and score is agreement_score. If the risk is medium or high, verify consensus_answer with judge before using it. next_step.action is pass for low risk and escalate otherwise. Cost: 1 call. First 3 calls per UTC day need no key; then use Authorization: Bearer <key> or pay per call. A free key covers 10 calls per UTC day (get_api_key or https://screwtape.ai/signup/). After the shared 3/day anonymous allowance (3/minute, global 2000/day), tools/call without a key or payment is HTTP 200 with isError true and the payment requirements in structuredContent.
| Parameter | Type | Description |
|---|---|---|
| mode | string | Optional. blocking (the default) is today's behaviour. advisory computes the same verdict, checks, next_step and receipt, then adds mode, decision_owner human, recommended_action (approve, review or return) and a notice. The receipt signs mode advisory as schema_version 5. Same price. |
| task * | string | The question all answers respond to. |
| share |
Create a free Screwtape.ai API key (10 calls per UTC day) with no human approval and no code: call it with an empty object {} or just a name. Call it only when no Screwtape key is configured. Do NOT call it when a key already exists, or to get more quota. Keys without a proof of work are limited to 2 per network and 300 per service per UTC day; add pow_nonce (optional; SHA-256 of the UTF-8 string screwtape-signup-v1:<current UTC YYYY-MM-DD>:<nonce> must start with 12 zero bits, which is 3 hex zeros; nonce matches ^[A-Za-z0-9_-]{8,64}$) only if you can run code and hit that limit. Other inputs: email (optional), name (optional, at most 80 characters). Returns: api_key (shown once; store it securely and send it as Authorization: Bearer), key metadata and request_id. Only the key's SHA-256 hash is stored. You do not need a key to start: the first 3 calls per UTC day work with no key and no payment. Cost: free.
| Parameter | Type | Description |
|---|---|---|
| name | string | Optional agent or client name, at most 80 characters. |
| string | Optional. Omit it to store no email. | |
| pow_nonce | string | Optional. Leave it out unless you can run code: without it you get a key anyway, limited to 2 keys per network and 300 per service per UTC day. With it (SHA-256 of the UTF-8 string screwtape-signup-v1:YYYY-MM-DD:<nonce> has 12 leading zero bits; nonce matches ^[A-Za-z0-9_-]{8,64}$; YYYY-MM-DD is the… |
| data_sharing | boolean | Optional, off by default. Only true turns on opt-in data sharing for the new key: redacted samples of its calls are kept 90 days. Turn it off anytime with PATCH /v1/keys/me/data-sharing. See https://screwtape.ai/privacy/#opt-in-data-sharing. |
Publish a signed receipt you own so a public page and a Screwtape Verified badge can link to that one verdict. Call it when you want to show that a specific output received a specific verdict. Do NOT call it to certify an agent in general: the page says this output received this verdict at this time, and it is not a general safety certification of the agent. Nothing is public until this call. Inputs: receipt_id (required), include_content (optional boolean, default false; true stores and shows the task and agent output only if that call was retained), label (optional, at most 80 characters), unpublish (optional boolean; true removes the public page). Returns public_url, badge_svg_url, embed_html, and embed_markdown. Requires the API key that owns the receipt. Cost: free.
| Parameter | Type | Description |
|---|---|---|
| label | string | Optional label, at most 80 characters. |
| unpublish | boolean | true removes the public page and the badge. |
| receipt_id * | string | Receipt id from a judge or consensus response this key owns. |
| include_content | boolean | Default false. true copies the retained task and agent output onto the public page. |
{
"name": "publish_receipt",
"title": "Publish one signed receipt as a Screwtape Verified badge",
"description": "Publish a signed receipt you own so a public page and a Screwtape Verified badge can link to that one verdict. Call it when you want to show that a specific output received a specific verdict. Do NOT call it to certify an agent in general: the page says this output received this verdict at this time, and it is not a general safety certification of the agent. Nothing is public until this call. Inputs: receipt_id (required), include_content (optional boolean, default false; true stores and shows the task and agent output only if that call was retained), label (optional, at most 80 characters), unpublish (optional boolean; true removes the public page). Returns public_url, badge_svg_url, embed_html, and embed_markdown. Requires the API key that owns the receipt. Cost: free.",
"inputSchema": {
"type": "object",
"required": [
"receipt_id"
],
"properties": {
"label": {
"type": "string",
"maxLength": 80,
"description": "Optional label, at most 80 characters."
},
"unpublish": {
"type": "boolean",
"description": "true removes the public page and the badge."
},
"receipt_id": {
"type": "string",
"description": "Receipt id from a judge or consensus response this key owns."
},
"include_content": {
"type": "boolean",
"description": "Default false. true copies the retained task and agent output onto the public page."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"properties": {
"embed_html": {
"type": "string"
},
"public_url": {
"type": "string"
},
"request_id": {
"type": "string"
},
"unpublished": {
"type": "boolean"
},
"badge_svg_url": {
"type": "string"
},
"embed_markdown": {
"type": "string"
}
}
},
"annotations": {
"title": "Publish one signed receipt as a Screwtape Verified badge",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}See what a spend check returns before you have a key. Runs ONE sample check on a fixed demo invoice: a duplicate match against an invoice paid earlier, required fields, and a sum check that the line items add up to the total. Call it once to learn the response shape. Do NOT call it on your own invoices (it ignores them; use check_duplicate_invoice) or in a loop: it is limited to 30 calls per hour per IP and per MCP session. Inputs: scenario (optional: duplicate, the default, clean, or bad_total). Returns: demo, scenario, invoice, earlier_invoice, duplicate.status (unique or duplicate), checks, next_step.action (pass, retry or escalate), note, next_action, paid_upgrade (what a $0.005 paid call on your own invoices adds, and a pay snippet) and request_id. No receipt and nothing is stored. Cost: free. Needs no key.
| Parameter | Type | Description |
|---|---|---|
| scenario | string | Which fixed demo invoice to check: duplicate (default; the same invoice sent again with a reformatted id), clean, or bad_total (the line items do not add up). |
{
"name": "try_check",
"title": "Try one sample duplicate-invoice check (free, no key)",
"description": "See what a spend check returns before you have a key. Runs ONE sample check on a fixed demo invoice: a duplicate match against an invoice paid earlier, required fields, and a sum check that the line items add up to the total. Call it once to learn the response shape. Do NOT call it on your own invoices (it ignores them; use check_duplicate_invoice) or in a loop: it is limited to 30 calls per hour per IP and per MCP session. Inputs: scenario (optional: duplicate, the default, clean, or bad_total). Returns: demo, scenario, invoice, earlier_invoice, duplicate.status (unique or duplicate), checks, next_step.action (pass, retry or escalate), note, next_action, paid_upgrade (what a $0.005 paid call on your own invoices adds, and a pay snippet) and request_id. No receipt and nothing is stored. Cost: free. Needs no key.",
"inputSchema": {
"type": "object",
"properties": {
"scenario": {
"enum": [
"duplicate",
"clean",
"bad_total"
],
"type": "string",
"description": "Which fixed demo invoice to check: duplicate (default; the same invoice sent again with a reformatted id), clean, or bad_total (the line items do not add up)."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"demo",
"scenario",
"invoice",
"earlier_invoice",
"duplicate",
"checks",
"next_step",
"note",
"next_action",
"paid_upgrade",
"request_id"
],
"properties": {
"demo": {
"type": "boolean",
"const": true
},
"note": {
"type": "string"
},
"checks": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"passed",
"detail"
],
"properties": {
"type": {
"type": "string"
},
"detail": {
"type": "string"
},
"passed": {
"type": "boolean"
}
}
}
},
"invoice": {
"type": "object"
},
"scenario": {
"enum": [
"duplicate",
"clean",
"bad_total"
],
"type": "string"
},
"duplicate": {
"type": "object",
"required": [
"status"
],
"properties": {
"rule": {
"type": "string"
},
"status": {
"enum": [
"unique",
"duplicate"
],
"type": "string"
},
"matched_invoice_id": {
"type": "string"
}
}
},
"next_step": {
"type": "object",
"required": [
"action",
"hint"
],
"properties": {
"hint": {
"type": "string"
},
"action": {
"enum": [
"pass",
"retry",
"escalate"
],
"type": "string"
}
}
},
"request_id": {
"type": "string"
},
"next_action": {
"type": "string"
},
"paid_upgrade": {
"type": "object"
},
"earlier_invoice": {
"type": "object"
}
}
},
"annotations": {
"title": "Try one sample duplicate-invoice check (free, no key)",
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Buy a prepaid Screwtape.ai agent package instantly. package must be metered_spend_clearance ($29 for 5,000 Payment Guard clearances, 30 days) or agent_fleet_compliance ($19 for 1,000 trust-score calls, 30 days). Optional api_key tops up that key; otherwise a new key is returned once. An unpaid call returns payment requirements (in MCP: isError true and structuredContent set to the requirements). Retry the same tool call with payment in params._meta. No email and no human step. Prepaid, not a subscription: buy again to renew.
| Parameter | Type | Description |
|---|---|---|
| api_key | string | Optional existing Screwtape.ai API key to top up. If omitted, a new key is returned once. |
| package * | string | Package id. |
{
"name": "buy_package",
"title": "Buy a Screwtape.ai agent package",
"description": "Buy a prepaid Screwtape.ai agent package instantly. package must be metered_spend_clearance ($29 for 5,000 Payment Guard clearances, 30 days) or agent_fleet_compliance ($19 for 1,000 trust-score calls, 30 days). Optional api_key tops up that key; otherwise a new key is returned once. An unpaid call returns payment requirements (in MCP: isError true and structuredContent set to the requirements). Retry the same tool call with payment in params._meta. No email and no human step. Prepaid, not a subscription: buy again to renew.",
"inputSchema": {
"type": "object",
"required": [
"package"
],
"properties": {
"api_key": {
"type": "string",
"description": "Optional existing Screwtape.ai API key to top up. If omitted, a new key is returned once."
},
"package": {
"enum": [
"metered_spend_clearance",
"agent_fleet_compliance"
],
"type": "string",
"description": "Package id."
}
}
},
"outputSchema": {
"type": "object",
"properties": {
"usage": {
"type": "string"
},
"api_key": {
"type": "string"
},
"credits": {
"type": "number"
},
"package": {
"type": "string"
},
"credited": {
"type": "boolean"
},
"expires_at": {
"type": "string"
},
"request_id": {
"type": "string"
},
"credits_remaining": {
"type": "number"
}
}
},
"annotations": {
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}Screwtape.ai decides whether an AI agent is allowed to spend money, and keeps the proof. Call check_duplicate_invoice (Bearer key or x402 payment) before an agent pays an invoice or payment instruction: it returns duplicate.status (unique, duplicate, possible_duplicate, replay), runs the checks you pass (for example a sum check that line items add up to the total) and judges the invoice against your evidence, such as the purchase order. Pay only when next_step.action is pass; on escalate, do not pay. Every verdict carries a signed receipt as proof of why the money moved or did not. Use budget_ledger to reserve cumulative spend ($0.002); action_receipt signs an action record ($0.003). Use payment_check ($0.005) before paying a seller, to check the 402 payee and price. All six paid tools share 3 free calls per UTC day without a key plus 10/day with a free key. Anonymous: private daily IP namespace, 3/minute, global 2000/day. Free GET /v1/receipt/verify checks action receipts and /.well-known/screwtape-receipt-key publishes their key. Use judge on one draft answer before you return it (send evidence; it does not search the web). Use consensus when 2 to 16 answers to the same task agree and you are about to trust the majority. Use get_api_key only if no key is configured and you can compute SHA-256 in code. judge, check_duplicate_invoice and consensus cost one call each: a free key gives 10 per UTC day, or pay $0.005 USDC on Base or Solana with x402. After anonymous access is exhausted, an unpaid tools/call returns HTTP 200 with isError true and the x402 PaymentRequirements in structuredContent and result._meta['x402/payment-required']. Retry with params._meta['x402/payment']. Settlement is echoed in result._meta['x402/payment-response']. Judged content is not stored unless retain is true or the key owner turned on opt-in data sharing (off by default; redacted, kept 90 days). A successful judge or consensus result includes an Ed25519 receipt when signing is configured. Public keys are at https://screwtape.ai/.well-known/screwtape-receipt-keys.json. POST /v1/receipts/verify checks a receipt. publish_receipt publishes one receipt you own. It needs the Bearer key and does not accept x402.
Names, descriptions and schemas were written by the server and are shown as data.
Pattern matches on what the server declares. They show what it says it can do, not what it does.
None yet. Changes appear after a server's second daily check.
| seller_url |
| string |
| Public https URL of the paid resource. Required for proxy. |
| payment_required | any | Optional: the seller's 402 payload, used to read the payee. |
{
"name": "payment_guard_authorize",
"title": "Payment Guard",
"description": "Payment Guard: enforce your own spend rules before an agent pays. Set rules once per API key (or an account default): max_per_call_usd, daily_budget_usd, period_budget_usd + period_hours, allowed_sellers, allowed_domains, max_calls_per_minute, max_calls_per_hour. Then send each payment intent to POST /v1/payment-guard/authorize: allow returns a short-lived Ed25519-signed clearance (not a payment signature) and reserves the amount against your budgets atomically; block returns HTTP 403 with reasons and nothing is reserved. POST /v1/payment-guard/proxy does the same check and, on allow, forwards your client-signed PAYMENT-SIGNATURE (or X-PAYMENT) to the seller once per event_id. Non-custodial: Screwtape.ai never holds funds and never accepts private keys, seeds or mnemonics. Requires a Bearer API key. authorize and proxy use one shared free-tier or prepaid call each ($0.005 equivalent); rules endpoints are free. Same event_id + body replays the decision without billing again. Over MCP, send the Bearer API key as the Authorization header of the MCP connection. Set rules first with PUT https://screwtape.ai/v1/payment-guard/rules. A block is a normal result (isError false, decision \"block\").",
"inputSchema": {
"type": "object",
"required": [
"event_id",
"agent_id",
"amount_usd"
],
"properties": {
"payee": {
"type": "string",
"maxLength": 128,
"description": "Payee address or id, checked against allowed_sellers."
},
"domain": {
"type": "string",
"maxLength": 253,
"description": "Seller hostname, checked against allowed_domains."
},
"agent_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]{1,128}$",
"description": "Which agent wants to pay."
},
"event_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]{1,128}$",
"description": "Your id for this payment. Reusing it with the same body replays the decision."
},
"amount_usd": {
"type": "number",
"maximum": 1000000,
"description": "Amount the agent wants to pay.",
"exclusiveMinimum": 0
},
"seller_url": {
"type": "string",
"format": "uri",
"description": "Public https URL of the paid resource. Required for proxy."
},
"payment_required": {
"description": "Optional: the seller's 402 payload, used to read the payee."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"decision",
"reason",
"request_id"
],
"properties": {
"reason": {
"type": "string"
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"decision": {
"enum": [
"allow",
"block"
],
"type": "string"
},
"replayed": {
"type": "boolean"
},
"clearance": {
"type": [
"object",
"null"
],
"description": "Ed25519-signed clearance on allow. Not a payment signature."
},
"request_id": {
"type": "string"
},
"rules_source": {
"enum": [
"key",
"account",
"none"
],
"type": "string"
},
"rules_version": {
"type": "string"
},
"remaining_daily_usd": {
"type": "number"
},
"remaining_period_usd": {
"type": "number"
}
}
},
"annotations": {
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}| merchant * | string |
| parent_run_id | string |
{
"name": "budget_ledger",
"title": "Budget Ledger",
"description": "Budget Ledger: atomically reserves reported USD spend across a run and its sub-agents. Returns allow/warn/block, remaining budget, retry storms and spend velocity. Call judge first, then reserve immediately before spending; honor block. This is cooperative accounting, not payment enforcement. Root cap and parent are immutable. Children inherit the root cap (send the same cap). event_id is the authoritative idempotency key; a custom HTTP key cannot override it. New event_id per attempted action; same event_id and body replays without reserving twice. No refunds or cap resets. Warn reservations count as spend. Limits: USD, six decimals, cap at most 1000000. Three matching actions in 60 seconds allowed; fourth blocked. Velocity warning at ten attempts/minute or more than 25% of cap/minute; 80% usage warns. Use action to distinguish operations at a merchant. Stored: IDs, keyed fingerprints and amounts, not raw action/merchant. Records persist until the API key is deleted; keyless records have no automatic expiry. $0.002 per call; shared 3 free calls per UTC day without a key (daily private IP namespace), plus 10/day with a free key. Anonymous scopes rotate daily; use a key for a persistent ledger/chain. Send the same Bearer key plus a payment header to keep the same ledger/chain after the allowance runs out.",
"inputSchema": {
"type": "object",
"required": [
"run_id",
"event_id",
"amount",
"cap",
"merchant"
],
"properties": {
"cap": {
"type": "number",
"maximum": 1000000,
"minimum": 0,
"multipleOf": 0.000001,
"exclusiveMinimum": 0
},
"action": {
"type": "string",
"maxLength": 2048
},
"amount": {
"type": "number",
"maximum": 1000000,
"minimum": 0,
"multipleOf": 0.000001
},
"run_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"currency": {
"const": "USD"
},
"event_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"merchant": {
"type": "string",
"maxLength": 256,
"minLength": 1
},
"parent_run_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"decision",
"remaining_budget",
"reasons",
"run_id",
"root_run_id",
"spent",
"reserved"
],
"properties": {
"spent": {
"type": "number"
},
"run_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"decision": {
"enum": [
"allow",
"warn",
"block"
]
},
"event_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"replayed": {
"type": "boolean"
},
"reserved": {
"type": "boolean"
},
"request_id": {
"type": "string"
},
"retry_count": {
"type": "integer"
},
"root_run_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"remaining_budget": {
"type": "number"
},
"velocity_per_minute": {
"type": "number"
}
}
},
"annotations": {
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}| string |
| reference | string |
| action_sha256 | string |
{
"name": "action_receipt",
"title": "Action Receipts",
"description": "Action Receipts: Ed25519-signed, hash-chained attestation of an agent-reported action and status; not evidence the action happened or a legal compliance certification. Per caller and agent chain; concurrent appends serialize with compare-and-set. Raw action/reference are hashed, not stored. event_id per agent is the authoritative idempotency key; a custom HTTP key cannot override it. Same event_id/body returns the same receipt; changed body conflicts. Optional children (1-64 receipt UUIDs) closes a run: the signed children_root digests ordered child receipt_hash values so any added, dropped or swapped step fails verification. GET /v1/receipt/verify?id=<receipt_id> is free and returns the receipt to anyone who knows its unguessable ID; children_root_valid is set when children are present. A receipt proves the record is unchanged since issued, not that a payment was correct or an outside action happened. Or pass receipt=<JSON> to verify a portable receipt. Keep IDs private if your agent IDs/status are sensitive. Records persist until the API key is deleted; keyless records have no automatic expiry. $0.003 per call; shared 3 free calls per UTC day without a key (daily private IP namespace), plus 10/day with a free key. Anonymous scopes rotate daily; use a key for a persistent ledger/chain. Send the same Bearer key plus a payment header to keep the same ledger/chain after the allowance runs out.",
"inputSchema": {
"type": "object",
"required": [
"agent_id",
"event_id",
"action",
"status"
],
"properties": {
"action": {
"type": "string",
"maxLength": 8192,
"minLength": 1
},
"status": {
"enum": [
"requested",
"succeeded",
"failed",
"paid_not_served"
]
},
"agent_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"children": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[0-9a-f-]{36}$"
},
"maxItems": 64,
"minItems": 1,
"description": "Ordered child receipt ids. Signs children_root over their receipt_hash values so any added, dropped or swapped step fails verification.",
"uniqueItems": true
},
"event_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"reference": {
"type": "string",
"maxLength": 256
},
"action_sha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"receipt",
"receipt_hash",
"verify_url",
"keys_url"
],
"properties": {
"receipt": {
"type": "object",
"required": [
"receipt_id",
"agent_id",
"sequence",
"action_sha256",
"previous_hash",
"signature",
"kid",
"alg",
"status",
"issued_at",
"chain",
"event_id",
"schema"
],
"properties": {
"alg": {
"const": "Ed25519"
},
"kid": {
"type": "string"
},
"chain": {
"type": "string"
},
"schema": {
"const": "screwtape-action-receipt-v1"
},
"status": {
"enum": [
"requested",
"succeeded",
"failed",
"paid_not_served"
]
},
"agent_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"children": {
"type": "array",
"items": {
"type": "string"
}
},
"event_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]+$",
"maxLength": 128,
"minLength": 1
},
"sequence": {
"type": "integer",
"minimum": 1
},
"issued_at": {
"type": "string"
},
"signature": {
"type": "string"
},
"receipt_id": {
"type": "string"
},
"action_sha256": {
"type": "string"
},
"children_root": {
"type": "string",
"description": "SHA-256 of canonical JSON of ordered child receipt_hash values."
},
"previous_hash": {
"type": [
"string",
"null"
]
},
"reference_sha256": {
"type": "string"
}
}
},
"keys_url": {
"type": "string"
},
"replayed": {
"type": "boolean"
},
"request_id": {
"type": "string"
},
"verify_url": {
"type": "string"
},
"receipt_hash": {
"type": "string"
}
}
},
"annotations": {
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}
}| checks |
| array |
| Optional. The worker runs each check. A failed check forces verdict fail. Types include url_contains, json_schema, equals, regex, numeric, required_fields, types, format, sum and duplicate. duplicate (at most 1) compares an invoice with ones this caller recorded earlier and stores keyed fingerprints… |
| retain | boolean | Optional. true stores this call for 24 hours; requires an API key. Default false stores nothing. |
| version | string | Optional version tag for that agent. At most 64 characters. |
| agent_id | string | Optional tag for the agent making this call. 1 to 64 characters: letters, digits, and . _ : -. This is not the per-answer agent_id on a consensus answer. |
| criteria | array | Optional. Facts or terms the answer must contain, one per string. |
| evidence | array | Optional. Source passages the answer must be grounded in, one string per passage. Without evidence, grounding cannot be checked. |
| agent_output * | string | The agent's draft answer to check. Pass JSON as a string. |
{
"name": "judge",
"title": "Judge one agent output (pass, fail or retry)",
"description": "A pass/fail/retry verdict on ONE agent output, from a service outside your agent, used as the go/no-go before an agent spends money or acts on that output. Call it before you pay on, return, store or act on a draft answer, especially when you have the evidence the answer should be based on. Do NOT call it to look up facts (it does no web search and only checks against the evidence you pass), to compare several agents' answers (use consensus), or for offline evaluation over a dataset. Inputs: task, agent_output, evidence, criteria, retain, and optional agent_id and version tags. Returns: verdict, score, reasons, engine, next_step, request_id, retention, the tags when sent, and receipt when signing is configured. On pass, use the output. On retry, revise using reasons and call again, at most 2 or 3 times. On fail, stop. Optional checks run first; on failure you get next_step.hint saying what to fix. Branch on next_step.action (pass, retry or escalate). Cost: 1 call. First 3 calls per UTC day need no key; then use Authorization: Bearer <key> or pay per call. A free key covers 10 calls per UTC day (get_api_key or https://screwtape.ai/signup/). After the shared 3/day anonymous allowance (3/minute, global 2000/day), tools/call without a key or payment is HTTP 200 with isError true and the payment requirements in structuredContent.",
"inputSchema": {
"type": "object",
"required": [
"task",
"agent_output"
],
"properties": {
"mode": {
"enum": [
"blocking",
"advisory"
],
"type": "string",
"description": "Optional. blocking (the default) is today's behaviour. advisory computes the same verdict, checks, next_step and receipt, then adds mode, decision_owner human, recommended_action (approve, review or return) and a notice. The receipt signs mode advisory as schema_version 5. Same price."
},
"task": {
"type": "string",
"description": "The original instruction or question the agent was answering."
},
"share": {
"type": "boolean",
"description": "Optional. false keeps this call out of opt-in data sharing even when the key has sharing on. It cannot turn sharing on."
},
"checks": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"type",
"paths"
],
"properties": {
"type": {
"const": "required_fields"
},
"paths": {
"type": "array",
"items": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"maxItems": 50,
"minItems": 1
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"fields"
],
"properties": {
"type": {
"const": "types"
},
"fields": {
"type": "object",
"maxProperties": 50,
"minProperties": 1,
"additionalProperties": {
"enum": [
"string",
"number",
"integer",
"boolean",
"object",
"array",
"null"
]
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"field",
"format"
],
"properties": {
"type": {
"const": "format"
},
"field": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"format": {
"enum": [
"email",
"iso_date",
"iso_datetime",
"url",
"uuid",
"e164_phone",
"currency_code",
"integer_string"
]
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"parts",
"total"
],
"properties": {
"type": {
"const": "sum"
},
"parts": {
"type": "array",
"items": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"maxItems": 20,
"minItems": 1
},
"total": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"tolerance": {
"type": "number",
"default": 0.0001,
"maximum": 1000000,
"minimum": 0
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"vendor_path",
"invoice_id_path",
"amount_path"
],
"properties": {
"type": {
"const": "duplicate"
},
"store": {
"type": "boolean",
"default": false,
"description": "Record this invoice's fingerprints so later calls can match it."
},
"date_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path to a YYYY-MM-DD invoice date. Enables the same vendor, amount and date rule. Without it, the same vendor, amount and currency within 30 days is possible_duplicate."
},
"amount_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"retain_days": {
"type": "integer",
"default": 180,
"maximum": 400,
"minimum": 1
},
"vendor_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"window_days": {
"type": "integer",
"default": 3,
"maximum": 30,
"minimum": 0
},
"currency_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"invoice_id_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"payee_account_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path to the bank or payee account (IBAN, account number, PayPal email). Remembered per vendor as a keyed HMAC; a different account escalates with payee_account_changed."
},
"accept_payee_change": {
"type": "boolean",
"description": "Set after a person confirmed a changed payee account. With store true, the new account becomes the vendor's recorded account."
}
},
"description": "Duplicate invoice check (needs an API key, at most 1 per call). Compares this invoice with ones the same key recorded earlier. Stores keyed HMAC fingerprints only, and only when store is true.",
"additionalProperties": false
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"enum": [
"url_contains",
"json_schema",
"equals",
"regex",
"numeric",
"onchain"
]
}
},
"description": "Other check types, unchanged from 1.0. See https://screwtape.ai/openapi.json."
}
]
},
"maxItems": 8,
"description": "Optional. The worker runs each check. A failed check forces verdict fail. Types include url_contains, json_schema, equals, regex, numeric, required_fields, types, format, sum and duplicate. duplicate (at most 1) compares an invoice with ones this caller recorded earlier and stores keyed fingerprints only when store is true. At most 3 url_contains checks. Local checks run first; if one fails, no model is called and next_step says what to fix."
},
"retain": {
"type": "boolean",
"description": "Optional. true stores this call for 24 hours; requires an API key. Default false stores nothing."
},
"version": {
"type": "string",
"maxLength": 64,
"description": "Optional version tag for that agent. At most 64 characters."
},
"agent_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]{1,64}$",
"maxLength": 64,
"description": "Optional tag for the agent making this call. 1 to 64 characters: letters, digits, and . _ : -. This is not the per-answer agent_id on a consensus answer."
},
"criteria": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional. Facts or terms the answer must contain, one per string."
},
"evidence": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional. Source passages the answer must be grounded in, one string per passage. Without evidence, grounding cannot be checked."
},
"agent_output": {
"type": "string",
"description": "The agent's draft answer to check. Pass JSON as a string."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"verdict",
"score",
"reasons",
"request_id"
],
"properties": {
"mode": {
"enum": [
"advisory"
],
"type": "string",
"description": "Present only when the call sent mode: advisory."
},
"model": {
"type": [
"string",
"null"
]
},
"score": {
"type": [
"number",
"null"
],
"description": "null when no model gave a verdict (degraded)."
},
"checks": {
"type": "array"
},
"claims": {
"type": "array"
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Also signed into the receipt."
},
"notice": {
"type": "string",
"description": "Advisory only. Fixed text: the call does not approve, hold or release any payment."
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"receipt": {
"type": [
"object",
"null"
],
"required": [
"receipt_id",
"issued_at",
"endpoint",
"request_sha256",
"verdict",
"score",
"payment",
"alg",
"kid",
"signature"
],
"properties": {
"alg": {
"enum": [
"Ed25519"
],
"type": "string"
},
"kid": {
"type": "string"
},
"mode": {
"enum": [
"advisory"
],
"type": "string",
"description": "Present only on schema 5 and 8: the call was advisory, so a person, not the API, owned the decision. Blocking receipts omit it."
},
"model": {
"type": "string",
"description": "Present only on schema 7 and 8: the model id the provider echoed back for this verdict. Signed, so a changed model id fails verification."
},
"score": {
"type": "number",
"description": "Judge score from 0 to 1. For consensus this is agreement_score."
},
"checks": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"passed",
"evidence_hash"
],
"properties": {
"type": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"evidence_hash": {
"type": "string"
}
},
"additionalProperties": false
},
"description": "Type, passed, and evidence_hash only. Fetched content is not stored."
},
"claims": {
"type": "object",
"required": [
"total",
"supported",
"contradicted",
"unsupported"
],
"properties": {
"total": {
"type": "integer"
},
"supported": {
"type": "integer"
},
"unsupported": {
"type": "integer"
},
"contradicted": {
"type": "integer"
}
},
"additionalProperties": false
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Present on schema 3 and 4."
},
"payment": {
"type": "object",
"required": [
"type"
],
"properties": {
"tx": {
"type": "string",
"description": "Settled transaction id, or the accepted payment nonce when nothing was settled."
},
"type": {
"type": "string"
},
"payer": {
"type": "string"
},
"network": {
"type": "string"
},
"key_prefix": {
"type": "string",
"description": "Present on schema 3 free-key and prepaid payments. Omitted on schema 4. Never the secret."
}
},
"description": "How the call was paid. free-key and prepaid are the label only on schema 4; schema 3 may include the key display prefix, never the secret. demo is the /try/ allowance. Other paid calls may add tx, network and payer.",
"additionalProperties": false
},
"verdict": {
"type": "string",
"description": "Judge verdict (pass, fail, or retry). For consensus this is false_consensus_risk (low, medium, or high)."
},
"version": {
"type": "string",
"description": "Present when the call sent a version tag. Omitted otherwise. Older receipts omit it."
},
"agent_id": {
"type": "string",
"description": "Present when the call sent an agent_id tag. Omitted otherwise. Older receipts omit it."
},
"endpoint": {
"enum": [
"/v1/judge",
"/v1/consensus"
],
"type": "string"
},
"issued_at": {
"type": "string",
"description": "ISO-8601 UTC timestamp."
},
"signature": {
"type": "string",
"description": "Unpadded base64url Ed25519 signature over the canonical JSON of every field except signature."
},
"receipt_id": {
"type": "string"
},
"verification": {
"enum": [
"verified",
"judged",
"heuristic",
"failed"
],
"type": "string",
"description": "verified when a check of the answer passed. judged when a model checked it and did not contradict it. heuristic when only string checks ran. failed when the agreed answer failed verification."
},
"request_sha256": {
"type": "string",
"description": "Lowercase hex SHA-256 of the canonical JSON of the normalized request. Judge requests include task, agent_output, evidence, and criteria. Consensus requests include task and answers, plus evidence when it was sent. agent_id and version tags are signed separately and are not part of this hash."
},
"schema_version": {
"enum": [
2,
3,
4,
5,
7,
8
],
"type": "integer",
"description": "7 is schema 4 plus a signed model id, and 8 is schema 5 plus a signed model id: minted when a model gave the verdict. 5 is schema 4 plus a signed mode advisory, minted only for mode: advisory calls. 4 omits key_prefix from payment so a published receipt verifies without key info. 3 adds verification, engine, checks (type, passed, and evidence_hash only), and a claims count, and may include key_prefix. 2 can carry agent_id and version. Older receipts omit this field and still verify."
}
},
"additionalProperties": false
},
"verdict": {
"enum": [
"pass",
"fail",
"retry"
],
"type": "string"
},
"version": {
"type": "string",
"description": "Echoed when the call sent a version tag."
},
"agent_id": {
"type": "string",
"description": "Echoed when the call sent an agent_id tag."
},
"degraded": {
"type": "object"
},
"duplicate": {
"type": "object",
"description": "Present only when the call sent a duplicate check. status is unique, duplicate, possible_duplicate, replay or not_checked. Carries no invoice data."
},
"next_step": {
"type": "object",
"required": [
"action",
"error_type",
"hint"
],
"properties": {
"hint": {
"type": "string",
"maxLength": 300,
"description": "Template text naming fields and types to fix. Never contains values from agent_output."
},
"action": {
"enum": [
"pass",
"retry",
"escalate"
],
"type": "string",
"description": "pass: use the output. retry: fix it using hint and call again. escalate: stop and hand to a person."
},
"error_type": {
"enum": [
"none",
"invalid_json",
"not_an_object",
"missing_required_field",
"type_mismatch",
"format_mismatch",
"sum_mismatch",
"check_failed",
"external_check_failed",
"duplicate_invoice",
"possible_duplicate",
"payee_account_changed",
"document_too_large",
"quality_issue",
"contradicted_claims",
"rejected",
"low_confidence",
"unverifiable",
"false_consensus_risk",
"primary_engine_unavailable"
],
"type": "string"
}
},
"additionalProperties": false
},
"retention": {
"type": "object"
},
"request_id": {
"type": "string"
},
"fail_closed": {
"type": "boolean",
"description": "Present and true only when a finance check failed closed because the primary model was unavailable. Treat it as review."
},
"verification": {
"enum": [
"verified",
"judged",
"heuristic",
"failed"
],
"type": "string"
},
"decision_owner": {
"enum": [
"human"
],
"type": "string",
"description": "Advisory only. A person owns the decision."
},
"receipt_reason": {
"type": "string"
},
"recommended_action": {
"enum": [
"approve",
"review",
"return"
],
"type": "string",
"description": "Advisory only, deterministic and not signed. Judge: next_step pass is approve, escalate is review, retry is return (send back to the agent). Consensus: risk low is approve, medium or high is review."
}
}
},
"annotations": {
"title": "Judge one agent output (pass, fail or retry)",
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}| checks |
| array |
| Optional. The worker runs each check. A failed check forces verdict fail. Types include url_contains, json_schema, equals, regex, numeric, required_fields, types, format, sum and duplicate. duplicate (at most 1) compares an invoice with ones this caller recorded earlier and stores keyed fingerprints… |
| retain | boolean | Optional. true stores this call for 24 hours; requires an API key. Default false stores nothing. |
| version | string | Optional version tag for that agent. At most 64 characters. |
| agent_id | string | Optional tag for the agent making this call. 1 to 64 characters: letters, digits, and . _ : -. This is not the per-answer agent_id on a consensus answer. |
| criteria | array | Optional. Facts or terms the answer must contain, one per string. |
| evidence | array | Optional. Source passages the answer must be grounded in, one string per passage. Without evidence, grounding cannot be checked. |
| duplicate * | object | The duplicate check: dot paths into agent_output for vendor, invoice id and amount, plus optional currency_path, date_path, payee_account_path, accept_payee_change, window_days, store and retain_days. payee_account_path remembers the vendor's bank or payee account; a change escalates with payee_acco… |
| agent_output * | string | The invoice or payment instruction the agent is about to pay, as a JSON string. |
{
"name": "check_duplicate_invoice",
"title": "Check an invoice for duplicates before the agent pays",
"description": "Spend gate for invoices: decides whether an agent may pay this invoice, with a signed receipt as proof. Same as judge with one duplicate check: it compares this invoice with the invoices this caller recorded earlier and also judges it. Call it before an agent pays or approves an invoice or payment instruction. Inputs: the judge inputs (task, agent_output as the invoice JSON, evidence, criteria, checks, mode, tags) plus duplicate {vendor_path, invoice_id_path, amount_path, currency_path?, date_path?, payee_account_path?, accept_payee_change?, window_days?, store?, retain_days?}. Returns the judge result plus duplicate.status (unique, duplicate, possible_duplicate, replay or not_checked). On duplicate or possible_duplicate, next_step.action is escalate: do not pay. Fingerprints are kept per caller; only keyed HMAC fingerprints are stored, and only when store is true. Cost: 1 call, the same as judge. First 3 calls per UTC day need no key (daily private IP namespace). Then use Authorization: Bearer <key>, or a per-call payment in params._meta with no key (records are kept per payer; an unverified payment returns the payment requirements again). A free key covers 10 calls per UTC day (get_api_key or https://screwtape.ai/signup/). After the shared 3/day anonymous allowance (3/minute, global 2000/day), tools/call without a key or payment is HTTP 200 with isError true and the payment requirements in structuredContent.",
"inputSchema": {
"type": "object",
"required": [
"task",
"agent_output",
"duplicate"
],
"properties": {
"mode": {
"enum": [
"blocking",
"advisory"
],
"type": "string",
"description": "Optional. blocking (the default) is today's behaviour. advisory computes the same verdict, checks, next_step and receipt, then adds mode, decision_owner human, recommended_action (approve, review or return) and a notice. The receipt signs mode advisory as schema_version 5. Same price."
},
"task": {
"type": "string",
"description": "The original instruction or question the agent was answering."
},
"share": {
"type": "boolean",
"description": "Optional. false keeps this call out of opt-in data sharing even when the key has sharing on. It cannot turn sharing on."
},
"checks": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"type",
"paths"
],
"properties": {
"type": {
"const": "required_fields"
},
"paths": {
"type": "array",
"items": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"maxItems": 50,
"minItems": 1
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"fields"
],
"properties": {
"type": {
"const": "types"
},
"fields": {
"type": "object",
"maxProperties": 50,
"minProperties": 1,
"additionalProperties": {
"enum": [
"string",
"number",
"integer",
"boolean",
"object",
"array",
"null"
]
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"field",
"format"
],
"properties": {
"type": {
"const": "format"
},
"field": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"format": {
"enum": [
"email",
"iso_date",
"iso_datetime",
"url",
"uuid",
"e164_phone",
"currency_code",
"integer_string"
]
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"parts",
"total"
],
"properties": {
"type": {
"const": "sum"
},
"parts": {
"type": "array",
"items": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"maxItems": 20,
"minItems": 1
},
"total": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"tolerance": {
"type": "number",
"default": 0.0001,
"maximum": 1000000,
"minimum": 0
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"type",
"vendor_path",
"invoice_id_path",
"amount_path"
],
"properties": {
"type": {
"const": "duplicate"
},
"store": {
"type": "boolean",
"default": false,
"description": "Record this invoice's fingerprints so later calls can match it."
},
"date_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path to a YYYY-MM-DD invoice date. Enables the same vendor, amount and date rule. Without it, the same vendor, amount and currency within 30 days is possible_duplicate."
},
"amount_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"retain_days": {
"type": "integer",
"default": 180,
"maximum": 400,
"minimum": 1
},
"vendor_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"window_days": {
"type": "integer",
"default": 3,
"maximum": 30,
"minimum": 0
},
"currency_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"invoice_id_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"payee_account_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path to the bank or payee account (IBAN, account number, PayPal email). Remembered per vendor as a keyed HMAC; a different account escalates with payee_account_changed."
},
"accept_payee_change": {
"type": "boolean",
"description": "Set after a person confirmed a changed payee account. With store true, the new account becomes the vendor's recorded account."
}
},
"description": "Duplicate invoice check (needs an API key, at most 1 per call). Compares this invoice with ones the same key recorded earlier. Stores keyed HMAC fingerprints only, and only when store is true.",
"additionalProperties": false
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"enum": [
"url_contains",
"json_schema",
"equals",
"regex",
"numeric",
"onchain"
]
}
},
"description": "Other check types, unchanged from 1.0. See https://screwtape.ai/openapi.json."
}
]
},
"maxItems": 8,
"description": "Optional. The worker runs each check. A failed check forces verdict fail. Types include url_contains, json_schema, equals, regex, numeric, required_fields, types, format, sum and duplicate. duplicate (at most 1) compares an invoice with ones this caller recorded earlier and stores keyed fingerprints only when store is true. At most 3 url_contains checks. Local checks run first; if one fails, no model is called and next_step says what to fix."
},
"retain": {
"type": "boolean",
"description": "Optional. true stores this call for 24 hours; requires an API key. Default false stores nothing."
},
"version": {
"type": "string",
"maxLength": 64,
"description": "Optional version tag for that agent. At most 64 characters."
},
"agent_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]{1,64}$",
"maxLength": 64,
"description": "Optional tag for the agent making this call. 1 to 64 characters: letters, digits, and . _ : -. This is not the per-answer agent_id on a consensus answer."
},
"criteria": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional. Facts or terms the answer must contain, one per string."
},
"evidence": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional. Source passages the answer must be grounded in, one string per passage. Without evidence, grounding cannot be checked."
},
"duplicate": {
"type": "object",
"required": [
"vendor_path",
"invoice_id_path",
"amount_path"
],
"properties": {
"type": {
"const": "duplicate"
},
"store": {
"type": "boolean",
"default": false,
"description": "Record this invoice's fingerprints so later calls can match it."
},
"date_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path to a YYYY-MM-DD invoice date. Enables the same vendor, amount and date rule. Without it, the same vendor, amount and currency within 30 days is possible_duplicate."
},
"amount_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"retain_days": {
"type": "integer",
"default": 180,
"maximum": 400,
"minimum": 1
},
"vendor_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"window_days": {
"type": "integer",
"default": 3,
"maximum": 30,
"minimum": 0
},
"currency_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"invoice_id_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"payee_account_path": {
"type": "string",
"maxLength": 128,
"minLength": 1,
"description": "Dot path to the bank or payee account (IBAN, account number, PayPal email). Remembered per vendor as a keyed HMAC; a different account escalates with payee_account_changed."
},
"accept_payee_change": {
"type": "boolean",
"description": "Set after a person confirmed a changed payee account. With store true, the new account becomes the vendor's recorded account."
}
},
"description": "The duplicate check: dot paths into agent_output for vendor, invoice id and amount, plus optional currency_path, date_path, payee_account_path, accept_payee_change, window_days, store and retain_days. payee_account_path remembers the vendor's bank or payee account; a change escalates with payee_account_changed. store true records this invoice's keyed fingerprints so later calls can match it.",
"additionalProperties": false
},
"agent_output": {
"type": "string",
"description": "The invoice or payment instruction the agent is about to pay, as a JSON string."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"verdict",
"score",
"reasons",
"request_id"
],
"properties": {
"mode": {
"enum": [
"advisory"
],
"type": "string",
"description": "Present only when the call sent mode: advisory."
},
"model": {
"type": [
"string",
"null"
]
},
"score": {
"type": [
"number",
"null"
],
"description": "null when no model gave a verdict (degraded)."
},
"checks": {
"type": "array"
},
"claims": {
"type": "array"
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Also signed into the receipt."
},
"notice": {
"type": "string",
"description": "Advisory only. Fixed text: the call does not approve, hold or release any payment."
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"receipt": {
"type": [
"object",
"null"
],
"required": [
"receipt_id",
"issued_at",
"endpoint",
"request_sha256",
"verdict",
"score",
"payment",
"alg",
"kid",
"signature"
],
"properties": {
"alg": {
"enum": [
"Ed25519"
],
"type": "string"
},
"kid": {
"type": "string"
},
"mode": {
"enum": [
"advisory"
],
"type": "string",
"description": "Present only on schema 5 and 8: the call was advisory, so a person, not the API, owned the decision. Blocking receipts omit it."
},
"model": {
"type": "string",
"description": "Present only on schema 7 and 8: the model id the provider echoed back for this verdict. Signed, so a changed model id fails verification."
},
"score": {
"type": "number",
"description": "Judge score from 0 to 1. For consensus this is agreement_score."
},
"checks": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"passed",
"evidence_hash"
],
"properties": {
"type": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"evidence_hash": {
"type": "string"
}
},
"additionalProperties": false
},
"description": "Type, passed, and evidence_hash only. Fetched content is not stored."
},
"claims": {
"type": "object",
"required": [
"total",
"supported",
"contradicted",
"unsupported"
],
"properties": {
"total": {
"type": "integer"
},
"supported": {
"type": "integer"
},
"unsupported": {
"type": "integer"
},
"contradicted": {
"type": "integer"
}
},
"additionalProperties": false
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Present on schema 3 and 4."
},
"payment": {
"type": "object",
"required": [
"type"
],
"properties": {
"tx": {
"type": "string",
"description": "Settled transaction id, or the accepted payment nonce when nothing was settled."
},
"type": {
"type": "string"
},
"payer": {
"type": "string"
},
"network": {
"type": "string"
},
"key_prefix": {
"type": "string",
"description": "Present on schema 3 free-key and prepaid payments. Omitted on schema 4. Never the secret."
}
},
"description": "How the call was paid. free-key and prepaid are the label only on schema 4; schema 3 may include the key display prefix, never the secret. demo is the /try/ allowance. Other paid calls may add tx, network and payer.",
"additionalProperties": false
},
"verdict": {
"type": "string",
"description": "Judge verdict (pass, fail, or retry). For consensus this is false_consensus_risk (low, medium, or high)."
},
"version": {
"type": "string",
"description": "Present when the call sent a version tag. Omitted otherwise. Older receipts omit it."
},
"agent_id": {
"type": "string",
"description": "Present when the call sent an agent_id tag. Omitted otherwise. Older receipts omit it."
},
"endpoint": {
"enum": [
"/v1/judge",
"/v1/consensus"
],
"type": "string"
},
"issued_at": {
"type": "string",
"description": "ISO-8601 UTC timestamp."
},
"signature": {
"type": "string",
"description": "Unpadded base64url Ed25519 signature over the canonical JSON of every field except signature."
},
"receipt_id": {
"type": "string"
},
"verification": {
"enum": [
"verified",
"judged",
"heuristic",
"failed"
],
"type": "string",
"description": "verified when a check of the answer passed. judged when a model checked it and did not contradict it. heuristic when only string checks ran. failed when the agreed answer failed verification."
},
"request_sha256": {
"type": "string",
"description": "Lowercase hex SHA-256 of the canonical JSON of the normalized request. Judge requests include task, agent_output, evidence, and criteria. Consensus requests include task and answers, plus evidence when it was sent. agent_id and version tags are signed separately and are not part of this hash."
},
"schema_version": {
"enum": [
2,
3,
4,
5,
7,
8
],
"type": "integer",
"description": "7 is schema 4 plus a signed model id, and 8 is schema 5 plus a signed model id: minted when a model gave the verdict. 5 is schema 4 plus a signed mode advisory, minted only for mode: advisory calls. 4 omits key_prefix from payment so a published receipt verifies without key info. 3 adds verification, engine, checks (type, passed, and evidence_hash only), and a claims count, and may include key_prefix. 2 can carry agent_id and version. Older receipts omit this field and still verify."
}
},
"additionalProperties": false
},
"verdict": {
"enum": [
"pass",
"fail",
"retry"
],
"type": "string"
},
"version": {
"type": "string",
"description": "Echoed when the call sent a version tag."
},
"agent_id": {
"type": "string",
"description": "Echoed when the call sent an agent_id tag."
},
"degraded": {
"type": "object"
},
"duplicate": {
"type": "object",
"description": "Present only when the call sent a duplicate check. status is unique, duplicate, possible_duplicate, replay or not_checked. Carries no invoice data."
},
"next_step": {
"type": "object",
"required": [
"action",
"error_type",
"hint"
],
"properties": {
"hint": {
"type": "string",
"maxLength": 300,
"description": "Template text naming fields and types to fix. Never contains values from agent_output."
},
"action": {
"enum": [
"pass",
"retry",
"escalate"
],
"type": "string",
"description": "pass: use the output. retry: fix it using hint and call again. escalate: stop and hand to a person."
},
"error_type": {
"enum": [
"none",
"invalid_json",
"not_an_object",
"missing_required_field",
"type_mismatch",
"format_mismatch",
"sum_mismatch",
"check_failed",
"external_check_failed",
"duplicate_invoice",
"possible_duplicate",
"payee_account_changed",
"document_too_large",
"quality_issue",
"contradicted_claims",
"rejected",
"low_confidence",
"unverifiable",
"false_consensus_risk",
"primary_engine_unavailable"
],
"type": "string"
}
},
"additionalProperties": false
},
"retention": {
"type": "object"
},
"request_id": {
"type": "string"
},
"fail_closed": {
"type": "boolean",
"description": "Present and true only when a finance check failed closed because the primary model was unavailable. Treat it as review."
},
"verification": {
"enum": [
"verified",
"judged",
"heuristic",
"failed"
],
"type": "string"
},
"decision_owner": {
"enum": [
"human"
],
"type": "string",
"description": "Advisory only. A person owns the decision."
},
"receipt_reason": {
"type": "string"
},
"recommended_action": {
"enum": [
"approve",
"review",
"return"
],
"type": "string",
"description": "Advisory only, deterministic and not signed. Judge: next_step pass is approve, escalate is review, retry is return (send back to the agent). Consensus: risk low is approve, medium or high is review."
}
}
},
"annotations": {
"title": "Check an invoice for duplicates before the agent pays",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}| boolean |
| Optional. false keeps this call out of opt-in data sharing even when the key has sharing on. It cannot turn sharing on. |
| retain | boolean | Optional. true stores this call for 24 hours; requires an API key. Default false. |
| answers * | array | 2 to 16 answers. Each is {agent_id (optional, string), output (string)}. Use one entry per agent or sample. |
| version | string | Optional version tag for that agent. At most 64 characters. |
| agent_id | string | Optional tag for the agent making this call. 1 to 64 characters: letters, digits, and . _ : -. This is not the per-answer agent_id on a consensus answer. |
| evidence | any | Optional passages the agreed answer should be grounded in. A string is one passage. An array holds up to 20 passages of 4000 characters. Used when scoring false-consensus risk. |
{
"name": "consensus",
"title": "False-consensus check across 2 to 16 agent answers",
"description": "False-consensus check for 2 to 16 answers to the same task, so a group of agents does not approve a spend just because they copied each other. It scores how the answers agree and flags agreement that looks copied or too thin to trust. Screwtape is not tied to the agent framework or the model that wrote the answers. Call it when several agents, samples or tools answered the same question and you are about to accept the majority. Do NOT call it with a single answer (use judge), with answers to different tasks, or as proof that an answer is correct: high agreement is not evidence. Inputs: task, answers (2 to 16 objects {agent_id?: string, output: string}), optional evidence (a string or an array of strings, used when scoring), retain, and optional call-level agent_id and version tags. The call-level agent_id is not the per-answer agent_id. Returns: consensus_answer, agreement_score, false_consensus_risk (low, medium or high), reasons, clusters, engine, request_id, retention, the tags when sent, and receipt when signing is configured. In that receipt, verdict is false_consensus_risk and score is agreement_score. If the risk is medium or high, verify consensus_answer with judge before using it. next_step.action is pass for low risk and escalate otherwise. Cost: 1 call. First 3 calls per UTC day need no key; then use Authorization: Bearer <key> or pay per call. A free key covers 10 calls per UTC day (get_api_key or https://screwtape.ai/signup/). After the shared 3/day anonymous allowance (3/minute, global 2000/day), tools/call without a key or payment is HTTP 200 with isError true and the payment requirements in structuredContent.",
"inputSchema": {
"type": "object",
"required": [
"task",
"answers"
],
"properties": {
"mode": {
"enum": [
"blocking",
"advisory"
],
"type": "string",
"description": "Optional. blocking (the default) is today's behaviour. advisory computes the same verdict, checks, next_step and receipt, then adds mode, decision_owner human, recommended_action (approve, review or return) and a notice. The receipt signs mode advisory as schema_version 5. Same price."
},
"task": {
"type": "string",
"description": "The question all answers respond to."
},
"share": {
"type": "boolean",
"description": "Optional. false keeps this call out of opt-in data sharing even when the key has sharing on. It cannot turn sharing on."
},
"retain": {
"type": "boolean",
"description": "Optional. true stores this call for 24 hours; requires an API key. Default false."
},
"answers": {
"type": "array",
"items": {
"type": "object",
"required": [
"output"
],
"properties": {
"output": {
"type": "string",
"description": "That agent's answer."
},
"agent_id": {
"type": "string",
"description": "Optional name of the agent or sample that produced this answer."
}
}
},
"maxItems": 16,
"minItems": 2,
"description": "2 to 16 answers. Each is {agent_id (optional, string), output (string)}. Use one entry per agent or sample."
},
"version": {
"type": "string",
"maxLength": 64,
"description": "Optional version tag for that agent. At most 64 characters."
},
"agent_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]{1,64}$",
"maxLength": 64,
"description": "Optional tag for the agent making this call. 1 to 64 characters: letters, digits, and . _ : -. This is not the per-answer agent_id on a consensus answer."
},
"evidence": {
"oneOf": [
{
"type": "string",
"maxLength": 4000
},
{
"type": "array",
"items": {
"type": "string",
"maxLength": 4000
},
"maxItems": 20
}
],
"description": "Optional passages the agreed answer should be grounded in. A string is one passage. An array holds up to 20 passages of 4000 characters. Used when scoring false-consensus risk."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"agreement_score",
"false_consensus_risk",
"reasons",
"request_id"
],
"properties": {
"mode": {
"enum": [
"advisory"
],
"type": "string",
"description": "Present only when the call sent mode: advisory."
},
"model": {
"type": [
"string",
"null"
]
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo."
},
"notice": {
"type": "string",
"description": "Advisory only. Fixed text: the call does not approve, hold or release any payment."
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"receipt": {
"type": [
"object",
"null"
],
"required": [
"receipt_id",
"issued_at",
"endpoint",
"request_sha256",
"verdict",
"score",
"payment",
"alg",
"kid",
"signature"
],
"properties": {
"alg": {
"enum": [
"Ed25519"
],
"type": "string"
},
"kid": {
"type": "string"
},
"mode": {
"enum": [
"advisory"
],
"type": "string",
"description": "Present only on schema 5 and 8: the call was advisory, so a person, not the API, owned the decision. Blocking receipts omit it."
},
"model": {
"type": "string",
"description": "Present only on schema 7 and 8: the model id the provider echoed back for this verdict. Signed, so a changed model id fails verification."
},
"score": {
"type": "number",
"description": "Judge score from 0 to 1. For consensus this is agreement_score."
},
"checks": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"passed",
"evidence_hash"
],
"properties": {
"type": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"evidence_hash": {
"type": "string"
}
},
"additionalProperties": false
},
"description": "Type, passed, and evidence_hash only. Fetched content is not stored."
},
"claims": {
"type": "object",
"required": [
"total",
"supported",
"contradicted",
"unsupported"
],
"properties": {
"total": {
"type": "integer"
},
"supported": {
"type": "integer"
},
"unsupported": {
"type": "integer"
},
"contradicted": {
"type": "integer"
}
},
"additionalProperties": false
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Present on schema 3 and 4."
},
"payment": {
"type": "object",
"required": [
"type"
],
"properties": {
"tx": {
"type": "string",
"description": "Settled transaction id, or the accepted payment nonce when nothing was settled."
},
"type": {
"type": "string"
},
"payer": {
"type": "string"
},
"network": {
"type": "string"
},
"key_prefix": {
"type": "string",
"description": "Present on schema 3 free-key and prepaid payments. Omitted on schema 4. Never the secret."
}
},
"description": "How the call was paid. free-key and prepaid are the label only on schema 4; schema 3 may include the key display prefix, never the secret. demo is the /try/ allowance. Other paid calls may add tx, network and payer.",
"additionalProperties": false
},
"verdict": {
"type": "string",
"description": "Judge verdict (pass, fail, or retry). For consensus this is false_consensus_risk (low, medium, or high)."
},
"version": {
"type": "string",
"description": "Present when the call sent a version tag. Omitted otherwise. Older receipts omit it."
},
"agent_id": {
"type": "string",
"description": "Present when the call sent an agent_id tag. Omitted otherwise. Older receipts omit it."
},
"endpoint": {
"enum": [
"/v1/judge",
"/v1/consensus"
],
"type": "string"
},
"issued_at": {
"type": "string",
"description": "ISO-8601 UTC timestamp."
},
"signature": {
"type": "string",
"description": "Unpadded base64url Ed25519 signature over the canonical JSON of every field except signature."
},
"receipt_id": {
"type": "string"
},
"verification": {
"enum": [
"verified",
"judged",
"heuristic",
"failed"
],
"type": "string",
"description": "verified when a check of the answer passed. judged when a model checked it and did not contradict it. heuristic when only string checks ran. failed when the agreed answer failed verification."
},
"request_sha256": {
"type": "string",
"description": "Lowercase hex SHA-256 of the canonical JSON of the normalized request. Judge requests include task, agent_output, evidence, and criteria. Consensus requests include task and answers, plus evidence when it was sent. agent_id and version tags are signed separately and are not part of this hash."
},
"schema_version": {
"enum": [
2,
3,
4,
5,
7,
8
],
"type": "integer",
"description": "7 is schema 4 plus a signed model id, and 8 is schema 5 plus a signed model id: minted when a model gave the verdict. 5 is schema 4 plus a signed mode advisory, minted only for mode: advisory calls. 4 omits key_prefix from payment so a published receipt verifies without key info. 3 adds verification, engine, checks (type, passed, and evidence_hash only), and a claims count, and may include key_prefix. 2 can carry agent_id and version. Older receipts omit this field and still verify."
}
},
"additionalProperties": false
},
"version": {
"type": "string",
"description": "Echoed when the call sent a version tag."
},
"agent_id": {
"type": "string",
"description": "Echoed when the call sent an agent_id tag. Not the per-answer agent_id."
},
"clusters": {
"type": "array"
},
"degraded": {
"type": "object"
},
"next_step": {
"type": "object",
"required": [
"action",
"error_type",
"hint"
],
"properties": {
"hint": {
"type": "string",
"maxLength": 300,
"description": "Template text naming fields and types to fix. Never contains values from agent_output."
},
"action": {
"enum": [
"pass",
"retry",
"escalate"
],
"type": "string",
"description": "pass: use the output. retry: fix it using hint and call again. escalate: stop and hand to a person."
},
"error_type": {
"enum": [
"none",
"invalid_json",
"not_an_object",
"missing_required_field",
"type_mismatch",
"format_mismatch",
"sum_mismatch",
"check_failed",
"external_check_failed",
"duplicate_invoice",
"possible_duplicate",
"payee_account_changed",
"document_too_large",
"quality_issue",
"contradicted_claims",
"rejected",
"low_confidence",
"unverifiable",
"false_consensus_risk",
"primary_engine_unavailable"
],
"type": "string"
}
},
"additionalProperties": false
},
"retention": {
"type": "object"
},
"request_id": {
"type": "string"
},
"verification": {
"enum": [
"verified",
"judged",
"heuristic",
"failed"
],
"type": "string"
},
"decision_owner": {
"enum": [
"human"
],
"type": "string",
"description": "Advisory only. A person owns the decision."
},
"receipt_reason": {
"type": "string"
},
"agreement_score": {
"type": [
"number",
"null"
],
"description": "null when no model scored agreement (degraded)."
},
"consensus_answer": {
"type": "string"
},
"recommended_action": {
"enum": [
"approve",
"review",
"return"
],
"type": "string",
"description": "Advisory only, deterministic and not signed. Judge: next_step pass is approve, escalate is review, retry is return (send back to the agent). Consensus: risk low is approve, medium or high is review."
},
"false_consensus_risk": {
"enum": [
"low",
"medium",
"high"
],
"type": "string"
},
"unsupported_agreement": {
"type": "boolean"
}
}
},
"annotations": {
"title": "False-consensus check across 2 to 16 agent answers",
"readOnlyHint": true,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": false
}
}{
"name": "get_api_key",
"title": "Get a free API key (proof of work, no human approval)",
"description": "Create a free Screwtape.ai API key (10 calls per UTC day) with no human approval and no code: call it with an empty object {} or just a name. Call it only when no Screwtape key is configured. Do NOT call it when a key already exists, or to get more quota. Keys without a proof of work are limited to 2 per network and 300 per service per UTC day; add pow_nonce (optional; SHA-256 of the UTF-8 string screwtape-signup-v1:<current UTC YYYY-MM-DD>:<nonce> must start with 12 zero bits, which is 3 hex zeros; nonce matches ^[A-Za-z0-9_-]{8,64}$) only if you can run code and hit that limit. Other inputs: email (optional), name (optional, at most 80 characters). Returns: api_key (shown once; store it securely and send it as Authorization: Bearer), key metadata and request_id. Only the key's SHA-256 hash is stored. You do not need a key to start: the first 3 calls per UTC day work with no key and no payment. Cost: free.",
"inputSchema": {
"type": "object",
"required": [],
"properties": {
"name": {
"type": "string",
"maxLength": 80,
"description": "Optional agent or client name, at most 80 characters."
},
"email": {
"type": "string",
"description": "Optional. Omit it to store no email."
},
"pow_nonce": {
"type": "string",
"description": "Optional. Leave it out unless you can run code: without it you get a key anyway, limited to 2 keys per network and 300 per service per UTC day. With it (SHA-256 of the UTF-8 string screwtape-signup-v1:YYYY-MM-DD:<nonce> has 12 leading zero bits; nonce matches ^[A-Za-z0-9_-]{8,64}$; YYYY-MM-DD is the UTC day) the normal limits apply."
},
"data_sharing": {
"type": "boolean",
"description": "Optional, off by default. Only true turns on opt-in data sharing for the new key: redacted samples of its calls are kept 90 days. Turn it off anytime with PATCH /v1/keys/me/data-sharing. See https://screwtape.ai/privacy/#opt-in-data-sharing."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"api_key",
"key",
"request_id"
],
"properties": {
"key": {
"type": "object"
},
"api_key": {
"type": "string"
},
"request_id": {
"type": "string"
}
}
},
"annotations": {
"title": "Get a free API key (proof of work, no human approval)",
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}