# Manage Policy

## What is a Policy?

A policy represents a type of data (such as a credit card number) and an action to be performed when data matching that policy is sent to an AI provider.

Subrosa provides a list of common PII and PCI policies.&#x20;

You can also define Custom Policies.

You can view all Policies from `Policy` page.

{% hint style="info" %}
Currently, Subrosa only supports detection in text prompts. We're working on supporting file content detection, stay tuned.
{% endhint %}

## Policy status

A policy is able to be enabled or disabled. You can view policy status from Policy page.

### Disable a Policy

1. Go to Policy Page by clicking
2. Click on a Policy from `Policy` page
3. Toggle `Enable Policy` on `Policy Information` section on the `Configure Policy` page.
4. Click `Confirm`

## Policy Action

You can use `Policy Action` to define the action taken when detecting data is going to be sent to an AI provider.

| Policy Action    | Control                                                                                |
| ---------------- | -------------------------------------------------------------------------------------- |
| Detect (Default) | Detect data in traffic, no action is taken. The traffic will be flagged as suspicious. |
| Block            | Block traffic to an AI provider when the policy matches.                               |
| Mask             | Mask the data in traffic to an AI provider when the policy matches.                    |

## Subrosa Machine Learning Policy

Subrosa provides a list of common PII and PCI policies enabled via machine learning technology. &#x20;

By default, all Subrosa Policies are enabled in `Detect` mode, though you can customise the action that is taken.&#x20;

{% hint style="info" %}
You can disable one or more of the Subrosa default Policies.
{% endhint %}

## Custom Policy

You can create one or more Custom Policies based on your own data, by describing that data in our policy language and defining the action to be taken when a match occurs.

### Create a Custom Policy

1. Click `Policy` in the side menu
2. Click `Create Policy`
3. Supply the required information and the pattern to match on
4. Select an action to be applied when the pattern matches
5. Click `Confirm`

### Update a Custom Policy

* Click `Policy` in the side menu
* Click on a Policy
* Update Policy information and action
* Click `Confirm`

### Delete a Custom Policy

* Click `Policy` in the side menu
* Click on a Policy
* Click `Delete` at the bottom and confirm your action


---

# Agent Instructions: 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:

```
GET https://docs.subrosa.ai/policy/manage-policy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
