← 返回 Skills 市场
ichiorca

Ucp Ap2 Mandates

作者 Rohit Bajaj · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
81
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ucp-ap2-mandates
功能描述
Implement UCP AP2 Mandates extension — cryptographic payment mandates for fully autonomous agent commerce using SD-JWT credentials, merchant authorization si...
使用说明 (SKILL.md)

UCP AP2 Mandates Extension

Before writing code

Fetch live spec:

Conceptual Architecture

What AP2 Enables

AP2 (Agent Payments Protocol) enables fully autonomous agent commerce — the agent can authorize payments cryptographically without requiring real-time human approval for each transaction. The user pre-authorizes spending parameters, and the agent proves authorization via signed credentials.

Two Mandate Artifacts

  1. Checkout Mandate (ap2.checkout_mandate): An SD-JWT+kb (Selective Disclosure JWT with Key Binding) credential that proves the user authorized the agent to complete this specific checkout at these specific terms.

  2. Payment Mandate (payment_data.token): A separate credential proving payment authorization, verified by the PSP (not the Business).

Merchant Authorization

Before the Platform generates mandates, the Business must sign the checkout terms:

  • Format: JWS Detached Content (RFC 7515 Appendix F) — \x3Cheader>..\x3Csignature>
  • Canonicalization: JSON Canonicalization Scheme (RFC 8785)
  • Algorithms: ES256, ES384, ES512 (elliptic curve)

The Business returns this merchant_authorization in the checkout response.

7-Step Flow

  1. Discovery — Business publishes AP2 support in capabilities
  2. Session Activation — Platform signals AP2 intent
  3. Business Signing — Business returns checkout + merchant_authorization (JWS detached content)
  4. Authorization Generation — Platform creates CheckoutMandate (SD-JWT-VC) + PaymentMandate
  5. Submission — Platform sends both mandates in the complete_checkout call
  6. Verification — Business verifies checkout mandate; PSP verifies payment mandate
  7. Confirmation — Order confirmed

Security Lock

Once AP2 is negotiated for a checkout session, a Security Lock is activated: neither party may revert to a standard (non-AP2) checkout flow for that session. This prevents downgrade attacks where a malicious actor could bypass the cryptographic mandate requirements by falling back to a simpler payment flow.

Error Codes

AP2-specific errors:

  • mandate_required — AP2 mandates needed but not provided
  • agent_missing_key — Agent's signing key not found
  • mandate_invalid_signature — Signature verification failed
  • mandate_expired — Mandate past validity window
  • mandate_scope_mismatch — Mandate doesn't match checkout terms
  • merchant_authorization_invalid — Business signature invalid
  • merchant_authorization_missing — Business didn't sign terms

Implementation Guidance

This is the most complex UCP extension. Before implementing:

  1. Understand SD-JWT-VC (Selective Disclosure JWT Verifiable Credentials) — this is the credential format
  2. Understand JWS Detached Content (RFC 7515 Appendix F) — this is the merchant signing format
  3. Understand JSON Canonicalization (RFC 8785) — deterministic JSON serialization for signing
  4. Fetch the latest AP2 protocol spec from https://ap2-protocol.org for the full mandate lifecycle
  5. Check the conformance test suite: https://github.com/Universal-Commerce-Protocol/conformance (ap2_test.py)

This extension is intended for advanced autonomous agent scenarios. Most initial implementations should start with standard payment handlers (Google Pay, Shop Pay) before adding AP2.

安全使用建议
This skill appears safe as an instruction-only protocol guide. Before using it to build or deploy payment flows, make sure autonomous purchases are bounded by explicit user-approved limits, short-lived mandates, verification checks, and clear logging.
功能分析
Type: OpenClaw Skill Name: ucp-ap2-mandates Version: 1.0.0 The skill bundle (ucp-ap2-mandates) contains instructions in SKILL.md directing the AI agent to fetch and implement complex cryptographic payment logic from external domains (ucp.dev, ap2-protocol.org) and GitHub. While the stated purpose of autonomous agent commerce is consistent, the instruction to retrieve and follow unverified external specifications constitutes a risky capability (network access and external instruction fetching) that could be leveraged for remote prompt injection or the delivery of malicious payloads, fitting the criteria for suspicious behavior without clear evidence of malice.
能力标签
cryptocan-make-purchases
能力评估
Purpose & Capability
The stated purpose is coherent: it explains UCP/AP2 cryptographic payment mandates. The capability is financially sensitive because it is about autonomous payment authorization.
Instruction Scope
The instructions explicitly describe payment flows without real-time human approval after pre-authorization. This is disclosed and central to AP2, but users should ensure strict spending and scope limits.
Install Mechanism
There is no install spec, code, binary, or package execution. The guide does direct the agent to fetch live external specifications, which is expected for implementation guidance but should be verified before use.
Credentials
No credentials, environment variables, or config paths are requested by the skill itself. A real implementation would involve payment credentials and signing keys, so deployment should be carefully scoped.
Persistence & Privilege
The artifacts do not show persistence, background workers, credential harvesting, or local key-storage instructions. They only discuss cryptographic mandates conceptually.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ucp-ap2-mandates
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ucp-ap2-mandates 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of the ucp-ap2-mandates extension. - Implements AP2 Mandates for fully autonomous agent payment flows using SD-JWT credentials and cryptographic authorization. - Supports merchant authorization via JWS detached signatures with canonicalized JSON. - Enforces Security Lock: sessions using AP2 can't downgrade to standard checkout flows. - Documents the two mandate artifacts: Checkout Mandate (SD-JWT+kb) and Payment Mandate. - Lists AP2-specific error codes for debugging and integration. - Provides guidance on required specs, cryptographic formats, and conformance testing.
元数据
Slug ucp-ap2-mandates
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Ucp Ap2 Mandates 是什么?

Implement UCP AP2 Mandates extension — cryptographic payment mandates for fully autonomous agent commerce using SD-JWT credentials, merchant authorization si... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 81 次。

如何安装 Ucp Ap2 Mandates?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ucp-ap2-mandates」即可一键安装,无需额外配置。

Ucp Ap2 Mandates 是免费的吗?

是的,Ucp Ap2 Mandates 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Ucp Ap2 Mandates 支持哪些平台?

Ucp Ap2 Mandates 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ucp Ap2 Mandates?

由 Rohit Bajaj(@ichiorca)开发并维护,当前版本 v1.0.0。

💬 留言讨论