Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

HMAC Generator

security.generate_hmac

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

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

Note
Computes an HMAC-SHA256, HMAC-SHA384, or HMAC-SHA512 code over the supplied message using the supplied key, and returns it in the requested encoding.

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

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

hashingsigning

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input64 KB

How we handle your data

Sensitive processing
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
messagestringYesMessage to authenticate.
keystringYesSecret key; never projected.
algorithmstringNoHMAC algorithm; omit it for HMAC-SHA256.
messageEncodingstringNoInput byte encoding; omit it for utf8.
keyEncodingstringNoInput byte encoding; omit it for utf8.
outputEncodingstringNoSignature encoding; omit it for hex.

Output schema

FieldTypeRequiredDescription
signaturestringYesEncoded authentication code.
algorithmstringYesApplied HMAC algorithm.
outputEncodingstringYesApplied signature encoding.
signatureBitsintegerYesRaw authentication-code bits.
messageBytesintegerYesDecoded message byte count.

API contract

POST /v1/execute
curl
curl -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"}}'
Integrations
TypeScript SDK
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

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
HMAC_ALGORITHM_UNSUPPORTED400NoThe skill does not support the requested variant.
HMAC_KEY_INVALID_ENCODING400NoThe request payload failed this skill's input validation.
HMAC_KEY_EMPTY400NoThe request payload failed this skill's input validation.
HMAC_MESSAGE_INVALID_ENCODING400NoThe request payload failed this skill's input validation.
HMAC_ENCODING_UNSUPPORTED400NoThe skill does not support the requested variant.

Other limits

LimitValue
Recommended inline bytes32 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)

Request bodyjson
{
  "skillKey": "security.generate_hmac",
  "input": {
    "message": "hello world",
    "key": "secret"
  }
}

Examples

Sign text with a utf8 key

Inputjson
{
  "message": "hello world",
  "key": "secret"
}
Expected outputjson
{
  "messageBytes": 11,
  "signatureBits": 256,
  "algorithm": "HMAC-SHA256",
  "signature": "734cc62f32841568f45715aeb9f4d7891324e6d948e4c6c60c0621cdac48623a",
  "outputEncoding": "hex"
}
Tip
Defaults are HMAC-SHA256 with utf8 inputs and hex output

RFC 4231 test case 2 with base64url output

Inputjson
{
  "keyEncoding": "hex",
  "key": "4a656665",
  "algorithm": "HMAC-SHA256",
  "message": "what do ya want for nothing?",
  "outputEncoding": "base64url"
}
Expected outputjson
{
  "messageBytes": 28,
  "signatureBits": 256,
  "algorithm": "HMAC-SHA256",
  "signature": "W9zBRr9gdU5qBCQmCJV1x1oAPwidJzmDnexYuWTsOEM",
  "outputEncoding": "base64url"
}
Tip
A hex key expresses the binary keys used by the RFC 4231 vectors
  • 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)

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.

Tags

cryptographyhashingsecuritysignature