> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ada.cx/llms.txt.

# redactions

Read and change the [Redactions](/docs/setup/redactions) of your AI Agent. Text rules are regular expressions that remove personal data from conversations. Image rules set which documents in an image the AI Agent does not read. Output redactions keep the value of an API tool output away from the AI Agent, the logs, and the dashboard.

## Commands

| Command                                | What it does                                                                         |
| -------------------------------------- | ------------------------------------------------------------------------------------ |
| `redactions list`                      | Lists the built-in rules and the custom rules, with their status and pattern.        |
| `redactions enable <key>`              | Turns on a built-in rule.                                                            |
| `redactions disable <key>`             | Turns off a built-in rule.                                                           |
| `redactions create`                    | Creates a custom rule from a key and a regular expression.                           |
| `redactions delete <key>`              | Deletes a custom rule.                                                               |
| `redactions images`                    | Shows the image classes and the message. It is the same as `redactions images list`. |
| `redactions images list`               | Shows which image classes the AI Agent withholds, and the message it sends.          |
| `redactions images enable <class>`     | Withholds an image class.                                                            |
| `redactions images disable <class>`    | Lets the AI Agent read an image class.                                               |
| `redactions images message set <text>` | Sets the message that the AI Agent sends when it withholds an image.                 |
| `redactions images message clear`      | Removes the message. The AI Agent then uses its default reply.                       |
| `redactions outputs list`              | Lists the output redactions, with the API tool and the output of each.               |
| `redactions outputs add`               | Redacts one output of an API tool.                                                   |
| `redactions outputs update <id>`       | Changes an output redaction, or turns it on or off.                                  |
| `redactions outputs remove <id>`       | Removes an output redaction. It asks you to confirm.                                 |

## Examples

Turn on the built-in rule for phone numbers:

```bash
adacli acme redactions enable phone_number
```

Create a custom rule for account numbers:

```bash
adacli acme redactions create --key account_number --pattern 'ACC-\d{8}'
```

Let the AI Agent read government ID documents:

```bash
adacli acme redactions images disable government_id
```

Set the message that the AI Agent sends when it withholds an image:

```bash
adacli acme redactions images message set "For your security, I cannot read this image."
```

Redact the `token` output of the API tool "Get account":

```bash
adacli acme redactions outputs add --name "Account token" --action "Get account" --action-output token
```

## Details

* You need the Admin or Owner role to change redaction rules.
* The built-in rules are `credit_card_number`, `phone_number`, `sin`, `ssn`, and `email`. `enable` and `disable` work on built-in rules only.
* The image classes that you can change are `government_id` and `other_credential`. The AI Agent always withholds payment cards.
* The image message is one line of 500 characters or less. It cannot contain `<` or `>`.
* An output redaction works only when it is active. `outputs add` creates an active redaction. Add `--no-active` to create it turned off.
* `--action` and `--action-output` take an ID or a name. To see the output IDs of an API tool, run `api-tools get <id> --json`.
* A redaction matches the output by its ID. A copy of an API tool keeps the output IDs, so one redaction covers the API tool and its copy.
* A change that stops a redaction asks you to confirm. Add `--yes` to confirm.

For every option of a command, run it with `--help`, for example `adacli acme redactions create --help`.

## Related commands

* [`variables`](/adacli/commands/variables): set which variables are sensitive.
* [`conversations`](/adacli/commands/conversations): read conversations to check a rule.
* [`snapshot`](/adacli/commands/snapshot): export the redaction rules with the rest of the configuration.

---

Have any questions? Contact your Ada team, or email us at [](mailto:help@ada.cx?subject=Help%20Docs%20inquiry).