Skip to content

AuditEntry

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

A row in the audit trail that records who changed which entity and when.

public sealed record AuditEntry : IEquatable<AuditEntry>

objectAuditEntry

IEquatable<AuditEntry>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

AuditEntry.Before and AuditEntry.After pass through a secret filter before they are written: the values of the apiKey, authorization, token, password and secret keys are replaced with "***".

Runs (an agent processing a message) are not written to this trail. The runs table already holds the full record; writing it a second time would turn the audit trail into the largest table and make it unreadable.

public AuditEntry()

Gets the action name, for example agent.update.

public required string Action { get; init; }

string

Gets the actor that made the change. It is null when there is no authentication or the actor cannot be resolved; that state is not hidden.

public string? Actor { get; init; }

string?

Gets the state after the change, as JSON text. It has passed the secret filter.

public string? After { get; init; }

string?

Gets the state before the change, as JSON text. It has passed the secret filter.

public string? Before { get; init; }

string?

Gets the time the record was written (UTC).

public required DateTimeOffset CreatedAt { get; init; }

DateTimeOffset

Gets the affected entity, for example agent:support.

public required string Entity { get; init; }

string

Gets the hash of this entry, derived from its canonical form (see AuditChainHasher in AgentPrism.Core). The write path computes this value; a caller-supplied value is ignored.

public string? Hash { get; init; }

string?

Gets the record id. A time-ordered UUID (v7).

public required Guid Id { get; init; }

Guid

Gets the hash of the previous entry of the same tenant. null for the first entry of a tenant.

public string? PreviousHash { get; init; }

string?

The chain is per TenantId: one tenant’s write rate never waits on another tenant’s chain. The write path computes this value; a caller-supplied value is ignored.

Gets the tenant the change belongs to.

public required string TenantId { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(AuditEntry? other)

other AuditEntry?

bool

public override int GetHashCode()

int

public override string ToString()

string

public static bool operator ==(AuditEntry? left, AuditEntry? right)

left AuditEntry?

right AuditEntry?

bool

public static bool operator !=(AuditEntry? left, AuditEntry? right)

left AuditEntry?

right AuditEntry?

bool