Skip to main content

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

MicroSkills Reference

Audit Event Builder

governance.audit_event_build

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

Overview

You send the parts of an audit record — what happened, who did it, to what, with what outcome, and when — and we return one normalised envelope plus a SHA-256 digest over its canonical form. Event types, sources, actions and attribute keys are lowercased to a strict vocabulary; actor, resource and correlation identifiers keep their case exactly, because lowercasing an id would break the join to the system that issued it. Two callers who send the same facts in a different attribute order get the same bytes and the same digest. We build the record and hand it back: nothing is stored, forwarded, queued or published, and the digest is an integrity checksum rather than a signature.

Audit records only earn their keep when they compare: one service writes Update, another update, a third sends attributes in a different order, and suddenly two records of the same event look like two events. You get one shape, one field order, and a digest you can re-derive to show the record has not changed since you stored it.

Reliability

Fully deterministic and independent of the machine: the same facts give byte-identical envelopes and one identical digest, whatever the default locale, zone or charset, and whatever order your attributes arrived in. Normalisation is fixed rather than configurable, because a normalisation you could change would produce envelopes that no longer compare equal. One residual gap is worth stating plainly: refusing credential-shaped key names and values over 512 characters is not secret detection, so a token hidden under an innocuous key such as note will pass — run security.detect_secrets over your attribute values first if that matters. Refusals, and what to do about each. GOV_AUDIT_INPUT_TOO_LARGE means the declared request is past the 65,536-byte inline limit, so trim the attributes. GOV_AUDIT_EVENT_INVALID means the event block is the wrong shape or an attribute value is not a string, integer or boolean, and the message names the path to correct. GOV_AUDIT_ACTOR_INVALID means the actor id is missing for a named actor type, present for ANONYMOUS, or outside [A-Za-z0-9._:@-], so fix the pair together. GOV_AUDIT_RESOURCE_INVALID means the resource type or id is empty or outside the identifier charset, so correct it. GOV_AUDIT_ACTION_INVALID means the action was empty once trimmed, so send what was actually done. GOV_AUDIT_OCCURRED_AT_MISSING means the field arrived empty or whitespace-only, and we invent no timestamp, so supply the instant. GOV_AUDIT_OCCURRED_AT_INVALID means it carries no explicit offset or is not parseable, and a local time is never assumed to be UTC, so add the offset. GOV_AUDIT_OUTCOME_UNSUPPORTED means the outcome is not one of the five, so map yours onto one of them. GOV_AUDIT_SEVERITY_UNSUPPORTED means the severity is not one of the five syslog names, so pick the closest. GOV_AUDIT_ACTOR_TYPE_UNSUPPORTED means the actor type is not one of the five, so choose one rather than inventing a label. GOV_AUDIT_FIELD_UNKNOWN means a property we do not declare turned up, which is exactly how an authorization header would try to get in, so delete it. GOV_AUDIT_FIELD_TOO_LONG means a vocabulary field went past 128 characters, an identifier past 256, or the correlation id past 128, so shorten it. GOV_AUDIT_VOCABULARY_INVALID means a vocabulary field or attribute key holds a character outside [a-z0-9_.] once lowercased, so use dots and underscores rather than spaces or slashes. GOV_AUDIT_CONTROL_CHARACTER means a control character or unpaired surrogate arrived, and we refuse rather than strip it, because a silently altered actor id is worse than a rejected request. GOV_AUDIT_FORBIDDEN_FIELD means an attribute key is one of the twenty naming a credential, cookie, token, session or raw body, so leave that value out of the audit record entirely. GOV_AUDIT_ATTRIBUTE_LIMIT_EXCEEDED means more than 32 attributes arrived, so keep the ones an auditor will actually read. GOV_AUDIT_ATTRIBUTE_TOO_LARGE means an attribute value went past 512 characters, which is also the check that catches a request body arriving as a long string, so summarise it or drop it. GOV_AUDIT_CORRELATION_ID_INVALID means the value carries whitespace or fits none of the three accepted shapes, and we refuse rather than drop it — call security.generate_uuid if you need one made. GOV_AUDIT_WORK_REFUSED means the projected normalisation operations went past 128, and the refusal reports both the projection and the budget, so send fewer attributes.

Context footprint

One envelope roughly the size of what you sent, plus a digest and small counters. The envelope is the output, so identifiers do come back. A successful call costs 1 execution credit.

When to use it

When you are about to store or ship an audit record and want it in a shape that is stable across services, plus a checksum over exactly those bytes.

When you need the event delivered somewhere, when you need proof of origin rather than integrity, or when the values still need screening for secrets.

