Skip to content
GitHub (opens in a new tab)

GuardrailLog

Every time a policy rule stepped in on an agent by itself, newest first.

stableOrganismcontracts/guardraillog.json

Preview

GuardrailLog

Rules stepping in on their own. Not ApprovalCard. Not PermissionRequest.

Master

Filter, open an event, then request an override. Submit confirms first.

Guardrails

2 blocked · 2 rewritten · 1 flagged this week

Usage

GuardrailLog shows policy rules acting on agents without being asked: blocked, rewritten or flagged. AutonomyDial sets the limits; this log shows them working. When the agent asks first, use ApprovalCard or PermissionRequest.

Do's

  • showing guardrails at work: rules that stopped, changed or flagged agent actions without being asked
  • a person needs to see exactly what an agent tried and ask the rule's owner for an exception
  • a header needs a one-line count of rule hits (compact)

Don'ts

  • the agent asks before acting — ApprovalCard
  • the agent asks for standing access — PermissionRequest
  • a general stream of events and changes — ActivityFeed
<GuardrailLog
  events={events}
  filters={filters}
  onFiltersChange={setFilters}
  overrideStatus={status}
  onRequestOverride={(id, reason) => requestOverride(id, reason)}
/>

Every time a policy rule stepped in on an agent by itself: blocked, rewritten or flagged, what the agent tried, newest first. A row opens a Drawer with the exact attempt, the rule and its owner, and a confirmed override request.

When to use

  • showing guardrails at work: rules that stopped, changed or flagged agent actions without being asked
  • a person needs to see exactly what an agent tried and ask the rule's owner for an exception
  • a header needs a one-line count of rule hits (compact)

When not to use

  • the agent asks before acting — ApprovalCard
  • the agent asks for standing access — PermissionRequest
  • a general stream of events and changes — ActivityFeed

What an agent reads

import { GuardrailLog } from "agentic-ds-kit";
must
  • section aria-labelledby the h2 title
  • verdicts are words in a Badge, never colour alone; Flagged is a neutral outline Badge
  • rows are buttons in a list; Up and Down move between them; the open row has aria-current
  • filters are a kit FilterBar; a filter opens a labelled RadioGroup of its values
  • the Drawer and AlertDialog keep focus; closing the Drawer returns focus to its row
  • the override reason is a labelled Textarea; Submit confirms in a kit AlertDialog
  • motion is off under prefers-reduced-motion
defaults
  • title Guardrails
  • timeOptions ["Today","This week","This month"]
  • overrideStatus idle
  • compact false
stops if
  • Do not invent a local PolicyLog, RuleHitList or OverrideForm
  • Do not use it for questions the agent asks first (ApprovalCard, PermissionRequest)
  • Submit request is the one solid primary, in the Drawer
  • Do not use raw hex

From contracts/guardraillog.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
eventsarrayYes—Newest first. { id, verdict: "blocked" | "rewritten" | "flagged", rule: { name, text, owner }, agent: { name, src? } (the Avatar shows only with src), attempted, sentInstead?, at, runHref?, summary? }[]. sentInstead shows for rewritten. summary ("Blocked a $5,000 refund on INV-1842, over the $500 cap") is the row title when given; rule, agent and time drop to the caption.
titlestringNoGuardrails—
filtersobjectNo—{ verdict?, rule?, agent?, time? }. Uncontrolled when omitted. Verdict, rule and agent filter the list; time is a label, so pass the events in that window.
onFiltersChangefunctionNo——
timeOptionsarrayNo["Today","This week","This month"]—
selectedIdstringNo—The event open in the Drawer; null closes it. Uncontrolled when omitted.
onSelectfunctionNo—(id | null) => void.
onRequestOverridefunctionNo—(id, reason) => void, after the AlertDialog confirms. Submit request is the Drawer's one solid primary; omit to hide the request.
overrideStatusidle | sending | sent | errorNoidlesending disables Submit; sent shows a success Alert; error a danger Alert, keeping the reason.
compactbooleanNofalseOne line: the summary ("14 blocked · 3 rewritten · 6 flagged this week") plus the latest event.
  • Component
    →

    ApprovalCard

    The agent asks before it acts: risk, what will happen in words, an exact preview of the command or diff, and Approve (⌘/Ctrl+Enter) / Deny (Escape) with an optional auto-deny countdown.

  • Component
    →

    PermissionRequest

    An agent asks for standing access to a capability (files, email, repo, billing), scope by scope, with why and expiry.

  • Block
    →

    Activity feed

    What people and agents did across the workspace, newest first and grouped by day.

  • Component
    →

    FilterBar

    A row of filter chips with add, clear all, and an overflow menu when the row is too long.