% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rules.R
\name{shieldr_audit}
\alias{shieldr_audit}
\title{Construct a \code{shieldr_audit}}
\usage{
shieldr_audit(
  input_report = NULL,
  output_report = NULL,
  context_reports = NULL,
  prompt_clean,
  output_raw = NULL,
  elapsed_ms,
  token_estimate,
  action
)
}
\arguments{
\item{input_report}{A \code{shieldr_report}, or \code{NULL}.}

\item{output_report}{A \code{shieldr_report}, or \code{NULL}.}

\item{context_reports}{A list of \code{shieldr_report} objects, or \code{NULL}.}

\item{prompt_clean}{Cleaned prompt.}

\item{output_raw}{Raw model output, or \code{NULL}.}

\item{elapsed_ms}{Elapsed time in milliseconds.}

\item{token_estimate}{Integer token estimate.}

\item{action}{Final action. \code{secure_chat()} may return \code{"refuse"} or
\code{"escalate"} when policy controls map a blocked report to those outcomes.}
}
\value{
A \code{shieldr_audit} S3 object.
}
\description{
Audits collect the scanner reports and operational metadata from a guarded
run.
}
\details{
\code{\link[=secure_chat]{secure_chat()}} builds this object automatically. \code{elapsed_ms} captures
wall-clock elapsed time for the guarded workflow. \code{token_estimate} uses an
\code{ellmer} token counter when one is available and falls back to
\code{ceiling(nchar(text) / 4)} over prompt and output text. It is intended for
guardrails and trend monitoring, not billing reconciliation.
}
\examples{
shieldr_audit(NULL, NULL, NULL, "hello", NULL, 0, 1L, "allow")
}
