Audit Logs

Comprehensive logging of all AI requests and responses for compliance, debugging, and analytics.

What are Audit Logs?

Audit logs are immutable records of every AI request processed through Cencori. They provide complete traceability for compliance, security investigations, and performance optimization.

What Gets Logged

Request Information:

  • Complete prompt text
  • Model and parameters (temperature, max_tokens)
  • API key used
  • User/session identifier
  • Timestamp (millisecond precision)
  • IP address

Response Information:

  • AI-generated content
  • Token usage (input/output/total)
  • Cost calculation
  • Latency metrics
  • Provider used
  • Status code (success/error)

Security Metadata:

  • PII detection results
  • Content filter flags
  • Prompt injection score
  • Security incidents linked

Log Retention

PlanRetention PeriodExport Available
Free7 daysNo
Pro30 daysCSV
Enterprise1 year+CSV, JSON, API

After the retention period, logs are permanently deleted. Export important logs before they expire.

Viewing Logs in Dashboard

  1. Navigate to your project
  2. Click "Logs" in the sidebar
  3. Use filters to narrow results:
    • Date range
    • Model
    • Status (success/error)
    • API key
    • Cost range
  4. Click any log entry to view full details

Searching Logs

Search through logs using full-text search:

  • Search prompts for specific keywords
  • Find all requests from a specific user
  • Identify expensive queries (high token usage)
  • Debug failed requests by error message

Accessing Logs Programmatically

fetch-logs.ts

Exporting Logs

Export logs for archival or external analysis:

CSV Export (Pro+)

Download as CSV for Excel/Google Sheets analysis. Includes all fields except full prompt text (for PII protection).

JSON Export (Enterprise)

Complete log data including prompts and responses. Useful for data warehouses or custom analysis.

Scheduled Exports (Enterprise)

Automatically export logs to S3, BigQuery, or Snowflake daily/weekly.

Compliance and Audit Use Cases

SOC 2 Compliance

Demonstrate access controls and monitoring. Auditors can review who accessed what AI models and when.

GDPR Right of Access

When users request their data, search logs by user ID to find all their AI interactions.

HIPAA Audit Trails

Track all access to protected health information (PHI) for compliance reporting.

Forensic Investigation

If a security incident occurs, trace the exact sequence of events using timestamps and request IDs.

Best Practices

  • Export logs monthly for long-term archival
  • Use search to identify expensive or slow queries
  • Review error logs weekly to catch issues early
  • Set up alerts for unusual patterns (cost spikes, error rate increases)
  • Document your log retention policy for compliance
  • Redact sensitive data before sharing logs with third parties