Class PIIDetectionHook

java.lang.Object
com.alibaba.cloud.ai.graph.agent.hook.messages.MessagesModelHook
com.alibaba.cloud.ai.graph.agent.hook.pii.PIIDetectionHook
All Implemented Interfaces:
Hook

public class PIIDetectionHook extends MessagesModelHook
Detect and handle Personally Identifiable Information (PII) in agent conversations. This hook detects common PII types and applies configurable strategies to handle them. It can detect emails, credit cards, IP addresses, MAC addresses, and URLs in both user input and agent output. Example: PIIDetectionHook pii = PIIDetectionHook.builder() .piiType(PIIType.EMAIL) .strategy(RedactionStrategy.REDACT) .applyToInput(true) .build();