Skip to content

ModerationGuardOptions

optional categories?: string[];

Policy categories to flag. Defaults cover the standard abuse set.


optional id?: string;

optional message?: string;

User-facing message when content is flagged.


model: LanguageModel;

Classifier model. Use a small/fast model — this runs on every turn it guards.


optional onError?: "block" | "allow";

What to do when the classifier itself errors. allow (default) fails open — deterministic guards still run and an outage does not take the agent down. block fails closed for zero-tolerance deployments.