Skip to main content
Verify AI-driven commerce transactions before they reach payment. PyPI version Tests License

What is QWED-UCP?

QWED-UCP provides deterministic verification guards for the Universal Commerce Protocol (UCP) - Google’s open standard for AI-driven commerce.

The problem

When AI agents shop on behalf of users, they can make calculation errors that result in:
  • πŸ’Έ Wrong totals - Customers overcharged or undercharged
  • πŸ“‰ Bad discounts - Percentage calculations off
  • 🧾 Incorrect tax - Legal compliance issues
  • πŸ’± Currency errors - International payment failures

The solution

QWED-UCP intercepts checkout requests and mathematically verifies every calculation before payment:

How it works


The 10 guards


Installation

Python (PyPI)

Node.js (npm)


Quick start

Basic verification

Middleware integration (FastAPI)

Middleware integration (Express.js)


GitHub Action (CI/CD)

Use QWED-UCP as a GitHub Action to audit transaction logs in your CI/CD pipeline.

Installation

Add to your workflow (.github/workflows/commerce-audit.yml):

Parameters

What gets audited

The Action scans all .json files in the specified path and verifies:
  • βœ… Line item math: price Γ— quantity = total
  • βœ… Discount calculations
  • βœ… Tax amounts
  • βœ… Currency format (ISO 4217)
  • βœ… No β€œPenny Slicing” (rounding theft)

Example output


Why QWED-UCP?

Business impact

ROI calculation

For a platform processing 100M transactions/year:
  • Error rate without verification: ~0.1%
  • Errors per year: 100,000 transactions
  • Average error cost: $6.39 (dispute handling + refunds)
  • Potential loss: $638,700/year
QWED-UCP catches these errors before they become expensive problems.

Configuration

Environment variables

Custom guard configuration


Next steps