Skip to main content
Real-world examples of using QWED-UCP for commerce verification.

Example 1: e-commerce checkout

Scenario

An AI shopping assistant helps a user buy flowers online. The AI calculates discounts and taxes.

The checkout data

Verification


Example 2: international currency (Japan)

Scenario

AI agent booking a hotel in Tokyo. JPY has no decimal places.

Correct (verified)

Incorrect (blocked)


Example 3: discount validation

Scenario

AI applies a “20% off” coupon. Need to verify the math.

Percentage discount

AI makes mistake


Example 4: state machine transitions

Scenario

Checkout progresses through states. Invalid transitions should be blocked.

Valid flow

Invalid transition (blocked)


Example 5: FastAPI production setup

Full implementation


Example 6: Express.js production setup

Full implementation


Example 7: testing with pytest

Unit tests for guards


Best practices

1. Always verify before payment

2. Use middleware in production

Middleware catches errors automatically:

3. Log verification failures

4. Set appropriate tolerance