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

Audit API

Query Audit Log

GET /api/v1/audit

Query Parameters:

ParamDescriptionDefault
agentFilter by agent nameall
resourceFilter by resource path (glob)all
actionFilter by action typeall
sinceISO 8601 timestampnone
untilISO 8601 timestampnone
limitMax entries to return100
offsetPagination offset0

Response:

{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2026-02-14T22:30:01Z",
      "event_type": "credential.retrieve",
      "agent_name": "cursor-agent",
      "resource": "openai/api_key",
      "action": "retrieve",
      "result": "allowed",
      "hmac": "base64..."
    }
  ],
  "meta": {
    "total": 1247,
    "limit": 100,
    "offset": 0
  }
}

Verify Chain Integrity

GET /api/v1/audit/verify

Verifies the HMAC chain integrity of the entire audit log.

Response:

{
  "data": {
    "valid": true,
    "entries": 1247,
    "first_entry": "2026-02-01T10:00:00Z",
    "last_entry": "2026-02-14T22:30:01Z"
  }
}

If tampering is detected:

{
  "data": {
    "valid": false,
    "break_at_entry": 843,
    "break_at_timestamp": "2026-02-09T15:22:00Z",
    "message": "HMAC chain broken at entry 843"
  }
}