Skip to main content
Every HTTP Tool invocation in the default envelope mode carries an X-SmartAlex-Signature header. Verifying it lets you reject forged requests, including replay attacks and any third party that gets hold of your endpoint URL.
Signatures apply to envelope-mode tools only. If you switch a tool to passthrough mode (a flat body template for third-party APIs), we send no X-SmartAlex-Signature and no X-SmartAlex-* headers, the request authenticates with the credential you embed in the template instead. Everything on this page is about envelope mode.

The algorithm

  1. Take the raw request body bytes exactly as received (do not re-serialize).
  2. Take the millisecond timestamp from the t= part of X-SmartAlex-Signature.
  3. Compute HMAC-SHA256(secret, timestamp + "." + rawBody) and compare it, in constant time, against the v1= part of the same header.
  4. Reject signatures older than 5 minutes (defense against replay).
The signing secret was shown to you once on first tool save (or after rotation). It has the prefix shs_ and is 64 hex characters.

The header shape

The v1= prefix is reserved for the version of the signing scheme. If we ever need to change it, future requests will carry v2=... and existing verifiers will reject them, prompting a doc-driven upgrade, never a silent break.

Constant-time comparison

Always use a constant-time string comparison (crypto.timingSafeEqual in Node, hmac.compare_digest in Python, etc.). A naive == comparison can leak the secret one byte at a time via timing.

Code samples

Rotating the signing secret

Hit Rotate in the Custom HTTP Tools manager.
Rotation invalidates the old secret immediately. There’s no grace period. Update your endpoint(s) with the new secret in the same change window. Until you do, every request from us will fail your verifySignature check.
The dashboard shows the new secret once. Save it the same way you saved the first one.

Common pitfalls

Next: Error codes

Every failure mode the runtime can surface, with error_message and llm_message.