Skip to main content
Kairo Shield signs each delivery with HMAC-SHA256 of the raw body (compact JSON, UTF-8).

Signature header

The value includes the sha256= prefix followed by the hexadecimal digest.

Verification steps

  1. Read the body without parsing (raw bytes/string).
  2. Compute HMAC-SHA256(body, secret) in hexadecimal.
  3. Compare with the header value without the sha256= prefix.
  4. Use constant-time comparison (hmac.compare_digest, hash_equals, timingSafeEqual).
  5. If mismatch, return 401 Unauthorized and do not process the payload.
Do not use the JSON-parsed body from your framework to compute the signature. Any whitespace or key order change will invalidate verification.

Conceptual example (Python)

See Language examples for PHP, Node.js, and Java.

Idempotency

Use X-Kairo-Delivery as a deduplication key. Kairo Shield may retry failed deliveries.