Skip to content

Runtime credential redaction · Open source

Secrets spread fast.
Stop them before they spread.

A credential pasted into a prompt can end up in a tool response, a trace, a log, and a conversation history. Redact Secret detects supported credentials while the data is still in your application and replaces them before they reach those destinations.

One local detection core. Integrations for the paths your data takes.

One scanscanAndRedact()
Input
API_KEY=SYNTHETIC_REVOKED_CONTEXT_VALUE
Output
API_KEY=<SECRET_1>

Synthetic fixture, not a live credential. The finding metadata records the family, offset, and length of the match, never the value.

The runtime problem

Protect live data, not just source code.

Repository scanners help find secrets committed to code. Redact Secret works where your application handles text at runtime: user input, error messages, tool results, logs, traces, stored records, and model context. One paste becomes five copies before anyone notices.

A user pastes one line

API_KEY=

The application never asked for a credential. It arrived inside text the application does not control.

  • Tool responsereturned to the agent, then quoted back into contextValue kept
  • Trace span attributeexported to a vendor backend, retained for weeksValue kept
  • Application logshipped, indexed, searchable by everyone on callValue kept
  • Conversation historyreplayed into every later turn of the sessionValue kept
  • Stored recordwritten to the database, the cache and the search indexValue kept
1paste
5systems now hold it
0of them are the place to fix it

Rotating the credential is the only remedy once it has landed. The scan belongs one step earlier, at the boundary where your application hands the text to something else.

Playground

Try it on your own text.

Edit the input and watch the output change. The detection core runs as WebAssembly in this tab, the same engine the packages ship.

Nothing you type leaves this browser tab. It is not sent, stored, or logged, and spellcheck is off. Use synthetic values anyway: never paste a live credential into a web page.

Examples
PII

PII detection is opt-in and off by default: credentials only. Global adds email, phone, payment card, IP address, and IBAN; Global + US adds US Social Security numbers. Each mode is a separate engine instance, because the core fixes its PII selection when it starts.

274 B / 32.0 KB
Output

Loading the engine…

First run

Start with a single scan.

Install a specific published version, run one scan, and compare the output. The same synthetic fixture is used in every runtime.

npm install @redact-secret/core@0.1.0-beta.13
import { initialize, scanAndRedact } from "@redact-secret/core";

await initialize();
const result = scanAndRedact("API_KEY=SYNTHETIC_REVOKED_CONTEXT_VALUE");
console.log(result.text);
// API_KEY=<SECRET_1>

Rust is installed from crates.io; its first example lives in the Rust guide.

Pinned at build0.1.0-beta.13 is the current beta, observed on the registries 2026-10-03. npm latest points at it today. The command pins it anyway, because latest has moved before. Python spells it 0.1.0b13.

Why the version is written out

Package state comes from one place, the release record, read at build time and shown with the date it was checked. It is never retyped into translated prose.

What you should see

The value is gone and a typed placeholder stands in its place. result.findings describes the family, offset, and length, and carries no plaintext.

How it works · Control

Your data stays in your process.

Detection and redaction run locally, without sending text to a scanning service. No network calls, no telemetry, and the same input always gives the same result.

  1. 01Untrusted textuser input, config, errors, tool results, retrieved documents
  2. 02Application boundarythe last point you control before the text is handed on
  3. 03 · CoreRedact Secretdetection, overlap resolution, policy, and redaction, all in your process
  4. 04Sanitized text + safe findingsfindings describe the match; they never carry the value
  5. 05Logs · storage · traces · tools · modeleach destination receives text that no longer holds the credential

Browser: preventive

A scan in the client catches a pasted credential before it leaves the device. Clients can be modified or skipped, so this scan helps but never enforces anything.

Server: authoritative

The server scans again, independently, before logging, storage, context construction, or model and tool invocation. That scan is the one your security decisions rely on.

Who enforces block

The core reports a block action. Your application is what rejects the request. Redact Secret does not stop anything on its own.

Core, adapters, and vault

Use the core directly, or connect it to the host you already use.

One Rust detection core sits behind every package. Adapters wire it into logging, tracing, and AI workflows, so no host has to recreate the detection rules. The vault is a separate, opt-in way to restore what was redacted. Each card states what that package does not cover.

Core

One engine, three ways in.

GitHub

Core library

Published

@redact-secret/core (npm)

Detection, policy, and redaction in Rust, with one API for JavaScript (Node.js and browsers), Python, and Rust.

Registries
npm 0.1.0-beta.13 · PyPI 0.1.0b13 · crates.io 0.1.0-beta.13

Credentials by default. PII detection is opt-in and off unless you select it.

@redact-secret/wasm (npm)

The browser build of the core. Installed automatically with @redact-secret/core; not meant to be imported directly.

Version
0.1.0-beta.13 · 2026-10-03

Runs on the page or in a Worker. The playground above uses it.

CLI

Published

redact-secret-cli (crates.io)

Reads standard input or one file and writes the sanitized text, for shells, pipelines, and hooks.

