AgentPrismContentFilteredException
AgentPrism.Abstractions.dllThrown when a model provider cuts the response short with its safety or content filter.
public sealed class AgentPrismContentFilteredException : AgentPrismException, ISerializableInheritance
Section titled “Inheritance”object ← Exception ← AgentPrismException ← AgentPrismContentFilteredException
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”AgentPrismException.ErrorType, Exception.GetBaseException(), Exception.ToString(), Exception.GetType(), Exception.TargetSite, Exception.Message, Exception.Data, Exception.InnerException, Exception.HelpLink, Exception.Source, Exception.HResult, Exception.StackTrace, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”A filtered response usually arrives empty. Treating that as
“succeeded but empty” produces the hardest case to debug: the user sees a blank
answer and the record holds no trace. AgentPrism records it as an explicit
failure instead — RunError.Type becomes content_filtered.
Detection lives in a shared IChatClient decorator inside
AgentPrism.Core, not inside the provider packages, so every provider
gets the same behaviour.
Constructors
Section titled “Constructors”AgentPrismContentFilteredException()
Section titled “ AgentPrismContentFilteredException()”Creates a new error.
public AgentPrismContentFilteredException()AgentPrismContentFilteredException(string)
Section titled “ AgentPrismContentFilteredException(string)”Creates a new error.
public AgentPrismContentFilteredException(string message)Parameters
Section titled “Parameters”message string
The error message.
AgentPrismContentFilteredException(string, Exception)
Section titled “ AgentPrismContentFilteredException(string, Exception)”Creates a new error.
public AgentPrismContentFilteredException(string message, Exception innerException)Parameters
Section titled “Parameters”message string
The error message.
innerException Exception
The underlying error.
Fields
Section titled “Fields”ContentFilteredErrorType
Section titled “ ContentFilteredErrorType”The stable value written to AgentPrismException.ErrorType.
public const string ContentFilteredErrorType = "content_filtered"Field Value
Section titled “Field Value”Properties
Section titled “Properties”ErrorType
Section titled “ ErrorType”Gets the stable error type name written to the run record.
public override string ErrorType { get; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Defaults to the full name of the exception type, so today’s behaviour does
not change. A derived type overrides this member when the record has to be
machine readable — for example AgentPrismContentFilteredException
writes content_filtered. Reports and alert rules can rely on this
stable name instead of an assembly name.
The value is written to RunError.Type and carries no secret.
FinishReason
Section titled “ FinishReason”Gets the finish reason the provider reported. For example Anthropic
refusal or Gemini SAFETY. Carries no secret.
public string? FinishReason { get; init; }Property Value
Section titled “Property Value”ProviderName
Section titled “ ProviderName”Gets the provider that filtered the response, or null when unknown.
public string? ProviderName { get; init; }