% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scanner_options.R
\name{scanner_options}
\alias{scanner_options}
\title{Configure optional text scanners}
\usage{
scanner_options(
  invisible_text = TRUE,
  encoded_payloads = TRUE,
  urls = FALSE,
  malicious_urls = TRUE,
  max_tokens = NULL,
  allowed_languages = NULL,
  language_fn = NULL,
  blocked_topics = NULL,
  blocked_url_hosts = NULL,
  allowed_url_hosts = NULL
)
}
\arguments{
\item{invisible_text}{Whether to flag Unicode format characters such as
zero-width spaces. Normalization removes these characters before rule
matching, but a finding records that evasive formatting was present.}

\item{encoded_payloads}{Whether to inspect URL-encoded and base64-like
payloads by decoding candidates and scanning the decoded text.}

\item{urls}{Whether to create low-severity inventory findings for URLs.}

\item{malicious_urls}{Whether to flag URLs whose hosts are explicitly
blocked or fall outside \code{allowed_url_hosts}.}

\item{max_tokens}{Optional maximum estimated tokens for a single scanned
text. Exceeding the limit creates an OWASP LLM10 block finding.}

\item{allowed_languages}{Optional language allowlist. Uses \code{language_fn}
when supplied, otherwise a minimal ASCII/non-Latin heuristic.}

\item{language_fn}{Optional function that receives text and returns a single
language label.}

\item{blocked_topics}{Optional character vector of regular expressions, or a
named character vector. Matches create topic-ban findings.}

\item{blocked_url_hosts}{Optional character vector of blocked URL hosts.}

\item{allowed_url_hosts}{Optional character vector of allowed URL hosts. When
supplied, URL hosts outside the allowlist are flagged.}
}
\value{
A \code{shieldr_scanner_options} object.
}
\description{
\code{scanner_options()} enables optional checks that sit beside deterministic
policy rules. These scanners are intentionally lightweight and local. They
are useful for catching common wrappers around risky text, such as invisible
Unicode format characters, encoded payloads, disallowed URLs, simple token
budget violations, language allowlists, and topic bans.
}
\details{
Scanner findings use the same finding schema as rule findings and therefore
contribute to \code{risk_score}, \code{action}, audit logs, and explanations.

The encoded-payload scanner tries URL decoding and base64 decoding on
candidate substrings, then runs the active policy rules over decoded text.
It does not execute decoded content. The language scanner is deliberately
basic unless \code{language_fn} is supplied; a custom function should accept a
single string and return a language label such as \code{"en"}, \code{"es"}, or
\code{"non_latin"}.
}
\examples{
scanners <- scanner_options(
  max_tokens = 500,
  blocked_topics = c("internal layoffs", "unreleased earnings")
)

scan_prompt("Summarize this public note.", scanners = scanners)
}
