Skip to contents

Backward-compatible alias for scan_prompt().

Usage

preflight_check(
  text,
  policy = "enterprise_default",
  reviewer = NULL,
  checks = "rules",
  redact = TRUE,
  redaction = NULL,
  scanners = scanner_options(),
  show_tokens = FALSE
)

Arguments

text

Prompt text.

policy

A shieldr_policy or built-in policy name such as "comprehensive".

reviewer

Optional reviewer function or object with $chat().

checks

One of "rules", "nlp", "llm", or "both".

redact

Whether to redact matched spans in text_clean.

redaction

Optional redaction strategy from redaction_strategy(). Ignored when redact = FALSE.

scanners

Optional scanner configuration from scanner_options().

show_tokens

Whether to attach token counts when ellmer is available.

Value

A shieldr_report.

Examples

preflight_check("hello")
#> llmshieldr report
#> action: allow
#> risk_score: 0.000
#> findings: 0
preflight_check("hello", show_tokens = TRUE)
#> llmshieldr report
#> action: allow
#> risk_score: 0.000
#> findings: 0
#> tokens: 2