Skip to content
Sign in
ObservabilityGuardrail logMenu

Guardrail logPro

Blocked, modified or flagged text with the rule, the excerpt with the catch marked, and an override that needs a reason and leaves an audit line.

ProA rewrite, a block, an overridden false positive and a flag. Override needs a reason.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/guardrail-log

Usage

tsx
import { GuardrailLog } from "@/components/ui/chatcn/pro/guardrail-log"

<GuardrailLog entries={events} onOverride={(id, reason) => release(id, reason)} />

Blocked text is marked with a red wavy underline, rewrites strike the original and show what replaced it, flags get an amber tint. Override opens an inline form that needs a written reason; the entry then shows who overrode it, when and why.

Examples

States

ProRead only and filtered, loading and nothing caught yet.

Props

PropTypeNotes
entriesGuardrailEntry[]{ id, at, rule, action, direction, excerpt, matches?, replacement?, traceId?, override? }
onOverride(id, reason) => voidAdds Override to blocked and flagged entries
minReasonnumberShortest reason accepted. Default 12
filter, defaultFilter, onFilterChange"all" | "blocked" | "modified" | "flagged"
now, loading, labels

Keyboard

KeyAction
Cmd Enter, Ctrl Enter in the reasonRelease the output
Esc in the formCancel and return focus to Override

Accessibility

  • Marked text names itself for screen readers: caught, removed or replaced with.
  • A short reason sets aria-invalid and the hint below says how to fix it.