Testing and Validation
9.1 UCP Profile Validation
The Profile is the entry point for every AI agent connection and must pass rigorous validation.Basic Checks
Profile Field Validation Checklist
| Field | Validation Rule | Required |
|---|---|---|
supported_versions | Non-empty array containing valid date-formatted version strings | Yes |
services | At least one service; base_url must be HTTPS | Yes |
capabilities | At least one capability; namespace format must be correct | Yes |
capabilities.*.version | Valid date format; within the supported_versions range | Yes |
payment_handlers | Array with reverse-DNS naming format | No |
signing_keys | JWK array; each key must have kid, kty, crv, x, y, use, alg | No |
Automated Profile Validation Script
9.2 Checkout Flow Testing
Complete Checkout Flow
State Machine Validation
Test all six status transition paths for correctness:| Test Scenario | Initial Status | Operation | Expected Result |
|---|---|---|---|
| Create empty session | - | Create | incomplete |
| Provide complete information | incomplete | Update | ready_for_complete |
| Submit for completion | ready_for_complete | Complete | complete_in_progress |
| Cancel an in-progress session | incomplete | Cancel | canceled |
| Cancel a completed session | completed | Cancel | 400 error |
| Update a canceled session | canceled | Update | 400 error |
| Trigger human escalation | incomplete | Specific condition | requires_escalation |
9.3 Product Data Validation
Every product record must pass the following validation:9.4 Signature Verification Testing
If Webhook signing is configured, test both signature creation and verification:9.5 OAuth Flow Testing
9.6 Performance Benchmarks
UCP endpoints should respond within reasonable timeframes:| Endpoint Type | Response Time Target | Concurrency Requirement |
|---|---|---|
/.well-known/ucp Profile | Under 100ms | 100+ QPS |
| Product search | Under 500ms | 50+ QPS |
| Product details | Under 200ms | 100+ QPS |
| Checkout operations | Under 1s | 20+ QPS |
| OAuth token endpoint | Under 300ms | 50+ QPS |
9.7 Common Issues and Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| AI agent cannot discover Profile | 3xx redirect or non-HTTPS | Ensure a direct 200 response with no redirects |
| Cache-Control validation fails | max-age below 60 seconds | Set public, max-age=3600 |
| Prices display incorrectly | Not using minor currency units | Confirm that amount is an integer (cents), not a decimal |
| Signature verification fails | kid mismatch or expired key | Check that the kid in signing_keys matches the Signature-Input |
| OAuth flow breaks | Missing PKCE support | Implement S256 code_challenge verification |
| Capability negotiation returns empty | Version mismatch | Ensure both parties have overlapping supported_versions |
| Webhooks not received | Signature verification rejected | Verify Content-Digest and Signature are correct |
Next chapter: Case Studies and Extensions — Buyer Consent extension, AP2 Mandate, and real-world integration paths