Skip to content

AuditSecretFilter

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Redacts potential secrets from before and after payloads before they are written to the audit trail.

public static class AuditSecretFilter

objectAuditSecretFilter

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

The filter operates on property names. A case-insensitive property containing apiKey, authorization, token, password, or secret has its value replaced with "***", regardless of type.

The types audited today, such as McpServerDefinition, do not contain secrets, but the filter still applies because a future type might.

Does not use reflection; it operates manually with Utf8JsonWriter and JsonDocument.

Redacts secret fields in the supplied JSON text.

public static string? Redact(string? json)

json string?

The raw JSON text. Returns it unchanged when null.

string?

The redacted JSON text.