Skip to main content

Module redact

Module redact 

Source
Expand description

Scrubbing plaintext secrets out of free text.

Typed values never leak: Value::Secret serializes and displays as SECRET_MASK. Free text is different. A node that needs a secret’s plaintext (an HTTP call, a code sandbox, an LLM provider) can get it echoed back inside an error message, for example a provider error body that repeats the API key. These helpers replace every occurrence of known secret values with SECRET_MASK.

The engine keeps a SecretSet per run (environment secrets, re-supplied resume secrets, secret-typed inputs and node outputs) and scrubs every node error message with it before the error is emitted, retried, stored or turned into outputs.

Structs§

SecretSet
The plaintext of every secret a run has seen, for scrubbing free text.

Constants§

MIN_SCRUB_LEN
Secrets shorter than this are not scrubbed from text: masking every occurrence of a one- to three-character value would mangle messages without protecting anything an attacker could not guess.

Functions§

redact_secrets
Replace every occurrence of each of secrets in text with SECRET_MASK.