Guide · CompanionGuard · Published 14 November 2026 · Reviewed 14 November 2026 · By the Ingenious AI team
Audit Logs for Companion Bots: Keep Decisions, Not Conversations
The short answer
Colorado's pack states the records duty plainly: 'keep records sufficient to evidence referrals and disclosures'. CompanionGuard's answer is an audit log of decisions — event kind, signal class, action, timestamp, session reference, disclosure state — hash-chained so the record is tamper-evident, and deliberately empty of message text, user IDs, IPs and user agents. Sufficiency is a property of the decision record, not of retained conversations.
What is a safety audit log for a companion bot?
A safety audit log is the durable record of what a bot's guardrails did: which decisions were taken, on what signal class, with what action, at what time, in what session — sufficient for a reviewer to reconstruct the guardrail's behaviour without reconstructing any user's conversation. In CompanionGuard it is the runtime's hash-chained evidence chain plus counts-only referral metrics.
Create the free safety kit Next guide All guides
CompanionGuard is built by Ingenious AI. A compliance toolkit — not legal advice and not a clinical service. If you are in crisis right now: US — call or text 988; UK & Ireland — Samaritans 116 123.
The sufficiency test: a reviewer's five questions
A log is sufficient if a sceptical reviewer can answer five questions from it alone. What fired? (Event kinds and actions: show_crisis_resources, enforce_break, disclosure events.) Why? (The signal class — or its recorded absence.) When? (Timestamps on every entry.) In what context? (Bot, session reference, minor-session flags, elapsed cap values where relevant.) And is this record the one that was written at the time? (Chain verification.) CompanionGuard's evidence entries are shaped to make those five answers mechanical — each is a field or a recomputation, never an interview with the operator.
Hold your own logging to the same test. Most homegrown logs answer 'when' lavishly and 'why' not at all (a bare 'referral shown' with no class), or answer 'why' with raw text — overshooting into surveillance while undershooting on structure. The five questions define the middle: decision-grade records.
What belongs in the log — the field list
From the runtime's own entry construction: bot identifier; session reference (a one-way hash of the operator's session ID); event kind; signal class (primary, with all matched classes recorded); action; a one-way hash of the message; the previous entry's hash and this entry's computed hash; and the creation timestamp. Around the chain sit the counts-only aggregates: referrals shown and clicked, breaks enforced, disclosure coverage — the numbers dashboards and annual reports consume.
Note what each field earns. The message hash earns sameness-detection (repeat messages visible) without content. The session reference earns continuity (a session's decisions read as a story) without identity. The elapsed values on cap events earn calibration. Every field is there because a reviewer's question needs it; that is the admission standard for any field you propose adding.
What must never be in the log
Raw message text — the single most consequential exclusion, because a log of conversations is a breach target, a subpoena magnet and a trust violation in a product category built on confiding. User identifiers and account linkage. IP addresses and user agents — the runtime's code states flatly that none are stored. Parent contact details. And free-text 'notes' fields written by anyone at 2 a.m. — the classic side-channel through which content sneaks back into a clean schema.
The exclusion list needs an enforcement mechanism, not just intent: in CompanionGuard the entry format is fixed by the sealing function, so there is no parameter through which text could be added casually. If your own stack logs through a general-purpose pipeline, add a schema gate and a periodic grep of the log store for the patterns that should never appear (email shapes, long text fields). Absence should be verifiable, not remembered.
Retention: how long evidence should live
Safety records have two clocks: duties (California's annual report consumes a year of counts; Colorado's sufficiency has no stated expiry in the pack) and risk (every retained record is a record that can be breached or demanded). The counts-and-hashes design stretches the safe retention horizon precisely because the content is inert: a five-year-old chain entry reveals a class, an action and a timestamp — a fact about the guardrail, not about a person. Operators commonly keep evidence for the longest duty horizon they serve, export it out of the live database on a rhythm, and let the chain's own integrity carry the archive's credibility.
Whatever horizon you choose, write it down with its reasoning, apply it uniformly (selective deletion breaks chains — and reads terribly), and prefer archival exports over live-table pruning: an exported, verified chain segment is evidence at rest; a pruned table is a gap with an explanation. The evidence guide covers verification; the exports guide covers the handover.
Five actions for a sufficient, safe audit log
- Test your log against the reviewer's five questions — what fired, why, when, in what context, and is it unaltered — using only the log itself.
- Fix the entry schema: classes, actions, timestamps, pseudonymous references and hashes in; text, identities, IPs and free-text notes out, enforced by the writing code.
- Verify the chain monthly and archive exports outside the live database with their verification results dated.
- Set a written retention horizon tied to your longest duty (the annual-report year is the floor for California-facing bots) and apply it uniformly.
- Periodically grep the log store for content that should never exist there — long text, email shapes, IP patterns — and treat any hit as an incident.
Worked example: the log that answered a regulator-shaped question
A fictional companion, Havenbrook, receives a partner's diligence question modelled on Colorado's wording: 'Show us records sufficient to evidence referrals and disclosures for last quarter.' The team exports the quarter's chain — 212,000 entries — and runs verification live on the call: clean end-to-end. Filters answer the specifics in minutes: 3,914 show_crisis_resources decisions with class distribution; disclosure recorded in 100% of sessions; 612 enforce_break events with elapsed values.
The partner's follow-up — 'and the underlying conversations?' — gets the architectural answer: they do not exist in the safety record, by design, and the export's field list proves it on its face. Diligence closes in one round. The story is invented; the field list, the duty wording and the chain mechanics are the product's own.
Frequently asked questions
What should a companion bot's audit log contain?
Decision records: event kind, signal class, action, timestamp, bot, session reference (one-way hash), a one-way message hash, and the hash-chain links — plus counts-only aggregates for dashboards and reports. Enough to evidence referrals and disclosures, in Colorado's pack phrasing.
What must the log never contain?
Raw message text, user identifiers, IP addresses, user agents, parent contact details and free-text notes. CompanionGuard's runtime stores none of these — the exclusions are in the entry format itself, not in a policy.
How long should safety records be kept?
At least the longest duty horizon you serve — California's annual report consumes a year of referral counts — with the horizon written down and applied uniformly. Counts-and-hashes records are inert enough to retain safely; archive verified exports rather than pruning live tables.
How does a reviewer know the log wasn't edited?
Hash chaining: each entry's hash covers the previous entry's hash and its own fields, so edits, deletions or reordering break verification at the edited point. Verification is recompute-and-compare from the export alone.
Are counts-only metrics part of the audit log?
They are its aggregate layer: referrals shown/clicked, breaks enforced, disclosure coverage — the numbers reports consume, derived from the same identifier-free discipline as the chain.
Keep going
Related guides: Hash-Chained Evidence: Tamper-Evident Records for Chatbot Safety Decisions · Colorado Chatbot Safety Act: What Changes on 1 January 2027 · Companion Bot Privacy: How to Keep Evidence Without Keeping Conversations
Put it to work: Create the free kit · Eval harness · Scenario tests · Crisis runtime · Disclosure packs · Pricing · All CompanionGuard guides