Redact scan
Checks a prompt for personal data before it is sent. A scan line passes down the text and marks each email, phone number, card number and name with its kind as it reaches it; Redact then wipes a bar across each, and each one can be shown again.
Hi, this is Maya Chen from the Lisbon office. Dev Patel was charged twice on card 4242 4242 4242 4242 last Tuesday. Please call him on +351 912 345 678 or email dev.patel@northwind.io before refunding.
When to use
- AI composers and support tools that send user text to a model or a third party.
- Exports and shares where personal data should be removed first.
When not to use
- Treating it as complete protection; the built-in detection is a first pass. Pass your own names list and keep server-side checks.
- Text people are still writing; scan when they are about to send.
Installation
pnpm dlx shadcn@latest add @caliper/redact-scan
Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
RedactScan
3 props
Also accepts the native props of its root element and a ref.
findEntities
0 props
No props of its own; it accepts the native props of its root element.
redactText
0 props
No props of its own; it accepts the native props of its root element.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements and keeps aria-pressed, aria-label, aria-hidden and aria-live in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/redact-scan.mdThe index of every part is at /llms.txt.