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 分
  • 授權條款不適用

    託管服務按其提供方的條款使用,因此這裡不要求授權條款。此檢查項不計入百分比。