Security and Authentication
6.1 Authentication Mechanisms Overview
UCP supports four authentication mechanisms, each suited to different security requirements:| Mechanism | Standard | Use Case | Security Level |
|---|---|---|---|
| API Keys | Custom | Public catalog browsing, low-sensitivity operations | Basic |
| OAuth 2.0 | RFC 6749/6750 | Identity linking, acting on behalf of a user | Standard |
| mTLS | RFC 8705 | High-security server-to-server communication | High |
| HTTP Message Signatures | RFC 9421 | Webhook signature verification, request integrity | High |
API Keys
Suitable for scenarios that do not require user identity (e.g., browsing the public product catalog):ucp_pk_test_) and production (ucp_pk_live_) environments.
OAuth 2.0
See Chapter 3 for details. Used in scenarios that require acting on behalf of a consumer (checkout, order queries, etc.). UCP mandates the Authorization Code + PKCE flow.mTLS (Mutual TLS)
Mutual TLS authentication requires both client and server to present certificates. Suitable for high-security communication between platforms:HTTP Message Signatures (RFC 9421)
UCP Webhook notifications and critical API calls use HTTP Message Signatures to ensure integrity and authenticity. This is one of the most important mechanisms in the UCP security model.6.2 JWK Signing Keys
Merchants publish their signing public keys in the/.well-known/ucp Profile using the JSON Web Key (JWK) format:
| Field | Value | Description |
|---|---|---|
kid | string | Key identifier, used to locate a specific key among multiple keys |
kty | EC | Key type: Elliptic Curve |
crv | P-256 | Curve: NIST P-256 |
x | Base64URL | Elliptic curve public key X coordinate |
y | Base64URL | Elliptic curve public key Y coordinate |
use | sig | Usage: signing |
alg | ES256 | Algorithm: ECDSA with SHA-256 |
signing_keys array (distinguished by different kid values), enabling smooth key rotation. Old keys are retained during the transition period while new signatures use the new key.
6.3 HTTP Message Signatures (RFC 9421)
Signature Creation (Merchant Side)
When a merchant sends a Webhook, it creates a signature following the RFC 9421 standard: Step 1: Compute the Content-Digest of the request body (RFC 9530)@method: HTTP method (e.g., POST)@target-uri: Full request URIcontent-digest: Request body digestcontent-type: Content typecreated: Signature creation timestamp (Unix time)keyid: Corresponds to the JWKkidin the Profilealg: Signature algorithm
Signature Verification (AI Agent Side)
6.4 Content-Digest (RFC 9530)
The Content-Digest header provides integrity verification for the request body, preventing tampering during transmission:6.5 Transport Security
| Requirement | Description |
|---|---|
| HTTPS required | All UCP communication must use HTTPS; the Profile endpoint must not redirect |
| TLS 1.2+ | Minimum TLS 1.2; TLS 1.3 recommended |
| Certificate validation | AI agents must strictly validate merchant TLS certificates |
| HSTS | HTTP Strict Transport Security recommended |
| Certificate Transparency | Certificates logged in CT logs recommended |
6.6 Data Security and Privacy
UCP establishes clear security boundaries for data handling:| Data Type | AI Agent Permissions | Prohibited Actions |
|---|---|---|
| Product catalog | Cache and display to users | Use for model training |
| Buyer personal information | Pass to merchant to complete transaction | Store or share with third parties |
| Payment credentials | Pass through Payment Handler | Store, log, or forward |
| Order data | Display to the corresponding consumer | Aggregate analysis or data mining |
| Signing keys (private) | Should never access private keys | Any form of retrieval |
6.7 Security Best Practices
- Key rotation: Rotate JWK signing keys regularly. Publish both old and new keys in the Profile simultaneously to ensure a smooth transition.
- Rate limiting: Implement reasonable rate limits on all UCP endpoints.
- Audit logging: Maintain complete audit logs for all checkout and order operations.
- Signature time window: The
createdtimestamp in Webhook signatures should be within 5 minutes. - Token security: Access tokens must not appear in URL parameters or log files.
- CORS: UCP API endpoints should be configured with strict CORS policies.
- Input validation: All input parameters must be strictly validated for type and range.
Next chapter: Merchant Integration Guide —
/.well-known/ucp Profile deployment and capability declaration