360 Secure SkillHub
360 安全技能中心

XAPS Tollbooth

该技能在代理签署或结算 x402/钱包交易前调用 XAPS Tollbooth 生成预执行审计回执,付款方仅在状态为 APPROVED 时附加回执;收款方或协调方可无需密钥独立校验回执、用例、金额、收款方与资源是否匹配。它不持有资金、不执行交易,也不提供保险或安全保证。

sentvan23
sentvan23
热度 7.65
最近更新 2026-09-17 19:03:20
分类:安全依赖:代码执行 / 第三方 API应用场景:财务 / API 集成 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add xaps
Metadata
name
xaps
description
Audit agent value moves before sign or settle. Payers attach X-XAPS-Receipt; counterparties independently clear. Advisory receipt, not insurance — XAPS does not execute or warrant the transfer.
version
1.0.0
metadata
{"openclaw":{"requires":{"bins":["curl"]},"envVars":[{"name":"XAPS_AGENT_KEY","required":false,"description":"Payer key for POST /verify. Required only when this agent signs or pays. Not needed to clear another agent's receipt."},{"name":"XAPS_API_URL","required":false,"description":"Tollbooth base URL. Default https://api.xaps.network"}],"emoji":"🛡️","homepage":"https://github.com/APMC1/xaps-sdk"}}

XAPS — pre-execution audit for value moves

XAPS is a live Tollbooth. It does not wrap x402 or hold funds. It issues a portable receipt before an agent signs, pays, or settles.

  • Payers attach X-XAPS-Receipt.
  • Payees and facilitators clear that id themselves (no agent key).
  • Refuse value unless clear is true, use_case is value_move, and amount / pay_to / resource match this 402.

External cost (Tollbooth, not this skill): about $0.01 per approved payer audit. Register at POST https://api.xaps.network/agents/register.

The fee buys an attested decision (APPROVED / REJECTED) over a payload_hash. It is not insurance, not custody, not settlement, and not a warranty that the action is safe. XAPS does not sign, send, or settle the value. A wrong call is a wrong opinion; the agent that executes still owns the loss. Independent clear only proves this receipt exists, is value_move, and matches this 402 — not that the payment is good.

When to use

Use this skill when the agent is about to:

  • sign or retry an x402 payment (wrapFetchWithPayment, X-Payment)
  • send, sign, or submit a wallet/tx
  • settle or fulfill paid work from another agent

Do not use it for GitHub issues, docs, or read-only lookup.

Payer — audit then attach

Requires XAPS_AGENT_KEY. Fail closed if status is not APPROVED.

BASE="${XAPS_API_URL:-https://api.xaps.network}"
RECEIPT="$(curl -sS -X POST "$BASE/verify" \
  -H "Content-Type: application/json" \
  -H "X-Agent-Key: $XAPS_AGENT_KEY" \
  -d "{\"payload\":{\"action\":\"sign_x402_payment\",\"use_case\":\"value_move\",\"amount\":AMOUNT,\"pay_to\":\"PAY_TO\",\"resource\":\"RESOURCE_URL\"}}")"

Proceed only when audit.status is APPROVED. Put receipt_id on header X-XAPS-Receipt. No receipt → no sign.

Python:

from xaps import XapsClient, XapsRejectedError
receipt = XapsClient(base_url="https://api.xaps.network").audit(
    action="sign_x402_payment",
    use_case="value_move",
    amount=float(AMOUNT),
)
if receipt["audit"]["status"] != "APPROVED":
    raise XapsRejectedError(receipt["audit"].get("beta_attack", "REJECTED"), receipt=receipt)
# attach receipt["receipt_id"] as X-XAPS-Receipt

Payee / facilitator — clear independently

No agent key. Call this on the counterparty, not the payer.

BASE="${XAPS_API_URL:-https://api.xaps.network}"
curl -sS -X POST "$BASE/receipts/clear" \
  -H "Content-Type: application/json" \
  -d "{\"receipt_id\":\"RECEIPT_ID\",\"require_use_case\":\"value_move\",\"amount\":AMOUNT,\"pay_to\":\"PAY_TO\",\"resource\":\"RESOURCE_URL\"}"

Refuse unless clear is true. Mismatched amount / pay_to / resource fail closed.

Python:

from xaps import require_value_clearance
require_value_clearance(receipt_id, amount=AMOUNT, pay_to=PAY_TO, resource=RESOURCE_URL)

References