> For the complete documentation index, see [llms.txt](https://docs.ox.security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ox.security/scan-and-analyze-with-ox/scanning/managing-secret-and-pii-detection/managing-secret-and-pii-detection.md).

# Defining Custom Secret and PII Patterns

> **Note:** This capability is currently in Early Access (EA) and is not generally available. To request access, please contact OX technical support.

You can define custom patterns to detect proprietary secrets, internal credentials, or organization-specific PII formats that are not recognized by OX by default.

After a custom pattern is added, it becomes active in subsequent scans across supported OX scanning engines.

1. Go to **Settings** > **Scan settings** > **Secrets**.
2. Enable **Custom Secret/PII Pattern Detection**.

<figure><img src="/files/666CLFaMgxDyRUEOny9o" alt="" width="563"><figcaption></figcaption></figure>

3. In the **Custom patterns** section, select **Add**.

<figure><img src="/files/rrdvG8WfQxoX9jQQOWut" alt="" width="500"><figcaption></figcaption></figure>

4. In the **Basics** tab, configure the pattern settings.

| Field                    | Description                                        |
| ------------------------ | -------------------------------------------------- |
| Secret / PII             | Defines whether the pattern detects secrets or PII |
| Name                     | Display name for the custom pattern                |
| Severity                 | Severity assigned to matching findings             |
| Pattern (regex)          | Regex expression used for matching                 |
| Notes                    | Internal notes for the pattern                     |
| Custom Issue Description | Custom description displayed in related findings   |

5. Optional: In the **Validation** tab, test the Regex pattern against example values before saving the rule.

<figure><img src="/files/1svFrwVZ4Pw6yWeaapNd" alt="" width="499"><figcaption></figcaption></figure>

| Field          | Description                                      |
| -------------- | ------------------------------------------------ |
| Example Secret | Example value used to validate the Regex pattern |

6. Optional: In the **Advanced** tab, configure additional matching controls.

<figure><img src="/files/7evM2DJq4g0OswDrtwTw" alt="" width="497"><figcaption></figcaption></figure>

| Field        | Description                                              |
| ------------ | -------------------------------------------------------- |
| Entropy      | Additional validation used to improve detection accuracy |
| Secret group | Group identifier used during matching                    |

7. Select **Add**.

The pattern becomes active in subsequent scans after it is saved.

## Limits and permissions

| Configuration                            | Value                   |
| ---------------------------------------- | ----------------------- |
| Maximum custom patterns per organization | 20                      |
| Default state                            | Disabled                |
| Required permissions                     | Admin or Policy Manager |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ox.security/scan-and-analyze-with-ox/scanning/managing-secret-and-pii-detection/managing-secret-and-pii-detection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
