— Infrastructure

B2B SaaS audit logs: answer who changed what

Design useful B2B SaaS audit logs with actor, workspace, action and outcome. Plan customer access, exports, retention and tests for sensitive operations.

3 min readUpdated 2026-10-30By AptixLabs studio
Who changed what? Diagram: Actor — Verified identity; Action — Meaningful operation; Target — Workspace + record; Outcome — Recorded resultAptixLabs · 2026-10-30

Original AptixLabs workflow diagram; a planning model, not measured product results.

“Who changed this?” is a product question. A stream of server errors rarely answers it. A customer-facing audit trail should connect a meaningful action to the actor, workspace, target and outcome, while limiting the sensitive data copied into the record. Begin with the decisions a customer administrator needs to investigate.

Select events by consequence

Role changes, account removals, exports, integration changes and policy updates are useful starting points. Logging every button click adds noise without necessarily explaining a state change. Define an event when the application accepts or completes a meaningful operation, and distinguish a denied attempt from a successful change.

For asynchronous work, a request being accepted and the job completing are separate outcomes. Preserve a correlation identifier between them. For an AI-assisted operation, distinguish the human requesting it from the service executing it. Avoid showing “system” for every action when a real initiating actor is available.

Example audit-event contract
FieldExample meaningDesign question
WorkspaceCustomer organisation IDWho may retrieve this event?
Actor and initiatorService acting for an administratorCan responsibility be explained?
Action and targetMembership role changedIs the operation understandable?
OutcomeAccepted, denied or completedDid application state actually change?
Time and correlation IDRecorded time and request linkCan related events be reconstructed?
Safe change summaryViewer role became editorCan unnecessary private content be omitted?

Write events consistently with the operation

If the application commits a sensitive change and crashes before emitting its audit event, the trail has a gap. Consider a transactional outbox or another explicit reliability mechanism appropriate to your data store. Document the delivery and reconciliation behaviour rather than assuming a logging call always succeeds.

Repeated delivery should not create confusing duplicate actions. Give events stable identities and keep processing attempts separate. Decide how corrections are represented without silently rewriting history. “Immutable” is a strong claim: use it only when storage controls, operator access and retention behaviour support the statement.

Treat the viewer and export as protected features

Restrict audit access to appropriate roles and enforce the workspace boundary on the server. Test filtering, pagination and exports with two organisations, including an attempt to guess a job or download identifier. An asynchronous export should be checked again when it is downloaded; the requester may have lost access while it was being prepared.

Define retention and export formats with the customer requirement in mind. A security team may need timestamps, action types and stable IDs in a machine-readable file. A product administrator may need a readable explanation and a link to the current object. Those are different presentations of the same evidence.

WorkOS documents audit-event ingestion and export as dedicated product capabilities. The useful lesson is to specify those workflows separately from ordinary application logging, whether you buy infrastructure or implement the capability yourself.

Reference: WorkOS Audit Logs documentation

Verify the trail with a real scenario

Change a test member's role, attempt a forbidden export, remove the member and run a background task. Check that the events explain both the permitted result and the rejection without exposing private payloads. Then verify that an administrator from another workspace cannot retrieve them.

Related: operational observability for small teams

For a SaaS engagement, AptixLabs can help turn a buyer's audit requirement into an event catalogue, access policy and demonstration. The deliverable should answer concrete investigation questions. A large volume of logs alone is not evidence of a complete audit trail or regulatory compliance.

Are application logs the same as a customer audit trail?

No. Operational logs diagnose system behaviour; a customer audit trail explains meaningful actions, actors, targets and outcomes. They may share correlation identifiers but have different access and retention requirements.

What should we test in a SaaS audit-log export?

Test event completeness, stable identifiers, filters, role restrictions and tenant isolation. Recheck access when an asynchronous export is downloaded, including after the requester loses membership.

Need help with b2b saas development for connected customer workflows?

Tell us about your product, existing stack and the problem you need to solve. We can discuss integration scope, implementation tradeoffs and a practical first milestone.

Start a conversation