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

# Data Redaction

[Updated in 2026.9](https://docs-classic.cognigy.com/release-notes/2026.9.md)

The *Data Redaction* feature provides an easy way to detect and redact any data, including [personally identifiable information (PII)](https://en.wikipedia.org/wiki/Personal_data), to ensure compliant [logging](https://docs-classic.cognigy.com/ai/agents/test/logs.md) and [analytics](https://docs-classic.cognigy.com/ai/agents/analyze/overview.md). This feature is important in the context of conversational AI due to privacy, trust, compliance, and responsible AI practices.

## Key Benefits

* **Enhanced Data Handling**. Ensures data protection during the processing, logging, and storage of conversations containing sensitive data. Compared to data masking, which hides or selectively excludes information at the [Endpoint](https://docs-classic.cognigy.com/ai/agents/deploy/endpoints/data-protection-and-analytics.md) or Flow level ([Blind Mode Node](https://docs-classic.cognigy.com/ai/agents/develop/node-reference/analytics/blind-mode.md)), data redaction fully removes the sensitive data from all logs and analytics for stronger data protection.
* **Easy Configuration**. Includes a set of [default data types](#default-data-types) you can select to redact, such as credit card numbers or email addresses.
* **Customization**. Lets you add [custom data types](#custom-data-type) to redact. You can use regular expressions (regex) to define patterns for custom data types to detect.

## Prerequisites

For on-premises installations, you control whether data redaction is activated in the `values.yaml` file. By default, data redaction is activated. Depending on which Cognigy version you use, you can deactivate data redaction as follows:

> [tab] Cognigy 2026.9 and later
>
> In the `values.yaml` file, configure the `commonConfigs.cognigyRollout.pii-data-redaction.yaml` key:
>
> > [accordion] Deactivate data redaction for all organizations
> >
> > To deactivate data redaction for all organizations, set `percentage` to `0`.
> >
> > ```yaml theme={null}
> > commonConfigs:
> >   cognigyRollout:
> >     pii-data-redaction.yaml: |
> >       organisations:
> >         percentage: 0
> >         disabled: []
> > ```
>
> > [accordion] Deactivate data redaction for specific organizations
> >
> > To deactivate data redaction for specific organizations, assign organization IDs to the `disabled` array.
> >
> > ```yaml theme={null}
> > commonConfigs:
> >   cognigyRollout:
> >     pii-data-redaction.yaml: |
> >       organisations:
> >         percentage: 100
> >         disabled:
> >           - "<organization-id-1>"
> >           - "<organization-id-2>"
> > ```

> [tab] Cognigy 2026.8 and earlier
>
> In the `values.yaml` file, set the following environment variables:
>
> * `FEATURE_PII_DATA_REDACTION_ROLLOUT` — the percentage of organizations for which data redaction is activated. Set it to `"100"` to activate data redaction for all organizations, or to `"0"` to disable it for all. Values in between activate the feature for that percentage of organizations. The system automatically and consistently determines which organizations are included.
> * `FEATURE_DISABLE_PII_DATA_REDACTION_WHITELIST` — a comma-separated list of organization IDs to explicitly exclude from data redaction. This setting takes precedence over `FEATURE_PII_DATA_REDACTION_ROLLOUT`. For example, `FEATURE_DISABLE_PII_DATA_REDACTION_WHITELIST="<organization-id-1>,<organization-id-2>"`.

## Limitations

* Log entries with `data` payloads over 2.5 MB aren't redacted. They're replaced with a placeholder message. For on-premises installations, you can configure the maximum payload size using the `PII_REDACTION_DEFAULT_MAX_DATA_SIZE_IN_MEGABYTES` environment variable in `values.yaml`. Setting this value higher than 2.5 MB may cause performance issues. Increase it at your own risk.

## Restrictions

* Data redaction uses regex patterns to detect and redact data, which can:
  * Cause false positive matches. For example, the credit card redaction pattern may cause false positives for 3- or 4-digit numbers that are sent in the message input but aren't CVC or CVV numbers.
  * Skip patterns that don't match the [default types](#default-data-types) or a [custom data type](#custom-data-type) you define. For example, if the user enters a phone number with `/` or misspells a company name set to be redacted in a custom data type.
* Custom data types support only Google's [RE2 syntax](https://github.com/google/re2) library for regex patterns.
* Depending on the Cognigy version you use, data redaction works differently with [Slots](https://docs-classic.cognigy.com/ai/platform-features/nlu/slots/overview):

  > [accordion] Cognigy 2026.3 and later versions
  >
  > Data redaction works for patterns detected by Slots only if the Slot matches the entire data redaction pattern. If a Slot matches only part of the pattern, the data isn't redacted as expected.
  >
  > For example, if a credit card number is split across multiple Slots, such as [a number Slot and a date Slot](https://docs-classic.cognigy.com/ai/platform-features/nlu/slots/system-defined.md#list-of-system-defined-slots), the credit card number isn't fully redacted.
  > Make sure you use Slots that match the exact data redaction pattern, or deactivate the Slots that cause the pattern to split either at the [Flow](https://docs-classic.cognigy.com/ai/agents/develop/projects-and-flows/overview#system-slots) or the [Project](https://docs-classic.cognigy.com/ai/administer/access/project-settings.md#nlu-settings) level.
  >
  > If you use [Regex Slots](https://docs-classic.cognigy.com/ai/platform-features/nlu/slots/user-defined/regex.md), you need to remove the [Slot Filler](https://docs-classic.cognigy.com/ai/platform-features/nlu/slot-fillers.md) that contains the Regex Slot.

  > [accordion] Cognigy 2026.2 and earlier versions
  >
  > Data redaction doesn't work for patterns detected by Slots. To redact such data, deactivate Slots at the [Flow](https://docs-classic.cognigy.com/ai/agents/develop/projects-and-flows/overview#system-slots) or the [Project](https://docs-classic.cognigy.com/ai/administer/access/project-settings.md#nlu-settings) level.
  >
  > If you use [Regex Slots](https://docs-classic.cognigy.com/ai/platform-features/nlu/slots/user-defined/regex.md), you need to remove the [Slot Filler](https://docs-classic.cognigy.com/ai/platform-features/nlu/slot-fillers.md) that contains the Regex Slot.

## How to Use

To use the data redaction feature, first check the [default data types](#default-data-types). If none are suitable or if an existing type doesn't match your data due to its pattern rules, you can create a [custom data type](#custom-data-type).

### Default Data Types

The data redaction feature includes the following default data types, covering common forms of PII:

| Data Type | Description | Examples | Redaction Pattern |
| - | - | - | - |
| Credit Card Number | Redacts:<ul><li>16-digit card numbers starting with `3` (Amex), `4` (Visa), `5` (Mastercard), or `6` (Discover). Digits may be separated by spaces or hyphens.</li><li>Card verification values (CVV) or card validation codes (CVC) with 3 or 4 digits. CVC and CVV numbers are redacted only after a credit card number has been recognized and if they are included in the same message as the credit card number.</li></ul>The credit card number redaction is activated by default to protect credit card data and ensure compliance with PCI DSS, GDPR, and CCPA. | <ul><li>Credit card numbers: `4111111111111111`, `4111 1111 1111 1111`, `5555-5555-5555-4444`, `3782-822463-10005`</li><li>CVV or CVC numbers: `123`, `1234`</li></ul> | <ul><li>`[CREDIT CARD REDACTED]`</li><li>`[CVV REDACTED]`</li></ul> |
| Email Address | Redacts email addresses. Must contain a valid local part, an `@` symbol, and a valid domain. By default, the email address redaction is deactivated. | `test@example.com`, `admin@company.org`, `user@domain.com` | `[EMAIL REDACTED]` |
| Phone Number | Redacts phone numbers in U.S. national, U.S. local, or international formats. By default, the phone number redaction is deactivated. | `(555) 123-4567`, `+1 (555) 123-4567`, `555-123-4567`, `5551234567`, `+491575313119`, `+447911123456` | `[PHONE REDACTED]` |
| Social Security Number | Redacts 9-digit U.S. Social Security numbers in `XXX-XX-XXXX` format. By default, the Social Security number redaction is deactivated. | `123-45-6789`, `987-65-4320` | `[SSN REDACTED]` |
| IPv4 Address | Redacts IPv4 addresses in `X.X.X.X` format, where each octet is 0–255. Supports private ranges. By default, the IPv4 address redaction is deactivated. | `192.168.1.1`, `255.255.255.255`, `10.0.0.1` | `[IPv4 REDACTED]` |
| IPv6 Address | Redacts IPv6 addresses, including full, shortened, or loopback (`::1`) forms. By default, the IPv6 address redaction is deactivated. | `2001:0db8:85a3:0000:0000:8a2e:0370:7334`, `::1`, `2001:db8::1`, `fe80::1` | `[IPv6 REDACTED]` |

To activate the data redaction for default data types, follow these steps:

1. In **Manage > Settings**, go to the **Data Redaction Settings** section.
2. Click the subsection of the data type you want to redact and configure the following:
   * **Activate Redaction** — toggle on to activate the redaction for the data type.
   * **Redaction Pattern** — select one of the following options:
     * **Default** — use the default redaction pattern. Each data type has a default redaction pattern, for example, the redaction pattern for credit card numbers is `[CREDIT CARD REDACTED]`.
     * **Custom** — enter a custom redaction pattern. The custom redaction pattern should be enclosed in square brackets and must not contain spaces or special characters. For example, `[PROTECTED_INFO]`.
3. Under **Scope**, select where the data type is redacted:
   * **Logs** — redact the data type on the Logs page.
   * **Analytics** — redact the data type in Insights and the Cognigy OData endpoint.

### Custom Data Type

If you need to redact data that isn't included in the default data types, you can add custom data types.

To add a custom data type, follow these steps:

1. In **Manage > Settings**, click the **Data Redaction Settings** section to expand it.
2. At the bottom of the section, click **+ Custom Data Type** and configure the following:
   * **Name** — enter a unique name.
   * **Regex** — enter a regular expression to detect the data type pattern.
   * **Custom redaction pattern** — enter a custom redaction pattern. The custom redaction pattern should be enclosed in square brackets and must not contain spaces or special characters. For example, `[PROTECTED_INFO]`.
3. Under **Scope**, select where the data type is redacted:
   * **Logs** — redact the data type on the Logs page.
   * **Analytics** — redact the data type in Insights and the Cognigy OData endpoint.

#### Examples

The following table includes examples of regex patterns and redaction patterns for custom data types.

| Custom Data Type | Regex | Redaction Pattern |
| - | - | - |
| ZIP Code | `\b\d{5}-\d{4}\b` | `[REDACTED_ZIP_CODE]` |
| German License Plate | `\b[A-ZÄÖÜ]{1,3}-[A-Z]{1,2}\s\d{1,4}[HE]?\b` | `[REDACTED_DE_LICENSE_PLATE]` |
| US P.O. Box | `\b(?:P\.?O\.?\|POB)\s?Box?\s?\d+\b` | `[REDACTED_US_PO_BOX]` |

## More Information

* [Logs](https://docs-classic.cognigy.com/ai/agents/test/logs.md)
* [Insights](https://docs-classic.cognigy.com/insights/overview.md)
* [Slots](https://docs-classic.cognigy.com/ai/platform-features/nlu/slots/overview)
* [Project Settings](https://docs-classic.cognigy.com/ai/administer/access/project-settings.md)


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