Table of Contents

Class SensitiveContentDerivationGuard

Namespace
MailFathom.Application.SensitiveContent.Derivation
Assembly
MailFathom.Application.dll

The one thing every derived write calls before it copies mail text into a store of its own.

public sealed class SensitiveContentDerivationGuard
Inheritance
SensitiveContentDerivationGuard
Inherited Members

Remarks

Derived data is where redaction is cheapest and most durable: text redacted once stays redacted for every reader the chunk, the vector, and the search document ever have, and putting it back costs a re-derivation from raw MIME rather than a refetch from a mail server. So the derived path redacts on the way in, while SensitiveContentEgressGuard redacts on the way out — two boundaries, one SensitiveContentRedactor behind both, which is what keeps a citation drawn from a redacted chunk landing on the same redacted text when a reader opens the message.

It carries the stamp as well as the redaction. A derived row records the configuration it was written under, so a scanner switched on over an already-indexed mailbox is answerable rather than silently partial: what was written under an older configuration is stale in exactly the sense an embedding profile already uses, and the way back is a rebuild. The stamp exists precisely when a redaction does, which is what makes "written under no scanner" and "written under this scanner" two readable states rather than one absence.

With both switches off this guard is inert. It is registered whatever a deployment configured, so no writer carries a null check or a second code path, and with no redactor behind it every call returns its argument without constructing a detector, taking a concurrency permit, or touching an instrument — and stamps nothing, so a derived row is byte-identical to the one the same message produced before this feature existed.

Constructors

SensitiveContentDerivationGuard(SensitiveContentRedactor?, SensitiveContentDerivationStamp?, ISensitiveContentDerivationTelemetry, TimeProvider)

Initializes the derived-write guard of a deployment, whether or not it scans anything.

Properties

IsActive

Gets whether this deployment redacts what it derives at all.

Stamp

Gets the configuration a row written now records, or null where nothing is scanned.

Methods

GuardAsync(string, CancellationToken)

Redacts one text about to be written into a derived store.