taint
diapason.security.taint
¶
Taint tracking — information flow control.
Prevents data leakage through tool chains.
TaintLabel
¶
Bases: str, Enum
Labels for tainted data.
TaintSet
dataclass
¶
auto_detect_taint(text)
¶
Auto-detect taint labels in text content.
Uses regex patterns to detect PII and secrets in tool output.
check_taint(tool_name, taint)
¶
Check if taint labels violate the sink policy for tool_name.
Returns a violation description string, or None if clean.
declassify(taint, remove, reason)
¶
Remove a taint label with an explicit reason (for audit).
The reason is not stored on the TaintSet itself but should be logged externally for accountability.
propagate_taint(input_taint, output_text)
¶
Propagate taint: union of input taint with auto-detected output taint.