agentix.guards.pii¶
pii ¶
PII guards.
PiiUrlGuard (before_call) refuses a tool call whose URL/query-like
arguments contain PII — personal data must never end up in query strings, where
it leaks into logs and referrers.
PiiRedactionGuard (on_answer) masks PII in the model's final answer to
the user — a last-line DLP filter on what leaves the loop. It uses its own,
tighter pattern set (the URL patterns are tuned for detection, which is too
loose for redacting free text without false positives).