Skip to content

AgentPrismContentGuardOptions

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Settings for the content inspection pipeline.

public sealed class AgentPrismContentGuardOptions

objectAgentPrismContentGuardOptions

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

Read from the AgentPrism:ContentGuard configuration section.

None of the settings in this class have any effect while no guard is registered: the inspection wrapper is not added to the pipeline and this object is never read. The the no-surprises rule (no surprises) gate is not a flag, it is the registration itself — the built-in guard is added by an explicit choice, either via AddPatternContentGuard or by populating the AgentPrism:ContentGuard:Pattern section.

public AgentPrismContentGuardOptions()

The configuration section name.

public const string SectionName = "AgentPrism:ContentGuard"

string

While output inspection is on, the streaming response is buffered. Default true.

public bool BufferStreamingOutput { get; set; }

bool

A frame cannot be recalled once it has been sent to the client. A pattern does not match on a partial piece of text: 4539- is seen and passes through before the card number is complete. Buffering costs the liveliness of the stream but inspects correctly.

Setting this to false leaves output inspection half done: the guard only ever sees each frame on its own. Silently doing half an inspection is worse than doing none — the user believes they are protected. That is why the choice is an explicit setting, not a hidden behavior.

Inspects content sent to the model. Default true.

public bool InspectInput { get; set; }

bool

Tool results are covered too: a tool result enters the model on the second call and is seen because inspection sits at the IChatClient layer.

Inspects content coming from the model. Default true.

public bool InspectOutput { get; set; }

bool