> ## 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 and credential-shaped tokens from text on its way to a chat user.

# redact\_outbound

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**secrets**](../modules/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

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

## Parameters

<ParamField query="text" type="str" required={true}>
  Text on its way to a chat user. `None`, `""`, and non-string input are returned unchanged.
</ParamField>

### Returns

<ResponseField name="Returns" type="str">
  The text with every registered secret value and credential-shaped token replaced by `[REDACTED]`.
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/secrets.py#L342">
  `praisonaiagents/secrets.py` at line 342
</Card>
