scan_tool_output() checks text returned by tools before that text is shown
to a user, stored, or appended back into model context.
Usage
scan_tool_output(
tool_name,
output,
policy = "enterprise_default",
reviewer = NULL,
checks = "rules",
redaction = NULL,
scanners = scanner_options(),
show_tokens = FALSE
)Arguments
- tool_name
Tool name requested by a model or orchestrator.
- output
Tool output text or object coercible to text.
- policy
A
shieldr_policyor built-in policy name.- reviewer
Optional reviewer function or object with
$chat().- checks
One of
"rules","nlp","llm", or"both".- redaction
Optional redaction strategy from
redaction_strategy().- scanners
Optional scanner configuration from
scanner_options().- show_tokens
Whether to attach token counts when
ellmeris available.
Details
Tool outputs are scanned with scan_output() because they are untrusted
downstream content. The returned report stores stage = "tool_output" and
tool_name in metadata.
