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

# Guards

> Author content-inspection Filters and assign them to model and MCP server connections from an MCP client

Author Filters — content-inspection Guards — and bind them to model or MCP server (tool) connections. Text Filters attach to model connections; JSON Filters attach to tool connections. All Guards tools require workspace context.

Editing a Filter deploys a new active version. Assigned connections pick it up on the next gateway sync — history is preserved and can be rolled back to. A Filter whose stored config fails to decode blocks its `(connection, direction)` until the config is fixed — the gateway never relays unfiltered traffic.

## List filters

`dome_guards_list_filters`

List the workspace's Filters, each with its active version and config.

| Parameter | Type | Required | Description   |
| --------- | ---- | -------- | ------------- |
| —         | —    | —        | No parameters |

## Get filter

`dome_guards_get_filter`

Fetch one Filter's active version and config.

| Parameter | Type   | Required | Description         |
| --------- | ------ | -------- | ------------------- |
| `filter`  | string | Yes      | Filter name or UUID |

## List filter versions

`dome_guards_list_filter_versions`

List a Filter's version history, newest first. Rollback-produced versions cite their source version id.

| Parameter | Type   | Required | Description         |
| --------- | ------ | -------- | ------------------- |
| `filter`  | string | Yes      | Filter name or UUID |

## Create filter

`dome_guards_create_filter`

Create a Filter — its first active version. Supply the config via the convenience params (text-only) or `config_json` (any kind).

| Parameter           | Type            | Required                                | Description                                                                |
| ------------------- | --------------- | --------------------------------------- | -------------------------------------------------------------------------- |
| `name`              | string          | Yes                                     | Filter name (workspace-scoped)                                             |
| `description`       | string          | No                                      | One-line description                                                       |
| `redact_substrings` | array of string | No                                      | Substrings to redact in matched responses (text)                           |
| `block_substrings`  | array of string | No                                      | Substrings that block the response on a match (text)                       |
| `redact_ssn`        | bool            | No                                      | Redact US SSN patterns (text)                                              |
| `block_ssn`         | bool            | No                                      | Block the response on an SSN match (text)                                  |
| `config_json`       | string          | For JSON Filters, or full-fidelity text | Protojson `dome.guards.v1.FilterConfig`. Overrides the convenience params. |

The convenience params build at most two components — a `redact` component and a `block` component, redact ordered first — and only produce text Filters. Pass `config_json` to author a JSON Filter or a multi-component text chain.

### JSON Filter config

```json theme={"system"}
{
  "json": {
    "components": [
      {
        "field_actions": [
          { "matcher": { "key": "ssn" },   "action": "FILTER_ACTION_OMIT" },
          { "matcher": { "key": "email" }, "action": "FILTER_ACTION_REDACT" },
          { "matcher": { "key": "card" },  "action": "FILTER_ACTION_BLOCK" }
        ]
      }
    ]
  }
}
```

`BLOCK` withholds the whole message. `OMIT` removes the key and value. `REDACT` rewrites the value with a redaction sentinel. When multiple actions target the same key: `BLOCK` > `OMIT` > `REDACT`.

## Update filter

`dome_guards_update_filter`

Edit metadata in place (`new_name`, `description`), or deploy a new active version by passing any config param. History is preserved.

| Parameter                                                                             | Type   | Required | Description                                   |
| ------------------------------------------------------------------------------------- | ------ | -------- | --------------------------------------------- |
| `filter`                                                                              | string | Yes      | Filter name or UUID                           |
| `new_name`                                                                            | string | No       | New name for the logical Filter               |
| `description`                                                                         | string | No       | New description                               |
| `redact_substrings` / `block_substrings` / `redact_ssn` / `block_ssn` / `config_json` | —      | No       | Any config param deploys a new active version |

Pass at least one of `new_name`, `description`, or a config param.

## Rollback filter

`dome_guards_rollback_filter`

Roll a Filter back to an earlier version. The target version's config is copied forward into a new active version.

| Parameter    | Type   | Required | Description                    |
| ------------ | ------ | -------- | ------------------------------ |
| `filter`     | string | Yes      | Filter name or UUID            |
| `to_version` | number | Yes      | Version number to roll back to |

## Delete filter

`dome_guards_delete_filter`

Hard-delete a Filter and its connection assignments.

| Parameter | Type   | Required | Description         |
| --------- | ------ | -------- | ------------------- |
| `filter`  | string | Yes      | Filter name or UUID |

## List model connection filters

`dome_model_guards_filters_list`

List the text Filters assigned to a model connection, in chain order, grouped by direction.

| Parameter    | Type   | Required | Description           |
| ------------ | ------ | -------- | --------------------- |
| `connection` | string | Yes      | Model connection name |

## Set model connection filters

`dome_model_guards_filters_set`

Replace the entire ordered Filter chain for one direction on a model connection. Only `text`-kind Filters may be assigned.

`response` filters completions the agent receives. `request` filters the outbound prompt before dispatch to the model provider — a match can redact or block the call.

| Parameter    | Type            | Required | Description                                           |
| ------------ | --------------- | -------- | ----------------------------------------------------- |
| `connection` | string          | Yes      | Model connection name                                 |
| `direction`  | string          | Yes      | `response` or `request`                               |
| `filters`    | array of string | Yes      | Ordered Filter names or UUIDs; empty clears the chain |

## List tool connection filters

`dome_tool_guards_filters_list`

List the JSON Filters assigned to an MCP server (tool) connection, in chain order, grouped by direction.

| Parameter    | Type   | Required | Description                |
| ------------ | ------ | -------- | -------------------------- |
| `connection` | string | Yes      | MCP server connection name |

## Set tool connection filters

`dome_tool_guards_filters_set`

Replace the entire ordered Filter chain for one direction on a tool connection. Only `json`-kind Filters may be assigned.

`request` filters run over tool arguments **before** the call reaches the upstream MCP server — matched fields are redacted or omitted, or the whole call is blocked. `response` filters run over the tool result before the agent sees it.

| Parameter    | Type            | Required | Description                                           |
| ------------ | --------------- | -------- | ----------------------------------------------------- |
| `connection` | string          | Yes      | MCP server connection name                            |
| `direction`  | string          | Yes      | `response` or `request`                               |
| `filters`    | array of string | Yes      | Ordered Filter names or UUIDs; empty clears the chain |

## Next steps

Create and assign Filters from Govern. Catalogs cover windows and path syntax:

* [Configure Guards](/govern/guards)
* [Guards](/concepts/controls/guards) concept
* [Guards](/reference/controls/guards) reference
