# RedactionRule

> **Class** in `langchain`

📖 [View in docs](https://reference.langchain.com/python/langchain/agents/middleware/_redaction/RedactionRule)

Configuration for handling a single PII type.

## Signature

```python
RedactionRule(
    self,
    pii_type: str,
    strategy: RedactionStrategy = 'redact',
    detector: Detector | str | None = None,
)
```

## Constructors

```python
__init__(
    self,
    pii_type: str,
    strategy: RedactionStrategy = 'redact',
    detector: Detector | str | None = None,
) -> None
```

| Name | Type |
|------|------|
| `pii_type` | `str` |
| `strategy` | `RedactionStrategy` |
| `detector` | `Detector \| str \| None` |


## Properties

- `pii_type`
- `strategy`
- `detector`

## Methods

- [`resolve()`](https://reference.langchain.com/python/langchain/agents/middleware/_redaction/RedactionRule/resolve)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/9f232caa7a8fe1ca042a401942d5d90d54ceb1a6/libs/langchain_v1/langchain/agents/middleware/_redaction.py#L397)