redact

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package redact scrubs secrets out of text before it's written to the database. Tool outputs routinely contain API keys (a Bash line that did `cat .env`), and a tool call's own input can contain one too (an agent writing a config file). Everything that lands in messages.content or messages.raw goes through Redact first — no exceptions, since we can't know in advance which sessions will have touched a secret.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Redact

func Redact(s string) string

Redact replaces likely secrets in s with a fixed placeholder: named vendor-token patterns, .env-style KEY=VALUE assignments, and a generic high-entropy fallback. It over-redacts on purpose — a false positive blanks out a UUID or a git commit hash, a false negative leaks a key — so when in doubt, this redacts.

func Scan added in v0.2.0

func Scan(s string) []string

Scan reports which redaction rules still match s, without changing it. It exists for auditing already-stored text: a hit means something Redact would scrub today got into the database anyway (rules added after that row was ingested, or a bug). It returns the rule names, never the matched text, so an audit report can't itself leak what it found. The result is empty for text Redact would leave alone, including text Redact already scrubbed.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL