Skip to main content

redact_outbound

Function
This function is defined in the secrets module.
Scrub secrets from text on its way to a chat user (safe-by-default). Combines the registered-value registry (redact_secrets) with a credential-shape regex so an unregistered token surfaced in a tool result is still masked. Never raises — a scrubber error returns the registered-value result rather than blocking delivery.

Signature

Parameters

str
required
Text on its way to a chat user. None, "", and non-string input are returned unchanged.

Returns

str
The text with every registered secret value and credential-shaped token replaced by [REDACTED].

Source

View on GitHub

praisonaiagents/secrets.py at line 342