Audit API

Query the audit log for compliance and provenance.

List Audit Entries

GET /api/audit?limit=100&action=recall

Query Parameters

ParameterTypeDefaultDescription
limitnumber100Number of entries (max 500)
actionstring-Filter by action type
actor_typestring-Filter by user or agent
resultstring-Filter by allowed or denied

Response

{
  "entries": [
    {
      "id": "uuid",
      "actor_type": "agent",
      "actor_id": "uuid",
      "on_behalf_of": "uuid",
      "action": "recall",
      "target_id": "uuid",
      "scope_key": "engineering",
      "result": "allowed",
      "tokens_in": 45,
      "tokens_out": 320,
      "created_at": "2025-01-15T10:30:00Z"
    }
  ]
}

Action Types

ActionDescription
recallMemory search query
rememberMemory write
denyAccess denied (policy violation)
redactMemory redaction
policy_changePolicy matrix update

Audit Properties

PropertyDescription
actor_typeuser or agent
actor_idID of the acting user or agent
on_behalf_ofUser the agent is acting for
actionWhat was attempted
target_idMemory ID involved
scope_keyScope accessed
resultallowed or denied
tokens_inInput tokens (for AI queries)
tokens_outOutput tokens (for AI queries)

Audit entries are append-only and cannot be modified or deleted. This ensures compliance and provenance tracking.