Skip to main content

compliance · 6 min read

Append-Only Audit Logs for AI Compliance: Design and Implementation

Append-only audit log architecture for AI enforcement evidence: tamper-resistant design, actor attribution, hash-chained continuity, and capital markets regulatory context for OSFI and FINTRAC obliga…

Published 2026-03-23 · AI Syndicate

  • Primary topic: AI audit log compliance
  • Category: compliance
  • Reading time: 6 min read

For capital markets firms where AI agents touch client records, trade workflows, KYC fields, or AML dispositions, the audit log question is not whether records exist. It is whether the records prove policy was evaluated before the agent acted — and whether those records can be produced to OSFI, FINTRAC, or an internal reviewer without depending on the operator's interpretation of internal state.

The design of an audit log determines its reliability as enforcement evidence. Logs that can be modified after the fact prove nothing. Logs without attribution cannot answer the accountability question. Logs that capture events but not policy decisions cannot close the pre-execution evidence gap.

Syndicate Claw's append-only audit log is designed to address these failure modes by architectural constraint, not policy promise.

Why Append-Only Matters

An append-only log accepts new records but does not permit modification or deletion of existing records. This constraint is the foundation of audit reliability. If records can be modified, they are not reliable evidence. If records can be deleted, gaps can be created in the enforcement evidence chain.

The append-only constraint is implemented at the repository level. The AuditEventRepository has no update method and no delete method. Audit events are created once and retained indefinitely. This is not a convention — it is an architectural constraint that blocks modification through normal application paths; bypass attempts would require out-of-band database access.

Even with database-level access, compensating controls exist. Checkpoint HMAC signing provides integrity verification for workflow state. The combination of signed checkpoints and append-only audit records means that workflow history is both verifiable and immutable.

The AuditEvent Model

Audit events capture significant occurrences in the system. The event model includes:

Event type: classifies the event (WORKFLOW_STARTED, TOOL_INVOKED, POLICY_EVALUATED, APPROVAL_REQUESTED, APPROVAL_RESOLVED, etc.)

Actor: the principal who initiated the action (required, no anonymous fallback)

Timestamp: when the event occurred (UTC, with timezone metadata)

Context: event-specific data (workflow run ID, tool name, policy rule ID, etc.)

Correlation ID: the request ULID enabling cross-cutting analysis

The event type taxonomy is exhaustive — every significant occurrence has a defined event type. This enables filtering, aggregation, and analysis across the audit log.

Actor Attribution

Every audit event requires actor attribution. The actor is the principal — user or service account — whose credentials authenticated the request. Actor identification is mandatory at the authentication layer; fail-closed production configuration rejects unauthenticated requests.

Actor attribution supports accountability obligations. When an audit event is examined, the identity of the responsible party is immediately available. This supports internal investigations, external audits, and regulatory inquiries.

For service-to-service calls, actor attribution follows the authenticated principal. If Service A calls Service B on behalf of User X, the audit event in Service B captures User X as the actor, not Service A. This end-to-end attribution ensures that the responsible principal is always identifiable.

AuditMiddleware HTTP Capture

AuditMiddleware intercepts HTTP requests at the API boundary, capturing audit-relevant information for every API call. The middleware runs after authentication and before the request handler, ensuring that the authenticated actor is captured for all requests.

Captured information includes: HTTP method and path, actor identification, workflow run context (if present in request), request timestamp, and response status code. For mutations, the request body is captured subject to redaction rules.

The middleware does not capture streaming request bodies, file uploads, or other bulk data. These are excluded to prevent storage bloat and to avoid capturing sensitive payload content that would require additional protection.

ULID Timestamps and Range Queries

ULID primary keys encode timestamp information, enabling efficient range queries on audit records. Queries like "all events in the last 24 hours" or "all events for workflow run X" are efficient because the primary key sort order corresponds to time order.

Efficient range queries are essential for compliance operations. Auditors frequently need to retrieve records within specific time windows. Response time for these queries determines how quickly investigations can proceed.

ULID also provides the uniqueness properties required for distributed systems. Multiple nodes generating audit records simultaneously will not produce duplicate IDs, and IDs remain sortable across nodes.

Query Patterns and Retention

Audit logs support several query patterns:

Point queries: retrieve a specific audit event by ID (for investigation of specific events).

Range queries: retrieve events within a time window (for compliance reporting, incident investigation).

Context queries: retrieve events related to a specific workflow run, actor, or resource (for focused investigation).

Aggregation queries: count events by type, actor, or time period (for operations review and anomaly detection).

Retention policies govern how long audit records are kept. Syndicate Claw supports configurable retention windows at the namespace level, enabling different retention requirements for different tenants or data classifications. Retention is implemented through namespace-scoped soft delete, where records transition to DELETED status rather than being physically removed.

Capital Markets Regulatory Context

OSFI's Technology and Cyber Risk Management guideline (B-13) expects security logging to support investigation and that access control decisions be attributable and verifiable. For AI agents, this means the audit log must capture more than operational events — it must preserve the policy version, actor identity, decision outcome, and denial records that prove governance ran before execution.

FINTRAC's PCMLTFA record-keeping requirements for securities dealers require that records including STR copies be retained for at least five years and be producible within the required request window. For AI agent workflows, the enforcement evidence chain sits beside the required business record — the agent's contribution to a KYC update, AML disposition, or STR workflow action must be independently verifiable in the retained record.

For both frameworks, the audit log is evidence of control, not merely a record of operation. An append-only log that captures policy decision, actor identity, approval binding, and denial behavior produces the evidence standard both frameworks assume.

Evidence Quality

Not all audit logs constitute reliable evidence. For audit records to serve compliance and investigation purposes, they must be:

Complete: all significant events are captured, with no gaps in coverage.

Accurate: records reflect what actually happened, not a sanitized version.

Attributable: the responsible party is identifiable for every event.

Tamper-evident: records cannot be modified without detection.

Syndicate Claw's append-only architecture addresses completeness through exhaustive event type taxonomy, accuracy through real-time capture without buffering, attributability through mandatory authentication, and tamper-evidence through architectural constraints that prevent modification.

Organizations can rely on these audit logs as enforcement evidence because the evidence quality is built into the design, not retrofitted as an afterthought.

Frequently asked questions

What is an append-only audit log for AI systems?

An append-only audit log captures every system event without allowing modification or deletion. This constraint ensures audit records are tamper-evident and provide reliable compliance evidence.

Why do audit logs need to be append-only?

Append-only logs cannot be modified after creation, making them reliable evidence. Logs that allow modification or deletion could be altered to hide unauthorized actions or create false narratives.

How does actor attribution work in audit logs?

Actor attribution requires mandatory authentication for every request. The authenticated principal is captured in every audit event, ensuring the responsible party is identifiable for all actions.

How do ULID timestamps enable efficient audit queries?

ULIDs encode timestamps in the identifier, making primary key sort order correspond to time order. This enables efficient range queries without separate timestamp indexes.

How do append-only audit logs support OSFI and FINTRAC evidence requirements?

OSFI B-13 expects security logging to support investigation and attribute access control decisions. FINTRAC requires records to be retainable and producible. An append-only log that captures policy version, actor identity, approval binding, and denial records produces evidence that satisfies both frameworks without depending on post-hoc reconstruction.

Key takeaway: Syndicate Claw implements an append-only audit log where the AuditEventRepository has no update or delete methods, ensuring that audit records cannot be modified after creation and providing tamper-evident compliance evidence.

Share

Continue reading