Run the Data Shield input gate on a user turn's input.
Source:R/input_gate.R
dot-input_gate_scan.RdCall this in the agent loop / Shiny stream AFTER the UserPromptSubmit hook, BEFORE the input is sent to the model. Handles both a bare character scalar (CLI) and a contents list (Shiny: typed text + attachments).
Usage
.input_gate_scan(
input,
settings = list(),
chat = NULL,
on_progress = NULL,
image_scanner = NULL
)Arguments
- input
Character scalar OR a list whose first element is the typed text and whose remaining elements are ellmer Content attachments.
- settings
The agent settings list (
data_shield_engine,data_shield_prompt_on_fail,data_shield_image_scanner).- chat
The ellmer Chat (fallback shield source via attribute).
- on_progress
Optional progress callback forwarded to
scan_prompt().- image_scanner
Optional
function(content_image) -> list(action, ...)for image attachments (default resolves fromsettings$data_shield_image_scanner;NULL= images not scanned).