Skip to main content

redact0

Zero-runtime-dependency reversible PII, secret, FHIR Safe Harbor and streaming redaction for JavaScript/TypeScript and Python.

Security note: this package is a best-effort detector/redactor, not a compliance certification or a substitute for a privacy/security review. Validate it against your own data and regulatory requirements before production use.

Requirements

  • Node.js 18+ for the npm package
  • Python 3.10+ for the PyPI package

Install

npm install redact0
python -m pip install redact0

JavaScript / TypeScript quick start

import { createVault, redact } from 'redact0';

const safe = redact({
  email: 'alice@example.com',
  message: 'Contact alice@example.com',
});

const vault = createVault();
const scrubbed = vault.redact('Send the report to alice@example.com').value;
const restored = vault.restore(scrubbed);

Python quick start

from redact0 import Vault, redact

safe = redact({"email": "alice@example.com"})
vault = Vault()
scrubbed = vault.redact("Contact alice@example.com").value
restored = vault.restore(scrubbed)

Build and verify from this repository

npm install
npm run typecheck
npm run build
npm test
npm run check:size

Python checks (from the repository root):

python -m venv .venv
# Windows PowerShell: .venv\Scripts\Activate.ps1
# macOS/Linux: source .venv/bin/activate
python -m pip install -e ./python
python -m pip install pytest
python -m pytest python/tests

The Python package itself declares no runtime dependencies. pytest is only needed to run its tests.

CLI

After building the npm package:

echo "email: alice@example.com" | node dist/cli.cjs
npx redact0 init
npx redact0 scan . --preset secrets
npx redact0 mcp

For Python, after installation:

echo "email: alice@example.com" | redact0

Exports

The npm package defines these subpath exports:

  • redact0/stream
  • redact0/fhir
  • redact0/ai
  • redact0/mcp
  • redact0/logger

The Python package includes redact0.compat.llm_guard for compatibility helpers.

Project layout

  • src/: TypeScript implementation and adapters
  • tests/: TypeScript tests
  • python/src/redact0/: Python implementation
  • python/tests/: Python tests
  • llms.txt, llms-full.txt, context7.json, AGENTS.md: AI-agent and documentation discovery resources

License

MIT. See LICENSE.

Metadata

Release files for redact0 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redact0 1.0.0
File Size Uploaded Provenance Actions
redact0-1.0.0.tar.gz 13.0 kB With provenance Details for redact0-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for redact0 1.0.0
File Interpreter ABI Platform Actions
redact0-1.0.0-py3-none-any.whl Python 3 none any Details for redact0-1.0.0-py3-none-any.whl

Total release size: 27.6 kB

Release files / redact0-1.0.0.tar.gz

Download URL redact0-1.0.0.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d6c28d8119582cb81820e9c95bf5fd5e53655b69db7b2c626d071b36d73919db
BLAKE2b-256 checksum
How to use checksums
51a190a440b4c7f65ff775784da771ae75a561a014a914218301db137467dbb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / redact0-1.0.0-py3-none-any.whl

Download URL redact0-1.0.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04bd7deeecf53d5e97bba70b6d6fe93d20a1a5ebd9a91d1a5a4721e82257010d
BLAKE2b-256 checksum
How to use checksums
973da9977145d98cd57ab41555c0dab4dbb802f7b360d814625bd4574cdec456
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for redact0 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for redact0-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page