Compliance is a necessary evil in this era, and it's barely an afterthought for many chat backends on the open source market.

v0.6 - compliance readiness

For dotwire v0.6, I decided to change that. The project already came with a decent enough set of tools to help you get your app out on the market, without having to get a degree in law by the end of the sprint. Hash-chained audit logs, encryption at rest, DSAR export was the first step in creating audit-ready software, but if I want to call this production ready, the legal side should be just as solid as the technical side.

Before you go running to docs, here are how the compliance features compare:

Capability dotwire Stream Chat Sendbird Matrix Tinode Mattermost Rocket.Chat ejabberd (XMPP)
Deployment Model Self-hosted embeddable backend Managed SaaS API Managed SaaS API Self-hosted federated server Self-hosted embeddable server Self-hosted turnkey team chat Self-hosted turnkey/omnichannel Self-hosted federated server
Subprocessors and data residency None Vendor cloud Vendor cloud None unless federated None None None None unless federated
Compliance Paywall None Moderate-Heavy Heavy - HIPAA BAA, >6mo retention, SSO are Enterprise; export starts on Pro Enterprise compliance tooling is commercial None Heavy - Legal Hold, Retention, Compliance Export are Enterprise Moderate - Audit UI & advanced retention are Enterprise Moderate - Business Edition for some integrations
Encryption at Rest Yes - App-layer AES-256-GCM on by default Vendor-managed AES-256 at rest Vendor-managed AES-256 at rest Disk/DB level only Disk/DB level only Disk/DB level only Disk/DB level only Disk/DB level only
End-to-End Encryption No No, custom client-side only Optional - Enterprise/add-on Yes No No Optional Yes
Tamper-Evident Audit Log Yes - Hash-chained, append-only Partial - dashboard/API audit logs, not hash-chained Partial - dashboard/API audit logs, not hash-chained No No Partial - not hash-chained, advanced features Enterprise Partial - Enterprise audit panel, not hash-chained No
Member Read/Access Log (HIPAA §164.312(b)) Yes (opt-in) Vendor-side (covered via Enterprise BAA) Vendor-side (covered via Enterprise BAA) No (HTTP access logs only) No No (standard access logs) No No
Physical Erasure & Redaction (GDPR Art. 17) Yes - Physical delete, account anonymization or delete, hold/keep-period guarded Yes - Soft/hard delete APIs for users and messages (no native hold) Yes - User/message deletion APIs (no native hold) Partial, federation breaks erasure Partial - Soft/hard delete; no hold or keep-period enforcement Partial - Soft-delete default, permanent erase via CLI or Enterprise retention Partial - User erasure/anonymization exists; no hold locking in Community Partial - federation breaks guarantees
Downstream Erasure Webhooks (GDPR Art. 17(2) / 19) Yes - Durable JetStream webhook with exact (roomId, seq) pairs Partial, no dedicated compliance erasure queue Partial, no dedicated compliance erasure queue No No No No No
DSAR Export API (GDPR Art. 15 / 20, CCPA, PIPL) Yes - Single admin JSON endpoint Yes - export API available from Start plan Yes - export API starts on Pro plan No, E2EE unreadable server-side No, direct DB queries required Enterprise-only Yes - Built-in user data export No
Native Legal Holds Yes - Room/user holds, pauses retention, audited emergency-delete bypass No, must be enforced externally No, must be enforced externally No, commercial addons No Enterprise-only No (Community Edition) No
Automated Retention Yes - Config or API, O(1) TimescaleDB chunk drops, covers metadata, auto-pauses on holds Partial - custom policies on higher tiers, no hold pause Partial - 6-month default history, custom/extended retention on Enterprise, no hold pause Partial - Server/room retention, no legal-hold pause No Enterprise-only Partial - Message pruning, no legal-hold pause Partial - MAM pruning, no legal-hold pause
Config-Locked Compliance Guardrails Yes - AllowChanges, MinimumKeepDays, Erasure:Mode, AccessLog:* cannot be weakened via API No, API-managed settings No, API-managed settings Partial, static config No Partial, config locking on Enterprise No Partial, static config
PII-Scrubbed Telemetry Yes - OTel metrics and traces drop IDs, subjects, SQL, and content via strict allowlist Vendor-managed observability Vendor-managed observability Standard Prometheus/OTel Standard Prometheus Standard Prometheus/OTel Standard Prometheus Standard metrics

dotwire aims to give you most compliance features out of the box. Since the chat plugs into your API, you still have to keep your application fully compliant.

How the member access log works

HIPAA's audit-controls standard asks you to "record and examine activity". Chat in a healthcare app holds ePHI, so "who looked at this conversation, and when?" needs an answer. v0.6 adds an opt-in access log that answers it. It's off by default: set Dotwire:AccessLog:Enabled=true to turn it on.

Recording

The log records what dotwire served to a member, not what they saw. It is not a read receipt you'd see on Instagram (though I'm too familiar with those)

  • A hub Subscribe or an SSE stream writes a live.opened row. Every exit writes a matching live.closed row with the same window_id. The close reason may be: unsubscribed, disconnected, revoked, token expired, or error.
  • Each page served over REST or the SSE replay writes one row with the room, the user, the seq range and the count.
  • If your backend reads history on a member's behalf, mint the token with the optional dw:actor claim and the row records who initated the request.

Rows hold ids and timestamps only, not message content. Delivering a live message adds nothing to the log.

Write path

Subscribe / SSE open / history page │ publish + wait for ack (JetStream, stream ACCESS, Nats-Msg-Id dedupe) ▼ access-writer ▼ access_log hypertable 

Nothing inserts into Postgres from the request path. Events go to a dedicated JetStream stream, and a batched writer on the Api and All nodes drains it into its own TimescaleDB hypertable. Access volume never touches audit_log.

Failing closed

  • Opens and reads are acked before anything is delivered. If dotwire can't record the access, it refuses it with 503 access_log_unavailable.
  • Closes are best-effort but never silent. They go through a bounded queue with retries. Dropped closes are counted in metrics and logged.
  • A lost close still has a hard upper bound. The open row stores the token's expiry, and the server enforces it on both transports. Auditors see the window as open until, at most, token expiry.
  • Ambiguous publishes over-record rather than under-record. Nats-Msg-Id dedupes retries, and a failed open queues a compensating error close.

Startup also refuses Enabled=true without NATS, since nothing could be recorded.

Querying

Auditors use GET /audit/access with filters for room, user and time range. It returns each live window paired with its close (or the expiry bound) plus every history page served. Each row says whether it came via hub, SSE or history, and whether a host actor made the read. Every read of the log is itself written to the hash-chained audit log. Both host SDKs have a matching method.

Retention, holds, erasure, DSAR

  • Retention duration is config-only and can't be set through the API. It must be at least Compliance:MinimumKeepDays when above 0, and 0 keeps rows forever. Retention is O(1) chunk drops like the rest of the compliance tables.
  • The access log is evidence of who accessed what, so erasing a user or message leaves it intact. It holds ids only, make sure your privacy notice says so.
  • DSAR: The admin export includes the subject's access rows.
  • Audited configuration. Each node records its access-log configuration in the audit chain at startup, so a node with a mismatched flag shows up in the record.

Cluster rule

Enabled and Auth:MaxTokenLifetimeMinutes must be identical on every node. If a flag mismatch strands events, nothing is lost: the writer runs whenever the ACCESS stream exists.

Notes

It doesn't log denied attempts, participant-list reads, client IPs or user agents. Those belong in your proxy logs. It isn't hash-chained: it's append-only through database grants and a guard trigger.

And keep in mind, using it correctly in your app is still your job.