Redact Outbound • AI Agent SDK
redact_outbound: Scrub secrets from text on its way to a chat user (safe-by-default).
redact_outbound
Function
</div>
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 (:func:redact_secrets, holding every resolved gateway credential) with a credential-shape regex so an
unregistered token surfaced in a tool result is still masked. Personal data is intentionally out of scope here — an opt-in PII policy layers on top via the wrapper/plugin hook — so ordinary text is never over-redacted.
Zero dependency, never raises: a scrubber error returns the registered-value result rather than blocking delivery.
Signature
def redact_outbound(text: str) -> strParameters
strNo description available.
Returns
strThe result of the operation.
Uses
redact_secretssub
Source
View on GitHubpraisonaiagents/secrets.py at line 346