HMAC Generator
security.generate_hmac
Overview
You pass a message and secret key; we compute a keyed message authentication code using HMAC-SHA256 (default), HMAC-SHA384, or HMAC-SHA512. Message and key may be utf8, hex, or base64; the signature is returned as hex, base64, or base64url. The key is never echoed, logged, or referenced in any output or error. Do not use this to verify an inbound signature (use security.verify_hmac) or hash passwords (use security.password_hash).
An LLM cannot compute an HMAC. Producing one requires exact byte-level keyed hashing, and a fabricated value is indistinguishable from a wrong one until verification fails somewhere expensive.
Reliability
STRICT and fully deterministic — identical message, key, algorithm, and encodings always produce an identical signature. Verified against RFC 4231 test vectors. Your key is never echoed, logged, or referenced in any output or error. HMAC_ALGORITHM_UNSUPPORTED — trigger: you named an algorithm outside HMAC-SHA256, HMAC-SHA384 and HMAC-SHA512; retryable: no; next: pick one of those three and call again. HMAC_ENCODING_UNSUPPORTED — trigger: messageEncoding or keyEncoding was something other than utf8, hex or base64, or outputEncoding was something other than hex, base64 or base64url; retryable: no; next: correct the named field. HMAC_KEY_INVALID_ENCODING — trigger: your key string does not actually parse as the keyEncoding you declared, for example odd-length hex; retryable: no; next: fix the key text or the declared encoding. HMAC_KEY_EMPTY — trigger: the key decoded to zero bytes, which happens with an empty hex or base64 string; retryable: no; next: send a key with at least one byte. HMAC_MESSAGE_INVALID_ENCODING — trigger: the message does not parse as the messageEncoding you declared; retryable: no; next: send valid hex or base64, or switch messageEncoding to utf8. Input validation (not retryable): message or key longer than the documented maximum.
Context footprint
One call replaces a byte-exact cryptographic operation an agent cannot perform, and the response is a handful of scalar fields. A successful call costs 1 execution credit.
When to use it
When you hold a shared secret and need a message authentication code over a specific payload, in a specific encoding.
When you need to verify an existing code (use security.verify_hmac), when the secret is platform-managed (use crypto.squillify_signature), or when you need a password hash (use security.password_hash).
Scope
Non-goals
- Does not manage, derive, rotate, or store keys
- Does not encrypt — HMAC authenticates, it does not provide confidentiality
- Does not verify a signature (use security.verify_hmac)
- Does not truncate the code, and does not offer HMAC-SHA1 or HMAC-MD5
- Does not produce asymmetric signatures (RSA, ECDSA, Ed25519)
- Does not sign with a platform-managed secret (use crypto.squillify_signature)
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill is designed to detect, mask, redact, validate, or otherwise process sensitive data.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- Targets sensitive data
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | Message to authenticate. |
| key | string | Yes | Secret key; never projected. |
| algorithm | string | No | HMAC algorithm; omit it for HMAC-SHA256. |
| messageEncoding | string | No | Input byte encoding; omit it for utf8. |
| keyEncoding | string | No | Input byte encoding; omit it for utf8. |
| outputEncoding | string | No | Signature encoding; omit it for hex. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| signature | string | Yes | Encoded authentication code. |
| algorithm | string | Yes | Applied HMAC algorithm. |
| outputEncoding | string | Yes | Applied signature encoding. |
| signatureBits | integer | Yes | Raw authentication-code bits. |
| messageBytes | integer | Yes | Decoded message byte count. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"security.generate_hmac","input":{"message":"hello world","key":"secret"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("security.generate_hmac", {"message":"hello world","key":"secret"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| HMAC_ALGORITHM_UNSUPPORTED | 400 | No | The skill does not support the requested variant. |
| HMAC_KEY_INVALID_ENCODING | 400 | No | The request payload failed this skill's input validation. |
| HMAC_KEY_EMPTY | 400 | No | The request payload failed this skill's input validation. |
| HMAC_MESSAGE_INVALID_ENCODING | 400 | No | The request payload failed this skill's input validation. |
| HMAC_ENCODING_UNSUPPORTED | 400 | No | The skill does not support the requested variant. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not manage, derive, rotate, or store keys
- Does not encrypt — HMAC authenticates, it does not provide confidentiality
- Does not verify a signature (use security.verify_hmac)
- Does not truncate the code, and does not offer HMAC-SHA1 or HMAC-MD5
- Does not produce asymmetric signatures (RSA, ECDSA, Ed25519)
- Does not sign with a platform-managed secret (use crypto.squillify_signature)
- Hashing a password (use security.password_hash — HMAC is not a password hash)
- Encrypting data (HMAC is one-way authentication, not encryption)
- Verifying an inbound webhook (use network.validate_webhook_signature or security.verify_hmac)
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "security.generate_hmac",
"input": {
"message": "hello world",
"key": "secret"
}
}Examples
Sign text with a utf8 key
{
"message": "hello world",
"key": "secret"
}{
"messageBytes": 11,
"signatureBits": 256,
"algorithm": "HMAC-SHA256",
"signature": "734cc62f32841568f45715aeb9f4d7891324e6d948e4c6c60c0621cdac48623a",
"outputEncoding": "hex"
}RFC 4231 test case 2 with base64url output
{
"keyEncoding": "hex",
"key": "4a656665",
"algorithm": "HMAC-SHA256",
"message": "what do ya want for nothing?",
"outputEncoding": "base64url"
}{
"messageBytes": 28,
"signatureBits": 256,
"algorithm": "HMAC-SHA256",
"signature": "W9zBRr9gdU5qBCQmCJV1x1oAPwidJzmDnexYuWTsOEM",
"outputEncoding": "base64url"
}Recommended use cases
- Sign an outbound webhook payload before delivering it
- Produce a request signature for an API that expects HMAC authentication
- Generate an integrity tag for a message travelling over an untrusted channel
Avoid for
- Hashing a password (use security.password_hash — HMAC is not a password hash)
- Encrypting data (HMAC is one-way authentication, not encryption)
- Verifying an inbound webhook (use network.validate_webhook_signature or security.verify_hmac)
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.