> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Redact Outbound • AI Agent SDK

> redact_outbound: Scrub secrets from text on its way to a chat user (safe-by-default).

# redact\_outbound

Function

> This function is defined in the [**secrets**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/secrets.md) 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

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def redact_outbound(text: str) -> str
```

## Parameters

**text** `str` *required*

No description available.

### Returns

**Returns** `str`

The result of the operation.

## Uses

* `redact_secrets`
* `sub`

## Source

> **[View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/secrets.py#L346)**
>
> `praisonaiagents/secrets.py` at line 346


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.