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

# ai_redact

> Asks the model to identify sensitive information in the specified categories and replace it with category markers.

Asks the model to identify sensitive information in the specified categories and replace it with category markers.

## Syntax

```sql theme={null}
ai_redact(input, categories[, provider[, model]])
```

## Arguments

* `input`: A VARCHAR expression containing the original text to process.
* `categories`: A nonempty constant `ARRAY<VARCHAR>` containing the categories to redact, such as `name`, `email`, and `phone`.

For the types and default behavior of `provider` and `model`, see [Common calling rules](/documents/4.2/sql-reference/sql-functions/ai-functions/ai_functions.md#common-calling-rules).

## Return value

Returns a nullable VARCHAR. The database asks the model to replace each match with its uppercase category name in square brackets, such as `[EMAIL]` for an email address. If it finds no matches, the model should return the original text.

The original text is sent to the model service. This function does not redact data locally before transmission, and the model may miss sensitive information.

## Examples

```sql theme={null}
SELECT ai_redact('Contact Alice at alice@example.com.', ['name', 'email']);

SELECT ai_redact(
    input => 'Contact Alice at alice@example.com.',
    categories => ['name', 'email'],
    provider => 'support_chat'
);
```


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