Audit Logs

Hippocortex Enterprise logs two types of events:

  1. Audit logs -- track mutations (create, update, delete) on enterprise resources
  2. Access logs -- track memory access decisions made by the policy engine

What Gets Logged

Audit Logs

Every successful mutation (POST, PUT, PATCH, DELETE) on enterprise routes is logged automatically via middleware. Each entry records:

FieldDescription
actorTypeuser or agent
actorIdWho performed the action
actionWhat was done, e.g., create.team, update.policy, delete.namespace
targetTypeResource type (team, member, agent, namespace, policy, etc.)
targetIdID of the affected resource
metadataHTTP method, path, status code
ipAddressClient IP (from X-Forwarded-For or CF-Connecting-IP)
created_atTimestamp

Failed requests (non-2xx) are not logged to keep the audit trail clean.

Access Logs

Every policy evaluation during synthesize (and any future policy-checked operation) is logged:

FieldDescription
actorTypeuser or agent
actorIdWho requested access
actionWhat was requested, e.g., synthesize.read
namespaceIdTarget namespace (if scoped)
queryTextThe retrieval query (if present)
policyDecisionallow, deny, or default_allow
policiesEvaluatedList of policy IDs that were checked
resultCountNumber of results returned
memoryIdsIDs of memories returned

Querying Audit Logs

curl "https://api.hippocortex.dev/v1/organizations/org_abc123/audit?\
actorId=user_456&\
action=create.team&\
startDate=2026-03-01T00:00:00Z&\
endDate=2026-03-15T00:00:00Z&\
limit=50" \
  -H "Authorization: Bearer <JWT_TOKEN>" \
  -H "X-Organization-ID: org_abc123"

Available Filters

ParameterTypeDescription
actorIdstringFilter by who performed the action
actorTypestringFilter by actor type (user or agent)
actionstringFilter by action (e.g., create.team)
targetTypestringFilter by target resource type
targetIdstringFilter by specific target resource
startDateISO dateOnly entries after this date
endDateISO dateOnly entries before this date
limitnumberMax results (default 50, max 200)
offsetnumberPagination offset

Querying Access Logs

curl "https://api.hippocortex.dev/v1/organizations/org_abc123/access-logs?\
policyDecision=deny&\
namespaceId=ns_456&\
limit=50" \
  -H "Authorization: Bearer <JWT_TOKEN>" \
  -H "X-Organization-ID: org_abc123"

Available Filters

ParameterTypeDescription
actorIdstringFilter by who requested access
actorTypestringFilter by actor type
actionstringFilter by action
namespaceIdstringFilter by namespace
policyDecisionstringFilter by decision (allow, deny, default_allow)
startDateISO dateOnly entries after this date
endDateISO dateOnly entries before this date

Audit Log vs Access Log

Audit LogAccess Log
WhatResource mutationsMemory access decisions
WhenOn create/update/deleteOn synthesize/retrieval
WhyCompliance, change trackingSecurity monitoring, policy debugging
WhoAdmin, operator, supportAdmin, operator, support

Implementation Details

  • Audit logging is fire-and-forget: a failed log insert does not affect the API response
  • Audit middleware only runs on enterprise routes (/v1/organizations/:orgId/*)
  • Access logs are written by the policy engine and scoped retrieval pipeline
  • Both log types are stored in PostgreSQL and queryable via the API