Agent SDK Secrets & HMAC Signing
Protect Agent API credentials and understand how the SDK generates timestamped, replay-resistant HMAC-SHA256 request signatures.
Agent SDK requests are authenticated with a partner API secret. Keep that secret inside a trusted backend service and let the SDK generate signing fields whenever possible.
Two signing protocols
Agent SDK signing uses sorted request fields, a seconds-based timestamp, and a nonce. Direct Developer API requests use the separate process described in Request Signing. Do not reuse one payload format for the other.
Signing rule
For Agent SDK requests:
- Exclude the
signfield. - Omit fields with empty values.
- Sort the remaining field names in ASCII order.
- Join the fields as
k=v&k2=v2. - Calculate the HMAC-SHA256 hexadecimal signature with
apiSecret.
Array values are serialized as compact JSON before joining the signing payload. For example, platformUserIds signs as ["1188041528"], giving platformUserIds=["1188041528"] in the k=v payload. Preserve the array element order, double quotes and string IDs; do not insert formatting spaces or use Java List.toString() (such as [1188041528]). The SDK handles this serialization automatically.
The SDK should build this value from the same data it sends. Changing a signed field after signature generation causes verification to fail.
SDK-managed fields
Secret storage
- Load
apiSecretfrom a backend secret manager or protected runtime configuration. - Never place the secret in frontend bundles, mobile apps, desktop clients, screenshots, or support tickets.
- Keep credentials for development, staging, and production separate.
- Limit access to the services and operators that require it.
- Redact request signatures, authorization values, and secrets from logs.
- Revoke and replace credentials when exposure is suspected.
Clock and replay protection
The SDK includes timestamp and nonce to reduce replay risk. Keep backend clocks synchronized and do not reuse a manually constructed nonce. If signature validation fails, confirm the configured secret, server time, serialized fields, and environment before retrying.