Screwtape.ai

ai.screwtape由 screwtape.ai 发布官方发布者v1.2.2更新于 Nov 7, 2026

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

已验证Streamable HTTP可网页运行金融安全与监控AI 与机器学习

概览

AI 生成的概览

面向 AI 智能体的支出护栏:在付款前检查发票与智能体输出、跟踪预算并签发签名凭证。

可以做什么
  • 检查发票与付款是否重复、金额是否对不上,给出通过或升级的结论及签名凭证
  • 在依据或支付某份智能体输出前,结合提供的证据对其进行判定
  • 比较 2 到 16 个针对同一任务的答案,识别抄袭或过于单薄的共识
  • 在一次运行及其子智能体之间预留累计美元支出,返回允许、警告或阻止
  • 签发并校验操作凭证,并把某份凭证发布到公开的已验证页面
  • 通过工作量证明获取免费 API 密钥,或对演示发票运行一次示例检查
适用场景
当智能体能够付款或审批发票,而你需要一个外部的放行/拦截判断以及资金为何流动或不流动的证明时使用。在信任草稿答案或多个智能体的多数意见之前也有用。
运行要求
远程 Streamable HTTP 端点,无需本地安装。可选在 Authorization 头中提供 Bearer API 密钥(免费密钥每天 10 次调用;不提供则每天 3 次免费调用)。付费调用通过 Base 或 Solana 上的 x402 以 USDC 按次结算。需要网络访问。
安装前请注意
付费工具按次收费,并可能通过 x402 以 USDC 结算;budget_ledger 是协作式记账,并非支付强制手段。凭证只证明智能体所报告的内容,并不证明操作真的发生。除非 retain 为 true 或开启选择性共享,被判定内容不会被存储。仅在尚无密钥时才应使用创建密钥的工具。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Screwtape.ai,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/ai.screwtape%2Fscrewtape/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "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

来源:README.md,提交 13a5cd8

工具

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.

输入参数cap必填actionamount必填run_id必填currencyevent_id必填merchant必填parent_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.

输入参数action必填status必填agent_id必填event_id必填referenceaction_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.

输入参数modetask必填sharechecksretainversionagent_idcriteriaevidenceagent_output必填

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.

输入参数modetask必填sharechecksretainversionagent_idcriteriaevidenceduplicate必填agent_output必填

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.

输入参数modetask必填shareretainanswers必填versionagent_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.

输入参数nameemailpow_nonce必填data_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.

输入参数labelunpublishreceipt_id必填include_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.

输入参数scenario

版本历史

5
  1. v1.2.2最新Nov 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

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证不适用

    托管服务按其提供方的条款使用,因此这里不要求许可证。此检查项不计入百分比。