module FlowEngine::LLM::SensitiveDataFilter

def self.check!(text)

Raises:
  • (SensitiveDataError) - if any sensitive patterns are detected

Parameters:
  • text (String) -- introduction text to scan
def self.check!(text)
  detected = PATTERNS.each_with_object([]) do |(label, pattern), found|
    found << label if text.match?(pattern)
  end
  return if detected.empty?
  raise ::FlowEngine::Errors::SensitiveDataError,
        "Introduction contains sensitive information (#{detected.join(", ")}). " \
        "Please remove all SSN, ITIN, EIN, and account numbers before proceeding."
end