Screwtape.ai

ai.screwtapePublished by screwtape.aiOfficial publisherv1.2.2Updated Nov 7, 2026

Spend guardrails for AI agents: check payments, track budgets, catch duplicates, sign receipts.

VerifiedStreamable HTTPWeb executableFinanceSecurity & MonitoringAI & ML

Overview

AI-generated overview

Spend guardrails for AI agents: checks invoices and agent outputs, tracks budgets, and issues signed receipts before money moves.

What you can do
  • Check invoices and payments for duplicates and sum mismatches, with a pass/escalate verdict and signed receipt
  • Judge a single agent output against supplied evidence before acting on or paying for it
  • Compare 2 to 16 answers to the same task to flag copied or thin agreement
  • Reserve cumulative USD spend across a run and its sub-agents, returning allow, warn or block
  • Sign and verify action receipts, and publish one receipt to a public verified page
  • Obtain a free API key via proof of work, or run a sample check on a demo invoice
When to use it
Use it when an agent can move money or approve invoices and you want an external go/no-go check plus proof of why payment happened or did not. Also useful before trusting a draft answer or a majority vote from several agents.
Requirements
Remote Streamable HTTP endpoint; no local install. An optional Bearer API key in the Authorization header (free key gives 10 calls per UTC day; without one, 3 free calls per UTC day). Paid calls are settled per call in USDC via x402 on Base or Solana. Network access required.
Before you install
Paid tools cost money per call and can settle payments in USDC via x402; budget_ledger is cooperative accounting, not payment enforcement. Receipts attest what an agent reported, not that an action actually happened. Judged content is not stored unless retain is true or opt-in sharing is enabled. The key-creation tool should only be used when no key exists.

Installation

In SourceWeft

  1. Open Screwtape.ai in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/ai.screwtape%2Fscrewtape/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "screwtape-ai": {
      "type": "http",
      "url": "https://screwtape.ai/mcp"
    }
  }
}

README

Screwtape.ai examples

Copy-paste examples that stop an AI agent from paying the wrong invoice. Each one calls the public Screwtape.ai API with an API key and does two things before money moves:

  1. Spend check: the line items and tax must add up to the total, and the invoice must match your evidence (purchase order, contract, approval email). You get a verdict and a signed receipt.
  2. Duplicate-invoice check: the same invoice, or the same vendor and amount within a few days, is flagged before the agent pays it twice.

The agent pays only when next_step.action is pass. Anything else (retry or escalate) means do not pay.

FolderStackRun
curl/curl + jq./curl/check_payment.sh
python/Python 3.9+, standard library onlypython python/check_payment.py
typescript/Node 18+, built-in fetchcd typescript && npm i && npm start
langchain/LangChain toolpython langchain/spend_tool.py
crewai/CrewAI toolpython crewai/spend_tool.py
openai-agents/OpenAI Agents SDK, guarded payment toolpython openai-agents/spend_guard.py

Start in one minute

bash
export SCREWTAPE_API_KEY=...   # free key: https://screwtape.ai/signup/python python/check_payment.py

Expected output (receipt ids differ per run):

first:  verdict=pass action=pass reason=none duplicate=unique receipt=...  -> PAYsecond: verdict=... action=escalate reason=duplicate_invoice duplicate=duplicate receipt=...  -> DO NOT PAYwrong total: verdict=fail action=... reason=sum_mismatch duplicate=... receipt=...  -> DO NOT PAY

The one rule your agent needs

python
result = check_payment(invoice, evidence)        # POST https://screwtape.ai/v1/duplicateif result["next_step"]["action"] != "pass":    stop_and_escalate(result)                    # do not pay

Put the check inside the payment tool itself (see openai-agents/), so the model cannot skip it.

API in brief

  • POST /v1/duplicate: spend check plus duplicate-invoice check (used by every example here).
  • POST /v1/judge: verdict on any agent output, with deterministic checks (sum, required_fields, json_schema, regex, equals, ...). See checks.
  • POST /v1/consensus: compare 2 to 16 agent answers before acting on them.
  • POST /v1/receipts/verify: verify a signed receipt.
  • Auth: Authorization: Bearer $SCREWTAPE_API_KEY. Add an Idempotency-Key header to make retries safe.
  • Full spec: openapi.json. Docs: screwtape.ai/docs.

MCP

Agents that speak MCP can connect directly: https://screwtape.ai/mcp (Streamable HTTP, Bearer key). Tools: judge, check_duplicate_invoice, consensus.

Pricing

  • Free: 10 calls a day, no card.
  • Sandbox Evaluation Pack: $100 for 2,000 checks.
  • Enterprise pilot: [email protected]

Details: screwtape.ai/pricing.

License

MIT

Source: README.md at commit 13a5cd8

Tools

8

budget_ledger

Budget Ledger

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.

Parameterscaprequiredactionamountrequiredrun_idrequiredcurrencyevent_idrequiredmerchantrequiredparent_run_id

action_receipt

Action Receipts

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. GET /v1/receipt/verify?id=<receipt_id> is free and returns the receipt to anyone who knows its unguessable ID. 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.

Parametersactionrequiredstatusrequiredagent_idrequiredevent_idrequiredreferenceaction_sha256

judge

Judge one agent output (pass, fail or retry)

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.

Parametersmodetaskrequiredsharechecksretainversionagent_idcriteriaevidenceagent_outputrequired

check_duplicate_invoice

Check an invoice for duplicates before the agent pays

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.

Parametersmodetaskrequiredsharechecksretainversionagent_idcriteriaevidenceduplicaterequiredagent_outputrequired

consensus

False-consensus check across 2 to 16 agent answers

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.

Parametersmodetaskrequiredshareretainanswersrequiredversionagent_idevidence

get_api_key

Get a free API key (proof of work, no human approval)

Create a free Screwtape.ai API key (10 calls per UTC day) with no human approval. Call it only when no Screwtape key is configured and you can compute SHA-256 with a code tool, because the proof of work must be computed exactly, not guessed. Do NOT call it when a key already exists, to get more quota (it is limited to 5 keys per IP per hour and per UTC day), or without a valid pow_nonce. A missing nonce returns an error that describes the challenge. Inputs: pow_nonce (required string matching ^[A-Za-z0-9_-]{8,64}$; 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), 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. Cost: free. Needs no key and no payment.

Parametersnameemailpow_noncerequireddata_sharing

publish_receipt

Publish one signed receipt as a Screwtape Verified badge

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.

Parameterslabelunpublishreceipt_idrequiredinclude_content

try_check

Try one sample duplicate-invoice check (free, no key)

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 5 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 and request_id. No receipt and nothing is stored. Cost: free. Needs no key.

Parametersscenario

Version history

5
  1. v1.2.2LatestNov 7, 2026
  2. v1.2.1Nov 3, 2026
  3. v1.1.0Oct 23, 2026
  4. v1.0.1Oct 22, 2026
  5. v1.0.0Oct 20, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • LicenseNot applicable

    A hosted service is used under its provider's terms, so no license is expected here. This check is left out of the percentage.