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
Configuration
Environment variables
Custom guard configuration
Next steps
- Guards reference - Deep dive into each guard
- Examples - Real-world use cases
- FastAPI middleware - Python integration
- Express.js middleware - Node.js integration
- Troubleshooting - Common issues
Links
- GitHub: QWED-AI/qwed-ucp
- PyPI: qwed-ucp
- npm: qwed-ucp-middleware
- UCP Protocol: developers.google.com/commerce/ucp