Skip to contents

Formats scanner findings for console, Markdown, or HTML presentation.

Usage

explain_findings(findings, format = "text", show_stats = FALSE)

Arguments

findings

A shieldr_report or a list of its finding lists.

format

One of "text", "markdown", or "html".

show_stats

Show formatting time and available usage metrics.

Value

A character vector of formatted finding explanations. For format = "text", the value is returned invisibly after printing bullets.

Details

explain_findings() is a presentation helper. It does not rescore or reclassify findings; it formats the finding metadata already present in a shieldr_report(). Console output uses severity-colored bullets. Markdown and HTML outputs return character vectors suitable for reports, notebooks, or lightweight dashboards. Text output prints one set of bullets and returns the character vector invisibly, so an interactive call does not repeat it.

Examples

report <- scan_prompt("email me at neel@example.com", policy("enterprise_default"))
explain_findings(report)
#> • llm02.pii.email [medium, llm02]: Email address.