% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tool_guardrails.R
\name{scan_tool_output}
\alias{scan_tool_output}
\title{Scan tool output before it re-enters 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{
\item{tool_name}{Tool name requested by a model or orchestrator.}

\item{output}{Tool output text or object coercible to text.}

\item{policy}{A \code{shieldr_policy} or built-in policy name.}

\item{reviewer}{Optional reviewer function or object with \verb{$chat()}.}

\item{checks}{One of \code{"rules"}, \code{"nlp"}, \code{"llm"}, or \code{"both"}.}

\item{redaction}{Optional redaction strategy from \code{\link[=redaction_strategy]{redaction_strategy()}}.}

\item{scanners}{Optional scanner configuration from \code{\link[=scanner_options]{scanner_options()}}.}

\item{show_tokens}{Whether to attach token counts when \code{ellmer} is available.}
}
\value{
A \code{shieldr_report}.
}
\description{
\code{scan_tool_output()} checks text returned by tools before that text is shown
to a user, stored, or appended back into model context.
}
\details{
Tool outputs are scanned with \code{\link[=scan_output]{scan_output()}} because they are untrusted
downstream content. The returned report stores \code{stage = "tool_output"} and
\code{tool_name} in \code{metadata}.
}
\examples{
scan_tool_output("search_docs", "Result includes neel@example.com")
}
