Audit Logging
Rivano maintains two complementary audit logs: a trace log for every proxied AI request, and a governance log for every control-plane mutation. Together they provide a complete, tamper-evident record of all AI activity and administrative changes in your tenant.
Trace log
Every request that passes through the Rivano gateway is recorded as a trace. The trace record contains:
| Field | Description |
|---|---|
id | Unique trace ID |
agent_id | The agent that made the request |
tenant_id | Tenant (enforced by RLS) |
status | success or error |
environment | Agent’s environment tag |
session_id | Optional session grouping |
input_tokens | Tokens in the request |
output_tokens | Tokens in the response |
cost_usd | Calculated cost |
duration_ms | End-to-end latency |
injection_score | Injection risk score (0.0–1.0) |
pii_detected | Array of detected entity types |
policies_fired | Policies that matched and their actions |
model_provider | LLM provider used |
model_name | Model name used |
created_at | UTC timestamp |
Traces are immutable once written. The traces and trace_spans tables are append-only — no update or delete operations run against them during normal operation.
Span detail
Each trace contains one or more spans covering distinct pipeline stages:
queue— Time in queue before processingpolicy_eval— Policy evaluation latencyprovider— Time waiting for the LLM providerpii_scan— PII detection latencyquality_score— Quality scoring latency
Span data lets you identify where latency is coming from — provider slowness vs. pipeline overhead.
Governance log
Every mutating operation on the control plane is recorded in the governance changelog:
| Event | Logged when |
|---|---|
policy.created | A new policy is created |
policy.updated | A policy is modified |
policy.deleted | A policy is deleted |
agent.registered | An agent is registered |
agent.updated | Agent configuration is changed |
key.created | An API key is created |
key.deleted | An API key is deleted |
team.member_added | A user joins a team |
team.member_removed | A user is removed from a team |
sso.configured | SSO settings are updated |
retention.updated | Retention policy is changed |
Each governance event records: actor (user ID + email), action type, resource type, resource ID, diff (before/after JSON), and timestamp.
Viewing the audit log
The Security → Audit Log page in the dashboard shows both trace events and governance events in a unified timeline. Filter by:
- Actor — Which user performed the action
- Action type — e.g.
policy.created,agent.updated - Time range — Last 24h, 7d, 30d, or custom
- Resource type — Policy, agent, key, team, etc.
Click any row to see the full event detail including the diff for governance events.
Retention
Trace and audit data is retained per your plan:
| Plan | Retention |
|---|---|
| Free | 7 days |
| Starter | 30 days |
| Pro | 90 days |
| Enterprise | 365 days (configurable) |
You can configure a shorter retention period in Settings → Retention. Reducing retention takes effect immediately — data older than the new limit is deleted on the next cleanup cycle.
Retention changes are irreversible. Export data you need before reducing the retention period. Compliance reports generated before the change are not affected.
Export
Dashboard export
Go to Observability → Traces, apply any filters, and click Export. Rivano generates a JSONL file with one trace object per line.
API export
Query traces programmatically using the Traces API with date range filters:
# Export all traces from the last 30 days
curl "https://api.rivano.ai/api/traces?limit=1000&offset=0&startDate=2026-03-01&endDate=2026-04-01" \
-H "Authorization: Bearer rv_api_..." \
| jq '.data[]' > traces.jsonl
For large datasets, paginate using limit and offset until data.length < limit.
Governance log export
curl "https://api.rivano.ai/api/traces/stats?period=30d" \
-H "Authorization: Bearer rv_api_..."
Compliance reports (SOC 2, GDPR, ISO 27001) can be exported as PDF or JSON from Security → Compliance → Generate Report.
Related
- Security Overview — Pipeline and compliance posture
- Policies — Policy events in the audit trail
- Traces API — Programmatic trace access
- Dashboard — Audit Log and Compliance pages walkthrough