AI-25AINew, October 21, 2026
AI Redact
Masks names, emails, card numbers and keys as placeholders before a prompt is sent, then fills the real values back into the reply.
Usage
Pass respond to answer with your model. It gets the masked message, with placeholders like PERSON_1 and EMAIL_1 in place of the real values, and returns the reply, a Promise of it, or a stream of deltas. Placeholders the model writes back stay as chips while the reply streams, then the real values are filled in on this side once it ends. A throw shows the error's message as the reply. Pass names from your CRM so people are masked too; emails, phone numbers, cards and API keys are found by pattern.
"use client";
import AIRedact from "@/components/kokonutui/ai-redact";
export function SupportComposer({ contacts }: { contacts: string[] }) {
return (
<AIRedact
defaultValue=""
names={contacts}
respond={async function* (masked, signal) {
const res = await fetch("/api/reply", {
method: "POST",
body: JSON.stringify({ prompt: masked }),
signal,
});
if (!(res.ok && res.body)) {
throw new Error("Couldn't reach the model. Try again.");
}
const reader = res.body.pipeThrough(new TextDecoderStream()).getReader();
while (true) {
const { done, value } = await reader.read();
if (done) return;
yield value;
}
}}
/>
);
}On the server, stream with streamText(...).toTextStreamResponse() and tell the model to keep placeholders exactly as written. The real values never leave the browser.
PROSlash Command Menu and more like it are in Kokonut UI Pro
Installation
AI Redact is a free, open-source React component in the Kokonut UI AI collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/ai-redact.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/ai-redactOr add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/ai-redact.tsx.
npm install lucide-react motionProps
titlestringDefault "Support assistant"defaultValuestringDefault demo dataText already in the composer when it mounts.
namesstring[]Default demo dataNames to mask, e.g. contacts from your CRM. Regexes cover the rest.
respond(masked: string, signal: AbortSignal) => ReplyDefault demo dataAnswers the masked prompt. It only ever sees placeholders like EMAIL_1; any it writes back are filled in on this side. Return the reply, a Promise of it, or a stream of text deltas (like the AI SDK's textStream). Throw and the reply shows the error's message.
classNamestringExtra classes for the root element.
Reply
A reply: the text, a Promise of it, or a stream of text deltas.
type Reply = string | Promise<string> | AsyncIterable<string>;Dependencies
| Needs | Version | Comes from |
|---|---|---|
lucide-react | ^0.556.0 | npm, installed by the CLI |
motion | ^12.23.25 | npm, installed by the CLI |
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.
AI Message Queue
Keep typing while the agent works. Follow-ups stack above the composer, where you can reorder, edit or send one now, and go in one by one when the run ends.
AI Memory
An assistant that saves what it learns about you into a memory list. New facts replace the ones they contradict, and you can edit or forget any of them.

