module RubyLLM::AgUI::Redaction

The policy that decides what a tool result or activity payload may put on the wire.

A tool result is arbitrary host data on its way to a browser. It may hold an API key, a customer record or an internal path, and the gem has no way to know which part is a secret. So the default policy publishes the shape and withholds the content, and a host that has decided its payloads are safe says so explicitly:

RubyLLM::AgUI.configure do |config|
  config.redact = RubyLLM::AgUI::Redaction.method(:none)   # publish raw
  config.redact = ->(kind, payload) { MyPolicy.call(kind, payload) }
end

A pattern-matching scrubber is deliberately not the default: it would create confidence in something that cannot be correct, because the gem cannot know what the host considers personal.