Scope

Note
One caller-supplied audit envelope normalised to a fixed shape and field order, with a digest over the canonical bytes.

Non-goals

  • Does not persist, forward, queue, publish or emit the event — nothing here is a log sink, and no writer or outbound client exists in this pack
  • Does not generate a timestamp, an identifier or a nonce
  • Does not sign anything — the digest proves integrity, never origin
  • Does not screen values for secrets; it refuses credential-shaped key names and over-long values, which is a narrower promise
  • Does not decide whether the action described was permitted

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

hashingnormalization

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 output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

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.
  • This skill does not target sensitive data.
  • The response may contain submitted or transformed 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
eventobjectYesClosed audit event with type, source, outcome, and optional syslog severity defaulting to INFO.
actorobjectYesClosed actor with a supported type and an id that is required unless the type is ANONYMOUS.
resourceobjectYesClosed resource with a vocabulary type and a case-preserved identifier that still points at the object your system knows.
actionstringYesWhat was done, 1 through 128 characters, lowercased to [a-z0-9_.].
occurredAtstringYesWhen it happened as an ISO-8601 instant with an explicit offset; stored in UTC.
correlationIdstringNoOptional UUID, 32-character hex trace id, or opaque token in [A-Za-z0-9._:-], up to 128 characters; omit it and the field is absent.
attributesobjectNoPurpose-bound map of up to 32 scalar attributes whose string values stay within 512 characters; omit the whole object when there are no extra attributes.

Output schema

FieldTypeRequiredDescription
auditEventobjectYesCanonical audit envelope in digest order: schemaVersion, eventType, severity, occurredAt, actor, action, resource, outcome, source, optional correlationId, and sorted attributes.
summaryobjectYesIntegrity receipt with SHA-256 envelope hash, canonical byte count, which fields were normalised, attribute count, and schema version.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"governance.audit_event_build","input":{"event":{"type":"policy.updated","source":"admin_api","outcome":"SUCCESS"},"actor":{"type":"USER","id":"u_7F3A"},"resource":{"type":"retention_policy","id":"rp-2026-eu"},"action":"update","occurredAt":"2026-07-29T14:03:00Z"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("governance.audit_event_build", {"actor":{"type":"USER","id":"u_7F3A"},"event":{"outcome":"SUCCESS","severity":"NOTICE","type":"Policy.Updated","source":"admin_api"},"correlationId":"4f1c9e0a2b7d4c8fa1e5d3b60c9f2a71","attributes":{"clause_count":12,"profile":"eu_general"},"action":"Update","occurredAt":"2026-07-29T14:03:00Z","resource":{"type":"retention_policy","id":"rp-2026-eu"}});

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.
GOV_AUDIT_INPUT_TOO_LARGE429NoA size, quota, rate, or time limit was exceeded.
GOV_AUDIT_EVENT_INVALID400NoThe request payload failed this skill's input validation.
GOV_AUDIT_ACTOR_INVALID400NoThe request payload failed this skill's input validation.
GOV_AUDIT_RESOURCE_INVALID400NoThe request payload failed this skill's input validation.
GOV_AUDIT_ACTION_INVALID400NoThe request payload failed this skill's input validation.
GOV_AUDIT_OCCURRED_AT_MISSING400NoThe request payload failed this skill's input validation.
GOV_AUDIT_OCCURRED_AT_INVALID400NoThe request payload failed this skill's input validation.
GOV_AUDIT_OUTCOME_UNSUPPORTED400NoThe skill does not support the requested variant.
GOV_AUDIT_SEVERITY_UNSUPPORTED400NoThe skill does not support the requested variant.
GOV_AUDIT_ACTOR_TYPE_UNSUPPORTED400NoThe skill does not support the requested variant.
GOV_AUDIT_FIELD_UNKNOWN400NoThe request payload failed this skill's input validation.
GOV_AUDIT_FIELD_TOO_LONG429NoA size, quota, rate, or time limit was exceeded.
GOV_AUDIT_VOCABULARY_INVALID400NoThe request payload failed this skill's input validation.
GOV_AUDIT_CONTROL_CHARACTER400NoThe request payload failed this skill's input validation.
GOV_AUDIT_FORBIDDEN_FIELD422NoThe input was rejected as unsafe.
GOV_AUDIT_ATTRIBUTE_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
GOV_AUDIT_ATTRIBUTE_TOO_LARGE429NoA size, quota, rate, or time limit was exceeded.
GOV_AUDIT_CORRELATION_ID_INVALID400NoThe request payload failed this skill's input validation.
GOV_AUDIT_WORK_REFUSED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not persist, forward, queue, publish or emit the event — nothing here is a log sink, and no writer or outbound client exists in this pack
  • Does not generate a timestamp, an identifier or a nonce
  • Does not sign anything — the digest proves integrity, never origin
  • Does not screen values for secrets; it refuses credential-shaped key names and over-long values, which is a narrower promise
  • Does not decide whether the action described was permitted
  • Shipping the event anywhere — that is your pipeline's job, not ours
  • Proving who produced a record, which needs a signature rather than a checksum
  • Carrying a request body or token through an attribute

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "governance.audit_event_build",
  "input": {
    "actor": {
      "type": "USER",
      "id": "u_7F3A"
    },
    "event": {
      "outcome": "SUCCESS",
      "severity": "NOTICE",
      "type": "Policy.Updated",
      "source": "admin_api"
    },
    "correlationId": "4f1c9e0a2b7d4c8fa1e5d3b60c9f2a71",
    "attributes": {
      "clause_count": 12,
      "profile": "eu_general"
    },
    "action": "Update",
    "occurredAt": "2026-07-29T14:03:00Z",
    "resource": {
      "type": "retention_policy",
      "id": "rp-2026-eu"
    }
  }
}