Version
0.1.0-beta.13 · 2026-10-03
Install
cargo install redact-secret-cli --version 0.1.0-beta.13 --locked

Installed from crates.io, not npm. PII is opt-in with --pii.

Adapters

Host integrations. They make no decisions of their own: they pass text to the core and hand its answer back.

GitHub

Browser

Web Streams

Published

@redact-secret/core/web-stream (npm)

A TransformStream that redacts text as it streams, shipped inside the core.

Version
0.1.0-beta.13 · 2026-10-03

There is no separate browser adapter package; this core subpath is the browser integration.

Node.js

Pino

Published

@redact-secret/adapter-pino (npm)

Redacts values in log calls and in the finished line, alongside pino’s own path-based redact.

Version
0.1.5 · 2026-10-03
Host
pino ^10.0.0
Core
^0.1.0-beta.6

Not object keys, and nothing a destination or transport adds after the line is written.

@redact-secret/adapter-otel-trace (npm)

A dedicated OpenTelemetry trace adapter wraps the next SpanProcessor and redacts span names, attributes, events, links, and status messages.

Version
0.1.3 · 2026-10-03
Host
@opentelemetry/sdk-trace-base ^2.0.0
Core
^0.1.0-beta.6

Attribute names are not redacted; spans the wrapped processor never receives are out of reach.

@redact-secret/adapter (npm)

createMaskSecrets() for hosts that hand you a value to mask, such as Langfuse.

Version
0.1.8 · 2026-10-03
Core
^0.1.0-beta.6

Covers only what the host routes through its callback.

AI context

Published

@redact-secret/adapter-ai-context (npm)

Builds model context from user input and tool results. Fail-closed and all-or-nothing.

Version
0.1.4 · 2026-10-03
Core
^0.1.0-beta.6

Binary and encoded values are blocked, not decoded. Model output is not covered.

@redact-secret/adapter-mcp (npm)

Scans MCP tools/call and resources/read results before they are logged, stored, or placed in context.

Version
0.1.5 · 2026-10-03
Host
@modelcontextprotocol/sdk >=1.26.0 <=1.30.1, @modelcontextprotocol/client >=2.0.0 <=2.1.0, @modelcontextprotocol/server >=2.0.0 <=2.1.0
Core
^0.1.0-beta.6

Other MCP methods are out of scope; binary payloads block the result by default.

Python

redact-secret-adapters (PyPI)

A logging.Filter that adds value-based redaction to the standard library.

Version
0.1.5 · 2026-10-03
Core
redact-secret <0.2,>=0.1.0b6

Runs only where attached, so put it on every emitting handler rather than on the logger.

redact-secret-adapters[otel] (PyPI)

Wraps the next OpenTelemetry span processor in Python services.

Version
0.1.5 · 2026-10-03
Host
opentelemetry-sdk <2,>=1.16.0

Installed only with the otel extra. A span that cannot be rewritten is dropped, not exported.

redact-secret-adapters (PyPI)

mask_secrets for hosts that hand you a value to mask, such as Langfuse.

Version
0.1.5 · 2026-10-03

Covers only what the host routes through its callback.

Vault

Optional and separate. The core never keeps a value; the vault holds a mapping in memory only when you ask it to, and restores only under your policy.

GitHub

Browser

Vault

Published

@redact-secret/vault (npm)

Replaces a secret with an opaque <rsv_…> token on the way to a model, and restores it only into a field you designate.

Version
0.1.0-beta.5 · 2026-10-03
Core
0.1.0-beta.13

Main thread, or an opt-in dedicated-Worker mode qualified separately. No storage, no network.

Node.js

Vault

Published

@redact-secret/vault (npm)

The same in-memory capture and restore in Node.js 20, 22, and 24.

Version
0.1.0-beta.5 · 2026-10-03
Core
0.1.0-beta.13

Pins one exact core version; it does not install beside a different one.

Vault server

Published

@redact-secret/vault-server (npm)

Authorizes every restore by principal, tenant, source, destination, and value path.

Version
0.1.0-beta.5 · 2026-10-03
Core
0.1.0-beta.13

In-memory is beta. The opt-in persistent profile is alpha and qualified only for its documented PostgreSQL profiles.

Python

redact-secret-vault (PyPI)

A native Python implementation of the vault server’s authorization contract.

Version
0.1.0b5 · 2026-10-03

Research-grade on PyPI. Capture needs Node.js; persistent extras are published but not supported.

Versions, tags, and ranges as published on the registries, observed 2026-10-03.

Public evidence

Claims you can inspect.

Explore supported credential formats, their evidence status, and reproducible benchmark results. The benchmark site publishes its methods and limitations alongside the numbers.

Which problem are you solving?

The problemWhere to start
Find credentials already committed to Git historyGitleaks or TruffleHog
De-identify broad personal data in documents and imagesPresidio or a managed data-protection service
Replace supported credentials in a running application before they reach logs, traces, tools or AI contextRedact Secret

These tools solve different problems and complement each other. The table points you to a starting place; it does not score them.

Next step

Put protection where your data flows.

Start with the core. Add the integration that fits your logs, traces, or AI workflow.