DOCS
v0.4

AI Components / Guardrail

Guardrail

Content safety filter with policy checks, blocked content blur, severity badge, and override controls.

ai-workflowv0.4.0

Playground

Examples

Safe
<ai-guardrail status="safe" style="max-width:500px;"></ai-guardrail>
Flagged
<ai-guardrail status="flagged" severityLevel="medium" style="max-width:500px;"></ai-guardrail>
Blocked + override
<ai-guardrail status="blocked" severityLevel="high" allowOverride blockedContent="[Redacted: SSN 123-45-6789 and home address found in output]" style="max-width:500px;"></ai-guardrail>

Import

import { AiGuardrail } from '@cognivo/components';
// Or tree-shake: import '@cognivo/components/ai-guardrail';

Per-component imports ship only that component (~8 kB gzip).

API Reference

PropTypeDefaultDescription
status"safe" | "flagged" | "blocked""safe"Filter status
checksPolicyCheck[]Policy results — {policy, passed, reason?}
blockedContentstringBlurred blocked content (click to reveal)
allowOverridebooleanfalseShow admin override button
severityLevel"low" | "medium" | "high" | "critical""low"Severity level
rounded"none" | "sm" | "md" | "lg""lg"Border radius

Events

EventDetailDescription
ai-guardrail-override{status, severity}Override clicked
ai-guardrail-report{status, checks}Report clicked