đźš§ SanctumAI is in beta. APIs may change before v1.0.
ConceptsAudit Events

Audit Events

Every operation in SanctumAI is recorded in a tamper-evident audit log. The log uses HMAC chaining — each entry’s hash includes the previous entry’s hash, making it impossible to alter or delete records without detection.

What Gets Logged

EventDescription
credential.storeA credential was created or updated
credential.retrieveA credential was accessed
credential.deleteA credential was removed
credential.listCredential listing was requested
agent.registerA new agent identity was created
agent.removeAn agent was deregistered
policy.createA new policy was added
policy.deleteA policy was removed
policy.denyAn access request was denied by policy
vault.initVault was initialized
vault.unlockVault was unlocked
vault.lockVault was locked

Audit Entry Structure

Each entry contains:

FieldDescription
timestampMicrosecond-precision UTC timestamp
event_typeEvent classification (see above)
agent_nameThe agent or user that triggered the event
resourceThe credential path affected
actionThe operation performed
resultallowed or denied
hmacHMAC-SHA256 of this entry + previous entry’s HMAC

HMAC Chain

The chain provides tamper evidence. If any entry is modified or deleted, the chain breaks:

Entry 1: HMAC(key, data_1 || "")           → H1
Entry 2: HMAC(key, data_2 || H1)           → H2
Entry 3: HMAC(key, data_3 || H2)           → H3
...

Verify the chain integrity:

sanctum audit verify
âś… Audit log integrity verified
   Entries: 1,247
   Chain: valid (no gaps or modifications detected)
   First entry: 2026-02-01 10:00:00 UTC
   Last entry: 2026-02-14 22:30:00 UTC

Querying the Log

# Last N entries
sanctum audit log --last 20
 
# Filter by agent
sanctum audit log --agent cursor-agent
 
# Filter by resource
sanctum audit log --resource "openai/*"
 
# Filter by action
sanctum audit log --action retrieve
 
# Denied requests only
sanctum audit log --denied

Export

Audit events can be exported to external SIEM systems via the Export Layer. Supported formats include OCSF 1.3, CEF, and flat JSON. See the Export to SIEM guide for setup.