Screwtape.ai
Independent pass/fail/retry judge and false-consensus check for agent outputs, with signed receipts.
사용해야 할까요
품질 및 안전성
도구 정의와 프로토콜 준수에 대한 자동 분석을 기반으로 합니다.
컨텍스트 비용
이는 서버의 도구가 모델의 컨텍스트에 로드될 때마다 소비되는 대략적인 토큰 수입니다. 수치가 높을수록 다른 작업에 사용할 수 있는 주의가 줄어듭니다.
설치
원클릭 설치
`claude_desktop_config.json` 파일에 다음을 추가하세요:
{
"mcpServers": {
"screwtape": {
"url": "https://screwtape.ai/mcp"
}
}
}원격 엔드포인트
https://screwtape.ai/mcpstreamable-http할 수 있는 일
도구 목록
도구 (6)
🟢judge(task, agent_output, evidence, criteria, retain, ...)
An independent pass/fail/retry verdict on ONE agent output. Call it before you 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. A free key covers 100 calls per UTC day; without a key, pay $0.005 USDC on Base or Solana per call with x402. Without a key or payment, tools/call is HTTP 200 with isError true and the x402 PaymentRequirements in structuredContent. Retry with params._meta['x402/payment'].
입력 스키마
{
"type": "object",
"properties": {
"task": {
"type": "string",
"description": "The original instruction or question the agent was answering."
},
"agent_output": {
"type": "string",
"description": "The agent's draft answer to check. Pass JSON as a 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."
},
"criteria": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional. Facts or terms the answer must contain, one per string."
},
"retain": {
"type": "boolean",
"description": "Optional. true stores this call for 24 hours; requires an API key. Default false stores nothing."
},
"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",
"maxItems": 8,
"description": "Optional. The worker runs each check. A failed check forces verdict fail. Types: url_contains, json_schema, equals, regex, numeric, onchain, required_fields, types, format, sum, duplicate. duplicate (at most 1, API key only) compares an invoice with ones this key 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.",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"type",
"paths"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "required_fields"
},
"paths": {
"type": "array",
"minItems": 1,
"maxItems": 50,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
}
}
}
},
{
"type": "object",
"required": [
"type",
"fields"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "types"
},
"fields": {
"type": "object",
"minProperties": 1,
"maxProperties": 50,
"additionalProperties": {
"enum": [
"string",
"number",
"integer",
"boolean",
"object",
"array",
"null"
]
}
}
}
},
{
"type": "object",
"required": [
"type",
"field",
"format"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "format"
},
"field": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"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"
]
}
}
},
{
"type": "object",
"required": [
"type",
"parts",
"total"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "sum"
},
"parts": {
"type": "array",
"minItems": 1,
"maxItems": 20,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
}
},
"total": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"tolerance": {
"type": "number",
"minimum": 0,
"maximum": 1000000,
"default": 0.0001
}
}
},
{
"type": "object",
"required": [
"type",
"vendor_path",
"invoice_id_path",
"amount_path"
],
"additionalProperties": false,
"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.",
"properties": {
"type": {
"const": "duplicate"
},
"vendor_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"invoice_id_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"amount_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"currency_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"date_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path to a YYYY-MM-DD invoice date. Enables the same vendor, amount and date rule."
},
"window_days": {
"type": "integer",
"minimum": 0,
"maximum": 30,
"default": 3
},
"store": {
"type": "boolean",
"default": false,
"description": "Record this invoice's fingerprints so later calls can match it."
},
"retain_days": {
"type": "integer",
"minimum": 1,
"maximum": 400,
"default": 180
}
}
},
{
"type": "object",
"required": [
"type"
],
"description": "Existing types, unchanged: url_contains, json_schema, equals, regex, numeric, onchain.",
"properties": {
"type": {
"enum": [
"url_contains",
"json_schema",
"equals",
"regex",
"numeric",
"onchain"
]
}
}
}
]
}
},
"agent_id": {
"type": "string",
"maxLength": 64,
"pattern": "^[A-Za-z0-9._:-]{1,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."
},
"version": {
"type": "string",
"maxLength": 64,
"description": "Optional version tag for that agent. At most 64 characters."
},
"mode": {
"type": "string",
"enum": [
"blocking",
"advisory"
],
"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."
}
},
"required": [
"task",
"agent_output"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"verdict": {
"type": "string",
"enum": [
"pass",
"fail",
"retry"
]
},
"score": {
"type": "number"
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Also signed into the receipt."
},
"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": {
"type": "string",
"enum": [
"verified",
"judged",
"heuristic",
"failed"
]
},
"claims": {
"type": "array"
},
"checks": {
"type": "array"
},
"next_step": {
"type": "object",
"required": [
"action",
"error_type",
"hint"
],
"additionalProperties": false,
"properties": {
"action": {
"type": "string",
"enum": [
"pass",
"retry",
"escalate"
],
"description": "pass: use the output. retry: fix it using hint and call again. escalate: stop and hand to a person."
},
"error_type": {
"type": "string",
"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",
"quality_issue",
"contradicted_claims",
"rejected",
"low_confidence",
"unverifiable",
"false_consensus_risk",
"primary_engine_unavailable"
]
},
"hint": {
"type": "string",
"maxLength": 300,
"description": "Template text naming fields and types to fix. Never contains values from agent_output."
}
}
},
"request_id": {
"type": "string"
},
"retention": {
"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."
},
"agent_id": {
"type": "string",
"description": "Echoed when the call sent an agent_id tag."
},
"version": {
"type": "string",
"description": "Echoed when the call sent a version tag."
},
"mode": {
"type": "string",
"enum": [
"advisory"
],
"description": "Present only when the call sent mode: advisory."
},
"decision_owner": {
"type": "string",
"enum": [
"human"
],
"description": "Advisory only. A person owns the decision."
},
"recommended_action": {
"type": "string",
"enum": [
"approve",
"review",
"return"
],
"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."
},
"notice": {
"type": "string",
"description": "Advisory only. Fixed text: the call does not approve, hold or release any payment."
},
"receipt": {
"type": "object",
"additionalProperties": false,
"required": [
"receipt_id",
"issued_at",
"endpoint",
"request_sha256",
"verdict",
"score",
"payment",
"alg",
"kid",
"signature"
],
"properties": {
"schema_version": {
"type": "integer",
"enum": [
2,
3,
4,
5
],
"description": "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."
},
"receipt_id": {
"type": "string"
},
"issued_at": {
"type": "string",
"description": "ISO-8601 UTC timestamp."
},
"endpoint": {
"type": "string",
"enum": [
"/v1/judge",
"/v1/consensus"
]
},
"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."
},
"verdict": {
"type": "string",
"description": "Judge verdict (pass, fail, or retry). For consensus this is false_consensus_risk (low, medium, or high)."
},
"score": {
"type": "number",
"description": "Judge score from 0 to 1. For consensus this is agreement_score."
},
"payment": {
"type": "object",
"additionalProperties": false,
"required": [
"type"
],
"description": "x402 includes tx, network, and payer. Schema 4 free-key and prepaid payments are the label only, with no key_prefix. Schema 3 may include the key display prefix, not the secret. demo is the /try/ allowance.",
"properties": {
"type": {
"type": "string",
"enum": [
"x402",
"free-key",
"prepaid",
"demo"
]
},
"tx": {
"type": "string",
"description": "Settled transaction id, or the accepted payment nonce when nothing was settled."
},
"network": {
"type": "string"
},
"payer": {
"type": "string"
},
"key_prefix": {
"type": "string",
"description": "Present on schema 3 free-key and prepaid payments. Omitted on schema 4. Never the secret."
}
}
},
"alg": {
"type": "string",
"enum": [
"Ed25519"
]
},
"kid": {
"type": "string"
},
"signature": {
"type": "string",
"description": "Unpadded base64url Ed25519 signature over the canonical JSON of every field except signature."
},
"agent_id": {
"type": "string",
"description": "Present when the call sent an agent_id tag. Omitted otherwise. Older receipts omit it."
},
"version": {
"type": "string",
"description": "Present when the call sent a version tag. Omitted otherwise. Older receipts omit it."
},
"verification": {
"type": "string",
"enum": [
"verified",
"judged",
"heuristic",
"failed"
],
"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."
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Present on schema 3 and 4."
},
"checks": {
"type": "array",
"description": "Type, passed, and evidence_hash only. Fetched page text and chain responses are not stored.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"passed",
"evidence_hash"
],
"properties": {
"type": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"evidence_hash": {
"type": "string"
}
}
}
},
"mode": {
"type": "string",
"enum": [
"advisory"
],
"description": "Present only on schema 5: the call was advisory, so a person, not the API, owned the decision. Blocking receipts omit it."
},
"claims": {
"type": "object",
"additionalProperties": false,
"required": [
"total",
"supported",
"contradicted",
"unsupported"
],
"properties": {
"total": {
"type": "integer"
},
"supported": {
"type": "integer"
},
"contradicted": {
"type": "integer"
},
"unsupported": {
"type": "integer"
}
}
}
}
}
},
"required": [
"verdict",
"score",
"reasons",
"request_id"
]
}🟢check_duplicate_invoice(task, agent_output, evidence, criteria, retain, ...)
Duplicate invoice check before an agent pays. Same as judge with one duplicate check: it compares this invoice with the invoices this API key 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?, 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. Needs Authorization: Bearer, because fingerprints are kept per key; only keyed HMAC fingerprints are stored, and only when store is true. Cost: 1 call, the same price as judge. Without a key or payment, tools/call is HTTP 200 with isError true and the x402 PaymentRequirements in structuredContent; an x402 payment without a key returns key_required and is not settled.
입력 스키마
{
"type": "object",
"properties": {
"task": {
"type": "string",
"description": "The original instruction or question the agent was answering."
},
"agent_output": {
"type": "string",
"description": "The invoice or payment instruction the agent is about to pay, as a JSON 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."
},
"criteria": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional. Facts or terms the answer must contain, one per string."
},
"retain": {
"type": "boolean",
"description": "Optional. true stores this call for 24 hours; requires an API key. Default false stores nothing."
},
"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",
"maxItems": 8,
"description": "Optional. The worker runs each check. A failed check forces verdict fail. Types: url_contains, json_schema, equals, regex, numeric, onchain, required_fields, types, format, sum, duplicate. duplicate (at most 1, API key only) compares an invoice with ones this key 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.",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"type",
"paths"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "required_fields"
},
"paths": {
"type": "array",
"minItems": 1,
"maxItems": 50,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
}
}
}
},
{
"type": "object",
"required": [
"type",
"fields"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "types"
},
"fields": {
"type": "object",
"minProperties": 1,
"maxProperties": 50,
"additionalProperties": {
"enum": [
"string",
"number",
"integer",
"boolean",
"object",
"array",
"null"
]
}
}
}
},
{
"type": "object",
"required": [
"type",
"field",
"format"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "format"
},
"field": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"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"
]
}
}
},
{
"type": "object",
"required": [
"type",
"parts",
"total"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "sum"
},
"parts": {
"type": "array",
"minItems": 1,
"maxItems": 20,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
}
},
"total": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"tolerance": {
"type": "number",
"minimum": 0,
"maximum": 1000000,
"default": 0.0001
}
}
},
{
"type": "object",
"required": [
"type",
"vendor_path",
"invoice_id_path",
"amount_path"
],
"additionalProperties": false,
"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.",
"properties": {
"type": {
"const": "duplicate"
},
"vendor_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"invoice_id_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"amount_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"currency_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"date_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path to a YYYY-MM-DD invoice date. Enables the same vendor, amount and date rule."
},
"window_days": {
"type": "integer",
"minimum": 0,
"maximum": 30,
"default": 3
},
"store": {
"type": "boolean",
"default": false,
"description": "Record this invoice's fingerprints so later calls can match it."
},
"retain_days": {
"type": "integer",
"minimum": 1,
"maximum": 400,
"default": 180
}
}
},
{
"type": "object",
"required": [
"type"
],
"description": "Existing types, unchanged: url_contains, json_schema, equals, regex, numeric, onchain.",
"properties": {
"type": {
"enum": [
"url_contains",
"json_schema",
"equals",
"regex",
"numeric",
"onchain"
]
}
}
}
]
}
},
"agent_id": {
"type": "string",
"maxLength": 64,
"pattern": "^[A-Za-z0-9._:-]{1,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."
},
"version": {
"type": "string",
"maxLength": 64,
"description": "Optional version tag for that agent. At most 64 characters."
},
"mode": {
"type": "string",
"enum": [
"blocking",
"advisory"
],
"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."
},
"duplicate": {
"type": "object",
"additionalProperties": false,
"description": "The duplicate check: dot paths into agent_output for vendor, invoice id and amount, plus optional currency_path, date_path, window_days, store and retain_days. store true records this invoice's keyed fingerprints so later calls can match it.",
"required": [
"vendor_path",
"invoice_id_path",
"amount_path"
],
"properties": {
"type": {
"const": "duplicate"
},
"vendor_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"invoice_id_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"amount_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"currency_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path into the output JSON, at most 8 segments, e.g. invoice.total or items.0.id."
},
"date_path": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Dot path to a YYYY-MM-DD invoice date. Enables the same vendor, amount and date rule."
},
"window_days": {
"type": "integer",
"minimum": 0,
"maximum": 30,
"default": 3
},
"store": {
"type": "boolean",
"default": false,
"description": "Record this invoice's fingerprints so later calls can match it."
},
"retain_days": {
"type": "integer",
"minimum": 1,
"maximum": 400,
"default": 180
}
}
}
},
"required": [
"task",
"agent_output",
"duplicate"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"verdict": {
"type": "string",
"enum": [
"pass",
"fail",
"retry"
]
},
"score": {
"type": "number"
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Also signed into the receipt."
},
"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": {
"type": "string",
"enum": [
"verified",
"judged",
"heuristic",
"failed"
]
},
"claims": {
"type": "array"
},
"checks": {
"type": "array"
},
"next_step": {
"type": "object",
"required": [
"action",
"error_type",
"hint"
],
"additionalProperties": false,
"properties": {
"action": {
"type": "string",
"enum": [
"pass",
"retry",
"escalate"
],
"description": "pass: use the output. retry: fix it using hint and call again. escalate: stop and hand to a person."
},
"error_type": {
"type": "string",
"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",
"quality_issue",
"contradicted_claims",
"rejected",
"low_confidence",
"unverifiable",
"false_consensus_risk",
"primary_engine_unavailable"
]
},
"hint": {
"type": "string",
"maxLength": 300,
"description": "Template text naming fields and types to fix. Never contains values from agent_output."
}
}
},
"request_id": {
"type": "string"
},
"retention": {
"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."
},
"agent_id": {
"type": "string",
"description": "Echoed when the call sent an agent_id tag."
},
"version": {
"type": "string",
"description": "Echoed when the call sent a version tag."
},
"mode": {
"type": "string",
"enum": [
"advisory"
],
"description": "Present only when the call sent mode: advisory."
},
"decision_owner": {
"type": "string",
"enum": [
"human"
],
"description": "Advisory only. A person owns the decision."
},
"recommended_action": {
"type": "string",
"enum": [
"approve",
"review",
"return"
],
"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."
},
"notice": {
"type": "string",
"description": "Advisory only. Fixed text: the call does not approve, hold or release any payment."
},
"receipt": {
"type": "object",
"additionalProperties": false,
"required": [
"receipt_id",
"issued_at",
"endpoint",
"request_sha256",
"verdict",
"score",
"payment",
"alg",
"kid",
"signature"
],
"properties": {
"schema_version": {
"type": "integer",
"enum": [
2,
3,
4,
5
],
"description": "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."
},
"receipt_id": {
"type": "string"
},
"issued_at": {
"type": "string",
"description": "ISO-8601 UTC timestamp."
},
"endpoint": {
"type": "string",
"enum": [
"/v1/judge",
"/v1/consensus"
]
},
"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."
},
"verdict": {
"type": "string",
"description": "Judge verdict (pass, fail, or retry). For consensus this is false_consensus_risk (low, medium, or high)."
},
"score": {
"type": "number",
"description": "Judge score from 0 to 1. For consensus this is agreement_score."
},
"payment": {
"type": "object",
"additionalProperties": false,
"required": [
"type"
],
"description": "x402 includes tx, network, and payer. Schema 4 free-key and prepaid payments are the label only, with no key_prefix. Schema 3 may include the key display prefix, not the secret. demo is the /try/ allowance.",
"properties": {
"type": {
"type": "string",
"enum": [
"x402",
"free-key",
"prepaid",
"demo"
]
},
"tx": {
"type": "string",
"description": "Settled transaction id, or the accepted payment nonce when nothing was settled."
},
"network": {
"type": "string"
},
"payer": {
"type": "string"
},
"key_prefix": {
"type": "string",
"description": "Present on schema 3 free-key and prepaid payments. Omitted on schema 4. Never the secret."
}
}
},
"alg": {
"type": "string",
"enum": [
"Ed25519"
]
},
"kid": {
"type": "string"
},
"signature": {
"type": "string",
"description": "Unpadded base64url Ed25519 signature over the canonical JSON of every field except signature."
},
"agent_id": {
"type": "string",
"description": "Present when the call sent an agent_id tag. Omitted otherwise. Older receipts omit it."
},
"version": {
"type": "string",
"description": "Present when the call sent a version tag. Omitted otherwise. Older receipts omit it."
},
"verification": {
"type": "string",
"enum": [
"verified",
"judged",
"heuristic",
"failed"
],
"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."
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Present on schema 3 and 4."
},
"checks": {
"type": "array",
"description": "Type, passed, and evidence_hash only. Fetched page text and chain responses are not stored.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"passed",
"evidence_hash"
],
"properties": {
"type": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"evidence_hash": {
"type": "string"
}
}
}
},
"mode": {
"type": "string",
"enum": [
"advisory"
],
"description": "Present only on schema 5: the call was advisory, so a person, not the API, owned the decision. Blocking receipts omit it."
},
"claims": {
"type": "object",
"additionalProperties": false,
"required": [
"total",
"supported",
"contradicted",
"unsupported"
],
"properties": {
"total": {
"type": "integer"
},
"supported": {
"type": "integer"
},
"contradicted": {
"type": "integer"
},
"unsupported": {
"type": "integer"
}
}
}
}
}
},
"required": [
"verdict",
"score",
"reasons",
"request_id"
]
}🟢consensus(task, answers, evidence, retain, share, ...)
False-consensus check for 2 to 16 answers to the same task. 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. A free key covers 100 calls per UTC day; without a key, pay $0.005 USDC on Base or Solana per call with x402.
입력 스키마
{
"type": "object",
"properties": {
"task": {
"type": "string",
"description": "The question all answers respond to."
},
"answers": {
"type": "array",
"minItems": 2,
"maxItems": 16,
"description": "2 to 16 answers. Each is {agent_id (optional, string), output (string)}. Use one entry per independent agent or sample.",
"items": {
"type": "object",
"required": [
"output"
],
"properties": {
"agent_id": {
"type": "string",
"description": "Optional name of the agent or sample that produced this answer."
},
"output": {
"type": "string",
"description": "That agent's answer."
}
}
}
},
"evidence": {
"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.",
"oneOf": [
{
"type": "string",
"maxLength": 4000
},
{
"type": "array",
"maxItems": 20,
"items": {
"type": "string",
"maxLength": 4000
}
}
]
},
"retain": {
"type": "boolean",
"description": "Optional. true stores this call for 24 hours; requires an API key. Default false."
},
"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."
},
"agent_id": {
"type": "string",
"maxLength": 64,
"pattern": "^[A-Za-z0-9._:-]{1,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."
},
"version": {
"type": "string",
"maxLength": 64,
"description": "Optional version tag for that agent. At most 64 characters."
},
"mode": {
"type": "string",
"enum": [
"blocking",
"advisory"
],
"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."
}
},
"required": [
"task",
"answers"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"consensus_answer": {
"type": "string"
},
"agreement_score": {
"type": "number"
},
"false_consensus_risk": {
"type": "string",
"enum": [
"low",
"medium",
"high"
]
},
"reasons": {
"type": "array",
"items": {
"type": "string"
}
},
"clusters": {
"type": "array"
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo."
},
"verification": {
"type": "string",
"enum": [
"verified",
"judged",
"heuristic",
"failed"
]
},
"unsupported_agreement": {
"type": "boolean"
},
"next_step": {
"type": "object",
"required": [
"action",
"error_type",
"hint"
],
"additionalProperties": false,
"properties": {
"action": {
"type": "string",
"enum": [
"pass",
"retry",
"escalate"
],
"description": "pass: use the output. retry: fix it using hint and call again. escalate: stop and hand to a person."
},
"error_type": {
"type": "string",
"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",
"quality_issue",
"contradicted_claims",
"rejected",
"low_confidence",
"unverifiable",
"false_consensus_risk",
"primary_engine_unavailable"
]
},
"hint": {
"type": "string",
"maxLength": 300,
"description": "Template text naming fields and types to fix. Never contains values from agent_output."
}
}
},
"request_id": {
"type": "string"
},
"retention": {
"type": "object"
},
"agent_id": {
"type": "string",
"description": "Echoed when the call sent an agent_id tag. Not the per-answer agent_id."
},
"version": {
"type": "string",
"description": "Echoed when the call sent a version tag."
},
"mode": {
"type": "string",
"enum": [
"advisory"
],
"description": "Present only when the call sent mode: advisory."
},
"decision_owner": {
"type": "string",
"enum": [
"human"
],
"description": "Advisory only. A person owns the decision."
},
"recommended_action": {
"type": "string",
"enum": [
"approve",
"review",
"return"
],
"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."
},
"notice": {
"type": "string",
"description": "Advisory only. Fixed text: the call does not approve, hold or release any payment."
},
"receipt": {
"type": "object",
"additionalProperties": false,
"required": [
"receipt_id",
"issued_at",
"endpoint",
"request_sha256",
"verdict",
"score",
"payment",
"alg",
"kid",
"signature"
],
"properties": {
"schema_version": {
"type": "integer",
"enum": [
2,
3,
4,
5
],
"description": "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."
},
"receipt_id": {
"type": "string"
},
"issued_at": {
"type": "string",
"description": "ISO-8601 UTC timestamp."
},
"endpoint": {
"type": "string",
"enum": [
"/v1/judge",
"/v1/consensus"
]
},
"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."
},
"verdict": {
"type": "string",
"description": "Judge verdict (pass, fail, or retry). For consensus this is false_consensus_risk (low, medium, or high)."
},
"score": {
"type": "number",
"description": "Judge score from 0 to 1. For consensus this is agreement_score."
},
"payment": {
"type": "object",
"additionalProperties": false,
"required": [
"type"
],
"description": "x402 includes tx, network, and payer. Schema 4 free-key and prepaid payments are the label only, with no key_prefix. Schema 3 may include the key display prefix, not the secret. demo is the /try/ allowance.",
"properties": {
"type": {
"type": "string",
"enum": [
"x402",
"free-key",
"prepaid",
"demo"
]
},
"tx": {
"type": "string",
"description": "Settled transaction id, or the accepted payment nonce when nothing was settled."
},
"network": {
"type": "string"
},
"payer": {
"type": "string"
},
"key_prefix": {
"type": "string",
"description": "Present on schema 3 free-key and prepaid payments. Omitted on schema 4. Never the secret."
}
}
},
"alg": {
"type": "string",
"enum": [
"Ed25519"
]
},
"kid": {
"type": "string"
},
"signature": {
"type": "string",
"description": "Unpadded base64url Ed25519 signature over the canonical JSON of every field except signature."
},
"agent_id": {
"type": "string",
"description": "Present when the call sent an agent_id tag. Omitted otherwise. Older receipts omit it."
},
"version": {
"type": "string",
"description": "Present when the call sent a version tag. Omitted otherwise. Older receipts omit it."
},
"verification": {
"type": "string",
"enum": [
"verified",
"judged",
"heuristic",
"failed"
],
"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."
},
"engine": {
"type": "string",
"description": "groq, workers_ai, deterministic, or demo. Present on schema 3 and 4."
},
"checks": {
"type": "array",
"description": "Type, passed, and evidence_hash only. Fetched page text and chain responses are not stored.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"passed",
"evidence_hash"
],
"properties": {
"type": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"evidence_hash": {
"type": "string"
}
}
}
},
"mode": {
"type": "string",
"enum": [
"advisory"
],
"description": "Present only on schema 5: the call was advisory, so a person, not the API, owned the decision. Blocking receipts omit it."
},
"claims": {
"type": "object",
"additionalProperties": false,
"required": [
"total",
"supported",
"contradicted",
"unsupported"
],
"properties": {
"total": {
"type": "integer"
},
"supported": {
"type": "integer"
},
"contradicted": {
"type": "integer"
},
"unsupported": {
"type": "integer"
}
}
}
}
}
},
"required": [
"agreement_score",
"false_consensus_risk",
"reasons",
"request_id"
]
}🟡get_api_key(email, name, data_sharing, pow_nonce)
Create a free Screwtape.ai API key (100 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.
입력 스키마
{
"type": "object",
"properties": {
"email": {
"type": "string",
"description": "Optional. Omit it to store no email."
},
"name": {
"type": "string",
"maxLength": 80,
"description": "Optional agent or client name, at most 80 characters."
},
"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."
},
"pow_nonce": {
"type": "string",
"description": "Required. SHA-256 of the UTF-8 string screwtape-signup-v1:YYYY-MM-DD:<nonce> must have 12 leading zero bits. Nonce matches ^[A-Za-z0-9_-]{8,64}$. YYYY-MM-DD is the UTC day."
}
},
"required": [
"pow_nonce"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"api_key": {
"type": "string"
},
"key": {
"type": "object"
},
"request_id": {
"type": "string"
}
},
"required": [
"api_key",
"key",
"request_id"
]
}🟢buy_pack(pack)
Return the x402 payment requirements for a Starter ($40, 10000 calls) or Builder ($175, 50000 calls) prepaid pack, plus how to pay with USDC on Base or Solana. pack is starter or builder. This call does not move funds and does not require a key or a payment. POST /v1/packs/{pack}/buy with PAYMENT-SIGNATURE to pay. Pay with PayPal at POST /v1/packs/checkout.
입력 스키마
{
"type": "object",
"properties": {
"pack": {
"type": "string",
"enum": [
"starter",
"builder"
],
"description": "starter ($40, 10000 calls) or builder ($175, 50000 calls)."
}
},
"required": [
"pack"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"description": "Payment requirements and how to buy the pack. This tool does not move funds."
}🟡publish_receipt(receipt_id, include_content, label, unpublish)
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. It does not accept x402 payment. Cost: free.
입력 스키마
{
"type": "object",
"properties": {
"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."
},
"label": {
"type": "string",
"maxLength": 80,
"description": "Optional label, at most 80 characters."
},
"unpublish": {
"type": "boolean",
"description": "true removes the public page and the badge."
}
},
"required": [
"receipt_id"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"public_url": {
"type": "string"
},
"badge_svg_url": {
"type": "string"
},
"embed_html": {
"type": "string"
},
"embed_markdown": {
"type": "string"
},
"unpublished": {
"type": "boolean"
},
"request_id": {
"type": "string"
}
}
}커뮤니티
증거