Integration · AI context
Protect AI and LLM context
Use this boundary when your application assembles model-bound text but does not need a protocol-specific adapter.
01 · AI Context
Install
The package walks supported text values and delegates every detection decision to core.
npm install @redact-secret/core@0.1.0-beta.13 @redact-secret/adapter-ai-context@0.1.402 · AI Context
Build context
The transformation is all-or-nothing. Unsupported binary or encoded content blocks the result; model output is outside this input boundary.
import { createAiContextBoundary } from "@redact-secret/adapter-ai-context";
const boundary = await createAiContextBoundary();
const outcome = boundary.buildContext([
{ role: "user", text: "API_KEY=SYNTHETIC_REVOKED_VALUE" },
]);
if (outcome.outcome !== "ok") throw new Error(outcome.outcome);
sendToModel(outcome.value);