Skip to main content
Anima maintains an immutable, append-only audit log of every action performed by or on behalf of your agents. Use it for compliance reviews, incident investigation, and ongoing operational visibility.

What gets logged

CategoryEvents
AgentCreate, update, delete, suspend
EmailSend, receive, forward, delete
CardsCreate, authorize, decline, close
VaultStore, retrieve, rotate, delete secrets
WalletPayment, budget change, approval request
IdentityDID creation, key rotation, credential issuance/revocation
A2ATask sent, received, completed, failed
AuthAPI key created, rotated, revoked; login attempts
PodCreated, updated, deleted, bridge created

Event schema

Each audit event has the following structure:
{
  "id": "evt_9x2m4k7p1n",
  "timestamp": "2026-03-15T14:32:01.234Z",
  "category": "cards",
  "action": "authorize",
  "actorId": "ag_8f3k2m9x1n4p7q6r",
  "actorType": "agent",
  "resourceType": "card",
  "resourceId": "card_abc123",
  "podId": "pod_prod",
  "metadata": {
    "amountCents": 4999,
    "merchantName": "AWS",
    "merchantMcc": "5734",
    "decision": "approved",
    "ruleEvaluations": [
      { "rule": "per_transaction_limit", "result": "pass" },
      { "rule": "daily_limit", "result": "pass" },
      { "rule": "mcc_allowlist", "result": "pass" }
    ]
  },
  "ipAddress": "10.0.1.42",
  "userAgent": "anima-sdk-node/1.5.0",
  "immutableHash": "sha256:a1b2c3d4..."
}
FieldTypeDescription
idstringUnique event identifier
timestampISO 8601When the event occurred
categorystringEvent category (e.g., cards, email, auth)
actionstringSpecific action taken
actorIdstringID of the agent or user that performed the action
actorTypestringagent or user
resourceTypestringType of resource affected
resourceIdstringID of the specific resource
podIdstringPod the event occurred in
metadataobjectAction-specific details (amounts, decisions, rule evaluations)
immutableHashstringSHA-256 hash for tamper detection

Query the audit log

Filter events by agent, category, action, or date range.
import { Anima } from "@anima-labs/sdk";

const anima = new Anima({ apiKey: "ak_..." });

const events = await anima.auditLog.query({
  agentId: "ag_8f3k2m9x1n4p7q6r",
  category: "cards",
  action: "authorize",
  startTime: "2026-03-01T00:00:00Z",
  endTime: "2026-03-28T23:59:59Z",
  limit: 50,
});

for (const event of events.data) {
  console.log(`[${event.timestamp}] ${event.action}`);
  console.log(`  Actor: ${event.actorId} (${event.actorType})`);
  console.log(`  Resource: ${event.resourceType}/${event.resourceId}`);
  console.log(`  Details: ${JSON.stringify(event.metadata)}`);
}

Query parameters

ParameterTypeDescription
agentIdstringFilter by agent
podIdstringFilter by pod
categorystringFilter by category (e.g., cards, email, auth)
actionstringFilter by specific action
startTimestringISO 8601 start time
endTimestringISO 8601 end time
limitnumberMax results (default 50, max 1,000)
cursorstringPagination cursor for the next page

Export audit logs

Export logs to a file or stream them to a SIEM for compliance review and alerting.
// Export to JSON, CSV, or Parquet
const exportJob = await anima.auditLog.export({
  format: "json",           // "json" | "csv" | "parquet"
  startTime: "2026-01-01T00:00:00Z",
  endTime: "2026-03-31T23:59:59Z",
  destination: "s3://my-bucket/audit-logs/q1-2026.json",
});

console.log(`Export job: ${exportJob.id}, Status: ${exportJob.status}`);

// Stream to a SIEM (Splunk, Datadog, etc.)
await anima.auditLog.configureSiemStream({
  provider: "datadog",
  apiKey: "dd_...",
  site: "datadoghq.com",
  tags: ["env:production", "service:anima"],
});

API reference

EndpointMethodDescription
/api/audit-log/eventsGETQuery audit events
/api/audit-log/events/:idGETGet a single audit event
/api/audit-log/exportPOSTStart an export job
/api/audit-log/export/:idGETCheck export job status
/api/audit-log/siemPOSTConfigure SIEM streaming
/api/audit-log/siemGETGet SIEM configuration
Audit events are retained for 365 days by default. Contact support to configure a longer retention period for compliance requirements.