Skip to content
Sign in
EvalsInjection warningMenu

Injection warningPro

Marks content from a page, file, email or tool result that tried to instruct the agent, shows the injected text in place and what the agent ignored.

ProA pricing page hid an instruction in white text; the agent ignored it.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/injection-warning

Usage

tsx
import { InjectionWarning } from "@/components/ui/chatcn/pro/injection-warning"

<InjectionWarning
  source={{ kind: "page", title: "Plans and pricing" }}
  excerpt={passage}
  injection={injectedText}
  hiddenAs="white text on a white background"
  asked={["Open an upgrade link for 40 seats"]}
  outcome="Kept comparing the three plans."
/>

The passage shows as the agent read it with the injected text fenced in a hatched amber mark, revealed when it was hidden from people (hiddenAs). The instructions it gave are struck through, and outcome says what the agent did instead. Status scanning while a source is checked, blocked when the agent ignored it, paused when it stopped to ask (with Keep ignoring and Allow once), and allowed after a person let it through. Use variant="inline" inside a message: one quiet line that opens in place.

Examples

States

ProPaused on a README comment, scanning and inline in a message.

Props

PropTypeNotes
source{ kind, title, url? }page, file, email or tool
excerpt, injectionstringThe passage, and the injected text inside it
hiddenAsstringHow it was hidden from people
askedstring[]What it told the agent to do
outcomeReactNodeWhat the agent did instead
status"scanning" | "blocked" | "paused" | "allowed"Default blocked
variant"card" | "inline"Default card
open, defaultOpen, onOpenChangebooleanCards open by default, inline closed
onAllow, onIgnore() => voidPaused only
onViewSource, onReport() => voidFooter actions, shown when set

Keyboard

KeyAction
Enter, SpaceOpen or close the details

Accessibility

  • A named region; the header is a button with aria-expanded.
  • The injected text is a mark with hidden start and end words, and each ignored instruction says it was not done.

Motion

When opened by pointer, the amber mark sweeps across the injected text once with clip-path (280 ms, mirrored in right to left), so the eye lands on it. No sweep when opened by keyboard or under reduced motion.