taint
taint
¶
Taint tracking — information flow control.
Prevents data leakage through tool chains.
Classes¶
TaintLabel
¶
Bases: str, Enum
Labels for tainted data.
TaintSet
dataclass
¶
TaintSet(labels: FrozenSet[TaintLabel] = frozenset())
Immutable set of taint labels attached to data.
Functions¶
union
¶
has
¶
has(label: TaintLabel) -> bool
from_labels
classmethod
¶
from_labels(*labels: TaintLabel) -> TaintSet
Functions¶
check_taint
¶
check_taint(tool_name: str, taint: TaintSet) -> Optional[str]
Check if taint labels violate the sink policy for tool_name.
Returns a violation description string, or None if clean.
Source code in src/openjarvis/security/taint.py
declassify
¶
declassify(taint: TaintSet, remove: TaintLabel, reason: str) -> TaintSet
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.
Source code in src/openjarvis/security/taint.py
auto_detect_taint
¶
auto_detect_taint(text: str) -> TaintSet
Auto-detect taint labels in text content.
Uses regex patterns to detect PII and secrets in tool output.
Source code in src/openjarvis/security/taint.py
propagate_taint
¶
Propagate taint: union of input taint with auto-detected output taint.