Skip to content

Audit & Compliance

Candela produces a complete, immutable audit trail of every LLM interaction and every administrative action. This trail is the foundation for compliance reporting, incident investigation, and governance visibility.

Every request proxied through Candela generates a trace span with:

FieldDescription
trace_idUnique trace identifier (W3C Trace Context)
span_idIndividual span within the trace
timestampRequest timestamp (UTC)
providerLLM provider (openai, google, anthropic)
modelRequested model name
user_idAuthenticated user or API key identifier
tenant_idTenant attribution (from X-Candela-Tenant-Id or W3C Baggage)
job_idJob or pipeline identifier (from X-Candela-Job-Id)
input_tokensPrompt token count
output_tokensCompletion token count
cache_read_tokensTokens served from prompt cache
cache_creation_tokensTokens written to prompt cache
cost_usdCalculated cost in USD
latency_msEnd-to-end request latency
ttfb_msTime to first byte (streaming)
status_codeUpstream HTTP status
budget_remaining_usdUser’s remaining budget after deduction

Every admin operation is logged to an immutable audit collection that survives user deletion:

ActionWhat’s Recorded
create_userNew user provisioned with role and budget
set_budgetBudget limit changed (old → new)
reset_spendUser’s daily spend reset to $0
create_grantOne-time budget grant created
revoke_grantGrant revoked before expiration
deactivate_userUser access suspended
reactivate_userUser access restored
delete_userUser removed (audit entries preserved)

Governance enforcement actions are also logged:

EventWhen
budget_exceededRequest blocked — user budget exhausted
rate_limitedRequest throttled — rate limit reached
budget_alertThreshold crossed (80%, 90%, 100%)

Audit data is written to your configured storage backend. Candela supports three backends with identical audit semantics:

Serverless, petabyte-scale storage for production deployments.

storage:
type: bigquery
bigquery:
project_id: my-project
dataset: candela
  • Immutable by default (no UPDATE/DELETE on spans table)
  • Partitioned by timestamp for cost-efficient queries
  • Supports federated queries with existing data warehouse

Use the ConnectRPC UserService to query administrative audit logs:

Terminal window
buf curl --protocol connect \
https://candela.example.com/candela.v1.UserService/ListAuditLog \
-d '{"user_id": "alice@example.com", "limit": 20}'

Use the TraceService to search LLM request traces with filters:

Terminal window
buf curl --protocol connect \
https://candela.example.com/candela.v1.TraceService/SearchSpans \
-d '{
"project_id": "default",
"filters": {
"model": "gpt-4o",
"tenant_id": "acme-corp"
},
"time_range": {
"start": "2026-05-01T00:00:00Z",
"end": "2026-05-17T00:00:00Z"
}
}'

For advanced analytics, query BigQuery directly:

-- Top 10 users by spend this month
SELECT
user_id,
COUNT(*) AS requests,
SUM(input_tokens + output_tokens) AS tokens,
SUM(cost_usd) AS spend_usd
FROM `my-project.candela.spans`
WHERE timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
GROUP BY user_id
ORDER BY spend_usd DESC
LIMIT 10;

FeatureIssueStatus
Compliance score (% requests passing all policies)#210Planned
Customer-facing governance dashboard#209Planned
CSV cost reports & trace export#107Planned
Compliance summary PDF#107Planned
Anomaly detection (cost/latency deviation)#211Planned