Class PIIDetectionHook
java.lang.Object
com.alibaba.cloud.ai.graph.agent.hook.ModelHook
com.alibaba.cloud.ai.graph.agent.hook.pii.PIIDetectionHook
- All Implemented Interfaces:
Hook
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();
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionafterModel(OverAllState state, RunnableConfig config) beforeModel(OverAllState state, RunnableConfig config) static PIIDetectionHook.Builderbuilder()getName()Methods inherited from class com.alibaba.cloud.ai.graph.agent.hook.ModelHook
getAgentName, setAgentNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.alibaba.cloud.ai.graph.agent.hook.Hook
getHookPositions, getKeyStrategys
-
Method Details
-
builder
-
beforeModel
- Overrides:
beforeModelin classModelHook
-
afterModel
- Overrides:
afterModelin classModelHook
-
getName
-
canJumpTo
-