Skip to main content

Immutable Audit Logs

Because autonomous agents operate without constant human supervision, post-incident forensics are critical. AgentVault maintains cryptographically chained audit trails that make log tampering mathematically detectable.

Hash Chain Design

Every audit event references the hash of the previous event, forming a per-tenant chain:

Hash Computation

Each event hash covers: previous hash, timestamp, trace context, event body, and participants. It excludes: observed_timestamp, delivery metadata, and the hash_chain block itself.

Chain Properties


Traceparent Chaining

Agent actions are linked via W3C TraceContext traceparent headers:
  • trace_id — deterministically derived from conversation/room ID
  • span_id — unique per message exchange
  • trace_flags — always 01 (sampled) for audit events
This enables full trace reconstruction: given a trace ID, you can reconstruct the entire conversation’s audit trail across all participants.

Event Types


Chain Verification

API Verification

Programmatic Verification

If verification fails, the break index identifies exactly which event was tampered with.

Querying Audit Trails

By Conversation/Room

Returns all audit events for a conversation, ordered by sequence number.

By Time Range

The severity_min=17 filter returns only ERROR and above.

By Entity

Returns the most recent audit events involving a specific agent or user.

Storage & Retention

  • Primary storage: PostgreSQL with JSONB columns for flexibility and queryability
  • Indexes: Optimized for chain traversal, trace lookup, time-range queries, and severity filtering
  • GIN indexes on body and attributes for full-text JSONB search
  • Retention: Configurable per tenant (default: 90 days, enterprise: unlimited)
  • No external stack required: The audit system runs entirely on PostgreSQL — no ClickHouse, Elasticsearch, or external observability infrastructure needed

OTel Export

Audit events are natively OTel-compatible. When OTel export is enabled, events are dual-written:
  1. PostgreSQL — primary storage with hash chain integrity
  2. OTLP endpoint — exported to any OTel-compatible backend (Splunk, Datadog, Grafana)
The OTel export requires zero schema changes because the audit event structure already conforms to the OTel LogRecord data model. See the OTel Data Model for details.