# A Status Column Is Not an Audit Trail: Designing for Accountability Across Regulated Products

Working across financial, insurance, and legal products makes one architectural question difficult to ignore:

Can the system explain how it reached its current state?

A feature can work perfectly from the user’s perspective while leaving important questions unanswered.

An application is approved. But by whom?

A policy changes. But which version did the customer accept?

A document is downloaded. But did the user have permission for that specific matter?

These are not merely reporting questions. They affect data modelling, authorisation, transaction boundaries, and operational access.

### Start with the decision, not the table

Consider this model:

```csharp
public sealed class Application
{
    public Guid Id { get; set; }
    public string Status { get; set; } = "Pending";
}
```

It records the present state. It does not explain the transition.

For an illustrative approval workflow, a separate decision record might capture:

```csharp
public sealed record ApprovalDecision(
    Guid Id,
    Guid ApplicationId,
    Guid ActorId,
    string PreviousState,
    string NewState,
    string PolicyVersion,
    string ReasonCode,
    DateTimeOffset OccurredAtUtc,
    string CorrelationId);
```

The distinction matters.

The application answers, “Where are we now?”

The decision record helps answer, “How did we get here?”

The `ActorId` should come from trusted identity context, not a field the caller can freely populate. Likewise, the policy version should identify the rules actually used, rather than whichever rules happen to be current when someone investigates later.

### Persist the change and its evidence together

Suppose the application update succeeds but the decision record fails to save.

You now have a state change without its expected evidence.

When both records belong in the same relational database, one approach is to persist them in the same transaction:

```csharp
await using var transaction =
    await db.Database.BeginTransactionAsync(cancellationToken);

application.Approve();

db.ApprovalDecisions.Add(
    new ApprovalDecision(
        Guid.NewGuid(),
        application.Id,
        actorId,
        "Pending",
        "Approved",
        policyVersion,
        reasonCode,
        timeProvider.GetUtcNow(),
        correlationId));

await db.SaveChangesAsync(cancellationToken);
await transaction.CommitAsync(cancellationToken);
```

This is an illustrative transaction boundary, not a complete approval handler. Production code also needs resource authorisation, valid transition checks, and concurrency handling.

If evidence must reach another system, a local database transaction cannot make both systems commit atomically. A durable outbox is one option for recording the intention to publish alongside the business change.

### Separate permissions from workflow rules

A user having an “Approver” role does not necessarily mean they can approve every application.

Useful questions include:

1. Does the application belong to their organisation?
2. Is the amount within their approval authority?
3. Are they allowed to approve something they submitted?
4. Is the application still awaiting a decision?

The first three concern authority. The fourth concerns workflow state.

Both must hold.

Also consider concurrency. Two approvers may read the same pending application before either saves. A concurrency token or conditional update can help prevent both decisions from silently succeeding against stale state.

### Audit evidence is not a reason to collect everything

OWASP’s logging guidance distinguishes useful event information from secrets and sensitive data that should not be recorded directly.

For this example, an audit event might need a resource identifier, an actor, an outcome, and a reason code. It probably does not need the applicant’s complete bank details or the contents of every uploaded document.

An audit store also needs its own controls:

1. Restricted write and read access.
2. Protection against unauthorised modification.
3. Appropriate retention and disposal rules.
4. Monitoring of administrative access.
5. A way to detect missing or altered evidence where required.

Calling a table `AuditLog` does not make it tamper resistant. That property depends on the surrounding controls.

### Translate requirements with the right people

No generic architecture makes a product compliant by itself.

The applicable obligations depend on the product, jurisdiction, contracts, and types of information involved. Engineering needs clear requirements from security, legal, compliance, and product specialists.

The architectural contribution is to make those requirements enforceable and testable.

“Maintain accountability” is an intention.

“Every approval records the trusted actor, applicable policy version, outcome, and timestamp in the same transaction as the state change” is something a team can implement and verify.

That is where compliance becomes a design conversation rather than a document attached to a release.
