% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scan_output.R
\name{scan_output}
\alias{scan_output}
\title{Scan model output}
\usage{
scan_output(
  text,
  policy = "enterprise_default",
  reviewer = NULL,
  checks = "rules",
  redaction = NULL,
  scanners = scanner_options(),
  show_tokens = FALSE
)
}
\arguments{
\item{text}{Model output text.}

\item{policy}{A \code{shieldr_policy} or built-in policy name such as \code{"comprehensive"}.}

\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{
Scans LLM output for sensitive data, unsafe code, agency claims, system
prompt leakage, misinformation markers, and optional NLP intent signals.
}
\details{
Output scanning is the last guardrail before model text is displayed, stored,
or passed to another tool. It runs the policy rule set over the full output
and adds output-specific checks for common failure modes:
\itemize{
\item fenced code blocks are scanned for unsafe code and command patterns
\item excessive-agency language such as "I will now" or "I have deleted"
\item system-prompt structural markers such as "# System" or role declarations
\item high-confidence medical or financial claim markers
}

Use \code{checks = "nlp"} when you want a lightweight local NLP-only pass over
model output. The return value is a \code{\link[=shieldr_report]{shieldr_report()}} with the same scoring
and action semantics as \code{\link[=scan_prompt]{scan_prompt()}}.
}
\examples{
scan_output("A concise answer.")
scan_output("A concise answer.", show_tokens = TRUE)
}
