RedactionConfig class final
Constructors
-
RedactionConfig({bool enabled = true, bool blockMode = false, Map<
RedactionLayer, bool> layerToggles = const {}, List<RegExp> allowlistRegexes = const [], double minEntropy = 4.5, int minLength = 32, Set<String> toolAllow = const {}, Set<String> toolDeny = const {}}) -
Creates a configuration; see each field for its default.
const
- RedactionConfig.fromJson(Map? json)
-
Restores a configuration written by toJson; tolerates
nullvalues and unknown/invalid keys by ignoring them and falling back to defaults.factory - RedactionConfig.fromYaml(Map? yaml)
-
Parses the
redact:yaml section (same schema as fromJson; invalid values fall back to defaults like every other config section).factory
Properties
-
allowlistRegexes
→ List<
RegExp> -
Matches fully covering a redaction span suppress that span (all
layers). Git SHAs and UUIDs survive via this list.
final
- blockMode → bool
-
Reserved for the stage-2 hook wiring: when
truethe hook layer must fail closed (block the tool call) if redaction itself errors. Stage 1 only carries the flag.final - enabled → bool
-
Master switch: when
falsethe pipeline is a pass-through.final - hashCode → int
-
The hash code for this object.
no setteroverride
-
layerToggles
→ Map<
RedactionLayer, bool> -
Sparse per-layer overrides over the default toggle states.
final
- minEntropy → double
-
Minimum Shannon entropy (bits/char) for the entropy layer.
final
- minLength → int
-
Minimum token length for the entropy layer.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
toolAllow
→ Set<
String> -
Hook-level per-tool redaction policy (issue #24
redact.toolPolicy): when non-empty only these tools are redacted;toolDenyalways wins.final -
toolDeny
→ Set<
String> -
Tools whose output is never redacted (wins over toolAllow).
final
- toolPolicy → RedactionToolPolicy
-
The hook-level policy implied by toolAllow/toolDeny.
no setter
Methods
-
copyWith(
{bool? enabled, bool? blockMode, Map< RedactionLayer, bool> ? layerToggles, List<RegExp> ? allowlistRegexes, double? minEntropy, int? minLength, Set<String> ? toolAllow, Set<String> ? toolDeny}) → RedactionConfig - A copy with the given fields replaced (null = keep current).
-
isLayerEnabled(
RedactionLayer layer) → bool -
Whether
layeris active under this configuration. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> - Serializes this configuration to a JSON-encodable map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override