# Guardrail notice

One line saying a guardrail stopped something: what was stopped, and which rule stopped it. Optionally the one thing the person can do about it.

- Registry name: `guardrail-notice` (`@candor/guardrail-notice`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/guardrail-notice

## Install

```bash
npx candor-ui add guardrail-notice
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/guardrail-notice`.
It brings in: locale, utils.
npm packages: lucide-react@^1.67.0.

## Example

```tsx
"use client"

import { GuardrailNotice } from "@/components/guardrail-notice"

export default function Example() {
  return (
    <div className="flex max-w-xl flex-col gap-3">
      <GuardrailNotice stopped="Dropping customers.partner_tier_old" rule="Destructive migrations in Production need an approver" action={{ label: "Request approval", onClick: () => {} }} />
      <GuardrailNotice stopped="Reading users.email" rule="Acme's data policy keeps personal data out of agent context" />
    </div>
  )
}
```

## <GuardrailNotice>

Props:

- `stopped: string`: What didn't happen, e.g. "Deleting a field from a record". A full stop is added unless it already ends with punctuation.
- `rule: string`: Why, e.g. "Deletes in production need a second person's sign-off". A full stop is added unless it already ends with punctuation.
- `action?: { label: string; onClick: () => void } | undefined`: The one thing the person can do about it, e.g. "Ask an Admin", as a button.
- `className?: string | undefined`

## Strings (`guardrailNotice`)

The fixed words, English by default. Override any of them under `guardrailNotice` in `<LocaleProvider strings={{ guardrailNotice: { … } }}>`; the table is exported as `guardrailNoticeStrings`.

- `stopped`: Stopped:

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