Examples

Retention policy update by a named administrator

Inputjson
{
  "actor": {
    "type": "USER",
    "id": "u_7F3A"
  },
  "event": {
    "outcome": "SUCCESS",
    "severity": "NOTICE",
    "type": "Policy.Updated",
    "source": "admin_api"
  },
  "correlationId": "4f1c9e0a2b7d4c8fa1e5d3b60c9f2a71",
  "attributes": {
    "clause_count": 12,
    "profile": "eu_general"
  },
  "action": "Update",
  "occurredAt": "2026-07-29T14:03:00Z",
  "resource": {
    "type": "retention_policy",
    "id": "rp-2026-eu"
  }
}
Expected outputjson
{
  "summary": {
    "envelopeHash": "3dc17a74c8a566bd54a9be9a622fda060b49a02804a688bb6feec703565b8255",
    "canonicalBytes": 384,
    "normalizedFields": [
      "eventType",
      "action"
    ],
    "attributeCount": 2,
    "schemaVersion": "squillify.audit.v1"
  },
  "auditEvent": {
    "schemaVersion": "squillify.audit.v1",
    "eventType": "policy.updated",
    "severity": "NOTICE",
    "occurredAt": "2026-07-29T14:03:00Z",
    "actor": {
      "type": "USER",
      "id": "u_7F3A"
    },
    "action": "update",
    "resource": {
      "type": "retention_policy",
      "id": "rp-2026-eu"
    },
    "outcome": "SUCCESS",
    "source": "admin_api",
    "correlationId": "4f1c9e0a2b7d4c8fa1e5d3b60c9f2a71",
    "attributes": {
      "clause_count": 12,
      "profile": "eu_general"
    }
  }
}

Anonymous read denied, with no correlation id supplied

Inputjson
{
  "event": {
    "source": "public_api",
    "type": "document.read",
    "outcome": "DENIED"
  },
  "actor": {
    "type": "ANONYMOUS"
  },
  "resource": {
    "type": "document",
    "id": "doc-4471"
  },
  "action": "read",
  "occurredAt": "2026-07-29T14:05:12+02:00"
}
Expected outputjson
{
  "summary": {
    "envelopeHash": "7f60fa138ef5e47c06eabd210c12fc981b02e669cf45943ec492c93a27db3cbc",
    "canonicalBytes": 269,
    "normalizedFields": [],
    "attributeCount": 0,
    "schemaVersion": "squillify.audit.v1"
  },
  "auditEvent": {
    "schemaVersion": "squillify.audit.v1",
    "eventType": "document.read",
    "severity": "INFO",
    "occurredAt": "2026-07-29T12:05:12Z",
    "actor": {
      "type": "ANONYMOUS"
    },
    "action": "read",
    "resource": {
      "type": "document",
      "id": "doc-4471"
    },
    "outcome": "DENIED",
    "source": "public_api",
    "attributes": {}
  }
}
  • Give every service in a fleet one audit shape, so records compare and join
  • Take a digest over an audit record before you store it, and re-derive it later to prove the record has not drifted

Avoid for

  • Shipping the event anywhere — that is your pipeline's job, not ours
  • Proving who produced a record, which needs a signature rather than a checksum
  • Carrying a request body or token through an attribute

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

hashingnormalizationgovernanceaudit