3from __future__ import annotations
4
5▶from functools import partial
6from typing import TYPE_CHECKING, Any, ClassVar, Literal
7
· · ·
52
53 Runs before built-in stream transformers so the redacted text is what
54▶ every downstream consumer sees — both the main protocol event log and
55 the `run.messages` projection that `MessagesTransformer` snapshots into.
56
· · ·
105 with `_redact_value` returns a fresh structure where every
106 message has a redacted copy of its content — the original
107▶ objects in graph state remain intact for the state-level
108 enforcer (`apply_to_tool_results` via `before_model`) to act on
109 independently when the agent loops back.
· · ·
582 * `hash`: Replace with deterministic hash (format: `<type_hash:digest>`)
583
584▶ detector: Custom detector function or regex pattern.
585
586 * If `Callable`: Function that takes content string and returns
· · ·
586▶ * If `Callable`: Function that takes content string and returns
587 list of `PIIMatch` objects
588 * If `str`: Regex pattern to match PII
+ 2 more matches in this file