ResolvedRedactionRule Class — langchain Architecture
Architecture documentation for the ResolvedRedactionRule class in _redaction.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 197cc226_edf5_ed4b_2144_a18d26749cbf["ResolvedRedactionRule"] be639235_9a02_cc2d_5a7d_637d822fb3b3["_redaction.py"] 197cc226_edf5_ed4b_2144_a18d26749cbf -->|defined in| be639235_9a02_cc2d_5a7d_637d822fb3b3 fae00189_d2f4_7398_49ea_3100608cdf41["apply()"] 197cc226_edf5_ed4b_2144_a18d26749cbf -->|method| fae00189_d2f4_7398_49ea_3100608cdf41
Relationship Graph
Source Code
libs/langchain_v1/langchain/agents/middleware/_redaction.py lines 402–422
class ResolvedRedactionRule:
"""Resolved redaction rule ready for execution."""
pii_type: str
strategy: RedactionStrategy
detector: Detector
def apply(self, content: str) -> tuple[str, list[PIIMatch]]:
"""Apply this rule to content, returning new content and matches.
Args:
content: The text content to scan and redact.
Returns:
A tuple of (updated content, list of detected matches).
"""
matches = self.detector(content)
if not matches:
return content, []
updated = apply_strategy(content, matches, self.strategy)
return updated, matches
Source
Frequently Asked Questions
What is the ResolvedRedactionRule class?
ResolvedRedactionRule is a class in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/_redaction.py.
Where is ResolvedRedactionRule defined?
ResolvedRedactionRule is defined in libs/langchain_v1/langchain/agents/middleware/_redaction.py at line 402.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free