Control
Audit Log
Audit Log is the tamper-evident audit and compliance layer of BaseLLM, the AI gateway by Base Interactive. It answers "who did what, and what was the result?" Each record carries the fingerprint of the one before it. If a record is changed or deleted, chain verification points to it by sequence number.
What is recorded, and what isn't
Audit Log stores event metadata, not content. The record fields below use their API names.
| Recorded field | Not recorded |
|---|---|
| actor type / id | prompt |
| correlation_id | model response |
| action | raw API key |
| method / path | provider credentials |
| status / outcome | request body |
| IP hash | tool arguments |
| user-agent | |
| metadata.durationMs |
Event types and architecture
- HTTP request
- policy.violation
- pii.detection
- settings.update
- settings.restart
Audit records are stored in a PostgreSQL database separate from the main application database and exported from there to your SIEM in batches. correlation_id links an audit record to the usage and log records of the same request.
Tamper-evident hash chain
Each record has a sequence number (seq), its own fingerprint (row_hash) and the previous record's fingerprint (prev_hash). Fingerprints are SHA-256.
| Tampering | Chain verification result |
|---|---|
| A record is changed | Fingerprint doesn't match; the record is shown by sequence number |
| A record is deleted | A gap appears in the sequence: "record missing" |
| A record is inserted | The next record's "previous fingerprint" doesn't match |
Four layers of protection
- Database guard
1: UPDATE, DELETE and TRUNCATE are blocked on the audit table. - Chain
2: If someone disables the guard with admin rights and touches a record, the fingerprints no longer match. - External copy (SIEM)
3: Each record's fingerprint also goes to your SIEM; even if the chain is rewritten from the start, the copy exposes it. - Automatic check
4: The chain is checked end to end every day; any break goes to your SIEM as an error record.
An admin can check the chain at any time with the "Verify chain" button on the System Logs › Audit screen. If the chain is broken, the result shows the sequence number and the type of break. Your security team defines the alert rule in the SIEM.
Performance and caveats
| Operation | Result | Conditions |
|---|---|---|
| Writing 3,000 records | 305 ms, chain intact | Two servers at once |
| Verifying 3,000 records | 39 ms | Same test |
| Verifying 244,939 records | 6.4 s, chain intact | Local load test, 3 replicas |
| Loss on graceful shutdown | 0 records | 150 requests/s, 1 of 3 replicas shut down |
- In a sudden crash, only records waiting in memory from the last ~100 ms can be affected.
- During a database outage, up to 20,000 records are held in memory; beyond that, a warning is logged.
- If someone with full privileges rewrites the chain from the start, the copy in your SIEM reveals it.
- A provider error that occurs after a stream has started is written to the audit log as 200 / success.
- The masked sample from a pii.detection record goes to your SIEM as meta_maskedSample.
Frequently asked questions
Does the LLM gateway audit log store prompts and model responses?
No. The Audit Log keeps event metadata, not content: who, which action, the outcome, the duration and a hash of the IP address. Prompts, model responses, request bodies and raw API keys are never written.
How do you prove a record was not changed later?
Each record carries the SHA-256 fingerprint of the one before it. A changed, deleted or inserted record shows up in chain verification by its sequence number. The chain is checked automatically every day, and an administrator can check it at any time with the "Verify chain" button.
Can records be sent to a SIEM?
Yes. Audit records live in a separate PostgreSQL database and are exported to your SIEM in batches; each record's fingerprint goes to the SIEM too. See SIEM export.
Are personal data detections recorded?
Yes, as pii.detection events; only the masked sample is written, never the raw value. See Sensitive data masking.
Where are model, token and cost details?
They are kept in the usage record and shown on the Budget and cost screen, linked to the audit record by the same correlation_id.