Documentation
¶
Overview ¶
Package redact replaces credentials and payment details in text with a placeholder that names what was there: "[redacted: card number]".
Second Brain keeps what sessions said and hands it on — to later sessions, to other projects' screens, to agents through `caprock mcp` — so a key or a card number that lands in a memory spreads. Its store runs every memory through Text before it is saved, and the MCP server runs every answer through it before it leaves.
Precision matters as much as recall: a memory full of "[redacted]" where a commit, a UUID, a version or a price was is a memory nobody can use. So a shape alone is trusted only where the shape is distinctive (an `sk-ant-` key, a PEM block); a bare number is a card only when it passes Luhn with a card network's prefix, an IBAN only when its mod-97 checksum holds, and anything else — an account number, a password, a hex secret — only after a label that says what it is.
Index ¶
Constants ¶
const ( KindPrivateKey = "private key" KindAPIKey = "api key" KindToken = "token" KindCard = "card number" KindIBAN = "iban" KindPassword = "password" KindSecret = "secret" KindBankAccount = "bank account" )
Kinds, as the placeholder names them.
Variables ¶
This section is empty.
Functions ¶
func Placeholder ¶
Placeholder is what a value of kind is replaced with.
Types ¶
type Counts ¶
Counts is how many values of each kind a call replaced.
func Text ¶
Text returns s with every value a rule finds replaced by its placeholder, and how many of each kind it replaced. Text that holds nothing comes back unchanged, the same string.